Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for more markdown flavors and markup languages #96

Open
2 tasks done
wheelercj opened this issue Jul 28, 2024 · 4 comments
Open
2 tasks done

Add support for more markdown flavors and markup languages #96

wheelercj opened this issue Jul 28, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@wheelercj
Copy link
Collaborator

wheelercj commented Jul 28, 2024

Currently, Stardown focuses mostly on GitHub Flavored Markdown (GFM), but there are many flavors of markdown and many other markup languages.

Examples of markup languages:

@wheelercj wheelercj added the enhancement New feature or request label Jul 28, 2024
@wheelercj wheelercj changed the title Add setting for choosing markdown flavor Add setting for choosing markup language Aug 4, 2024
@wheelercj
Copy link
Collaborator Author

wheelercj commented Aug 11, 2024

I'm currently planning on making the default option "markdown", not "GitHub Flavored Markdown (GFM)", because even though GFM is the main flavor of markdown Stardown should support, it may be useful to allow slightly lower quality GFM output for rarely used markdown features in return for significantly higher compatibility with other markdown flavors. Then anyone who knows they only need GFM can change the setting from "markdown" to "GitHub Flavored Markdown (GFM)" to get the high quality GFM output. Also, some of GFM's features depend on its support for many HTML elements, but it will probably be good to have a way to generate pure markdown without any HTML because some tools, like Hugo, allow using markdown but don't allow using HTML by default.

@wheelercj wheelercj changed the title Add setting for choosing markup language Add support for more markdown flavors and markup languages Aug 15, 2024
@wheelercj
Copy link
Collaborator Author

wheelercj commented Aug 15, 2024

To help prioritize which markup languages to add support for, I searched various markup languages on Google Search Trends to get an approximate measure of their popularity. The results are below. For some of them, I used a different search term like "overleaf" instead of "LaTeX" because unrelated topics were heavily affecting the results.

  1. Markdown
  2. LaTeX
  3. Typst
  4. BBCode
  5. Org mode
  6. Rich Text Format (RTF)
  7. DokuWiki
  8. AsciiDoc
  9. Wikitext a.k.a. Wiki markup a.k.a. Mediawiki markup
  10. OpenDocument (ODF)
  11. RDoc
  12. reStructuredText
  13. DocBook
  14. Wolfram Language notebook
  15. Djot

This is only an approximate ordering of their popularity, not necessarily the order in which these might be added to Stardown, and the list is not exhaustive.

On Google Trends, if "markdown" and "overleaf" are compared with any of the others, the others appear as nearly flat lines at around 0% interest. Overleaf hovers at around half the interest of markdown. Due to that, the chances I will put in the work to add full support for markup languages besides markdown, LaTeX, HTML, and JSON without someone else's help are low.

Markdown flavors

I haven't read much about the various markdown flavors yet, but two of the most important ones appear to be GitHub Flavored Markdown (GFM) and Pandoc's Markdown.

More are listed here: Markdown Flavors · commonmark/commonmark-spec Wiki.

@wheelercj
Copy link
Collaborator Author

Currently, Stardown only writes to the clipboard with navigator.clipboard.writeText, not with navigator.clipboard.write. It's unclear to me right now whether Stardown should ever support multiple MIME types.

Here's an interesting blog post on this topic: The web's clipboard, and how it stores data of different types. Related HN discussion: The web's clipboard, and how it stores data of different types | Hacker News.

@wheelercj
Copy link
Collaborator Author

wheelercj commented Sep 8, 2024

I didn't know until I recently read the CommonMark spec that CommonMark also includes some HTML elements. Stardown currently has two options for the output markup language: "markdown" and "HTML". I think it would be good to have the third option I add be "markdown with some HTML" which keeps as HTML any HTML elements that don't always render well as markdown.

Many markdown editors that render any HTML elements appear to also support some elements not listed in the CommonMark spec, such as sup and sub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant