JavaScript Gfm

Open-source JavaScript projects categorized as Gfm | Edit details

Top 6 JavaScript Gfm Projects

  • GitHub repo marked

    A markdown parser and compiler. Built for speed.

    Project mention: Favorite self-rendering Markdown tool in JavaScript | news.ycombinator.com | 2021-12-12
  • GitHub repo showdown

    A bidirectional Markdown to HTML to Markdown converter written in Javascript

    Project mention: A Colorful Textarea | dev.to | 2021-12-20

    Adding syntax highlighting to an input field can be a hard task. supports neither styling of individual characters or words, nor HTML tags within itself, there is no fully supported native solution for that. Most editors work with contenteditable to actually render a fully marked up code snippet and let the user edit its content. This requires a lot of work to get it accessible (as in restore all the native functions of a textarea) and still adds a lot of complexity.
    If you don't want that and are just looking for a quick, dead-simple solution: Here's how to colorize a textarea.

    Solution

    The trick is to separate the input element from the displayed one. We can't color the content of a textarea, but we can make it invisible and replace it with marked up content. This works with monospaced fonts and fonts with a uniform width across normal, bold and italic characters. I'm using this for code and markdown, so that's perfectly acceptable for me. We also need to be careful to match the dimensions of the textarea exactly while only using font-relative units like em, to ensure that the highlight element scales well with the invisible textarea. The cursor is still in the textarea's context, while the text itself is rendered in the highlight element. We want to match every character of the textarea to match the highlighted one on a pixel-perfect basis.

    A 3D explosion schema of the layout. In the background is a greyed out textarea with a colored cursor after the last character. It's content is a code snipet of an empty html5 page. The foreground is the same text, but syntax-highlighted in bright colors. The cursor of the textarea reaches into the foreground.

    I also need to auto-resize my textarea. Since textareas usually scroll vertically, that would mess up the position matching with the highlight element. Auto-resizing seems like a graceful workaround to me.

    The highlghting itself would work with every code parser. I'm using highlight.js to convert markdown to syntax-highlighted HTML. I listen for content changes in the textarea and parse new rendered code on every input. To counter the worst performance hits, I'll just use requestAnimationFrame. Debouncing isn't an option here, because the user would only see what they've written after they've finished typing. That'd be very poor UX.

    Demo

    Note that this example also displays the rendered Markdown in a separate element. I'll use the change listener that I already have to splice in a Markdown renderer: Showdown.

    Pros

    • as accessible as a textarea
    • is a progressively enhanced feature
    • can be styled exactly to your needs
    • dead simple solution compared to a rich text editor

    Cons

    • has performance issues with large texts (as do textareas in general)
    • works only with monospaced fonts
    • works only with auto-sizing textareas

    This article was written in a textarea :)

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • GitHub repo react-markdown

    Markdown component for React

    Project mention: Markdown component without external library? | reddit.com/r/reactjs | 2022-01-10

    Maybe look through the source to figure out how they do it?

  • GitHub repo remarkable

    Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.

    Project mention: Sciter, the 5 MB Electron alternative, has switched to JavaScript | news.ycombinator.com | 2021-12-30

    > we can't take some well-tested, used-by-millions library

    You can.

    Here is an example of Sciter application that uses RemarkableJS library (https://github.com/jonschlinkert/remarkable) as it is:

    https://quark.sciter.com/quark-application-samples/hello-mar...

  • GitHub repo micromark

    the smallest commonmark (optionally gfm) compliant markdown parser that exists; new basis for @unifiedjs (hundreds of projects w/ billions of downloads for dealing w/ content)

    Project mention: How to Safely Render Markdown From a React Component | dev.to | 2021-07-29

    React markdown vs remark react-markdown is a library that provides the React component to render the Markdown markup while remark is a markdown preprocessor built on micromark. It inspects, parses and transforms markdowns.

  • GitHub repo remark-gfm

    remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)

    Project mention: Easy Comments | dev.to | 2021-08-31

    Here React Markdown, React Syntax Highlighter and the Remark GFM plugin is used. React Markdown helps with parsing markdown and Remark GFM adds support for GitHub Flavoured Markdown. React Syntax Highlighter does syntax highlighting for code snippets in a comment.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2022-01-10.

JavaScript Gfm related posts

Index

What are some of the best open-source Gfm projects in JavaScript? This list will help you:

Project Stars
1 marked 26,743
2 showdown 12,215
3 react-markdown 8,168
4 remarkable 5,265
5 micromark 1,129
6 remark-gfm 151
Find remote jobs at our new job board 99remotejobs.com. There are 28 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.
OPS - Build and Run Open Source Unikernels
Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.
github.com/nanovms