rehype plugins that match how GitHub transforms markdown on their site.
👉 Note: Not yet released, currently being worked on.
- What is this?
- When should I use this?
- Install
- Packages
- Examples
- Types
- Compatibility
- Security
- Related
- Contribute
- Notice
- License
This project is a monorepo that contains many packages that can be used together or on their own, with defaults to match GitHub or with configuration to match your site, to process user content for safe use on the web.
You can use these tools when you need to:
- match GitHub in how it transforms markdown to HTML
- build similar pipelines to bring user content to the masses
Currently, install and use each package manually.
remark-github-break
— turn normal line endings into hard breaks (comments)remark-github-yaml-metadata
— show frontmatter as a table (files)rehype-github-color
— enhance code for colors (comments)rehype-github-dir
— adddir=auto
to elements (everywhere)rehype-github-emoji
— enhance emoji and gemoji (everywhere)rehype-github-heading
— enhance headings (files)rehype-github-highlight
— perform syntax highlighting on code (to do)rehype-github-image
— enhance images (everywhere)rehype-github-link
— enhance links (everywhere)rehype-github-mention
— enhance mentions (to do)rehype-github-notranslate
— enhance raw text withnotranslate
(comments)rehype-github-reference
— enhance references (to do)rehype-github-sanitize
— clean dangerous HTML (to do)
GitHub additionally includes client side code to enhance certain code blocks by evaluating their contents. This behavior is performed by:
viewscreen-geojson
— viewscreen component for geojson and topojsonviewscreen-mermaid
— viewscreen component for mermaidviewscreen-stl
— viewscreen component for STL (3D geometry)
See example/viewscreen/
on how to use them together.
To do:
- Change some things in
hast-util-to-mdast
to match current things that GitHub does there - Investigate task lists
- Investigate port of treelights
- Investigate linking to labels, issues, pulls, files, lines in files,
These packages are fully typed with TypeScript.
Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 16.0+. Our projects sometimes work with older versions, but this is not guaranteed.
To do.
See contributing.md
in rehypejs/.github
for
ways to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
This project is not affiliated with GitHub.