Markdown to GitHub style web

Because GitHub's README styling is actually really nice

Background

If you have a little side project, often you might want a simple landing page. The GitHub README rendering is really beautifully done: clean, simple and modern. The official GitHub markdown to HTML API generates the HTML code, but not the stylesheets necessary to make it look nice.

Using your GitHub README as the main landing point works great for open source projects, where your visitors are developers and are familiar with GitHub, as well as you have all the text right where the code, the Issues and PRs are. But for some projects this isn't ideal. I built this project within a few hours for myself to get WalkWithFriends off the ground fast, without investing in building an actual website, or using a bloated website builder.

Some issues you run into when using GitHub as your main landing page

Solution

A simple script that converts a markdown (.md) file to a single HTML file, that includes all the HTML and CSS code inline, so you can host it anywhere.

There is no need to use this script if you already convert your markdown file to HTML, you can directly use the stylesheet of this repo.

How it works

This project doesn't actually use the GitHub stylesheet, it's far too complex, and has legal implications.

Instead this project does 2 things:

Resulting you get an HTML file that contains everything needed, so you can host the page on GitHub pages, AWS S3, Google Cloud Storage or anywhere else.

Dependencies

npm install

Usage

node convert.js MyPageTitle

This will read the README.md from your current working directory and output the resulting HTML as README.html in the same directory.

Open tasks

Check out the open issues.

Playground to test

Syntax highlighting is also supported. We use highlight.js. We automatically try to detect what language you are using but you can also specify the language if you'd like. You can use this guide for language name aliases.

Here's an example of syntax highlighting:

function isSyntaxHighlightingSupported() {
  return true;
}

Another test:

import { npxImport } from 'npx-import'

//if big-dep isn't installed locally, npxImport will try
//to download, install & load it, completely seamlessly.
const dependency = await npxImport('big-dep')

  1. Numbered list item 1
  2. Numbered list item 2

Inline code comments are 100

Quoted texts are more gray and look differently

Footnotes[1] are now also supported.

Bold text is bold and inline links work as well.

Header 1

Header 2

Header 3

Header 4

Header 5

Normal text content again, lorem ipsum

Text 1 Text 2 Text 3
Text 1 Text 2 Text 3
Text 1 Text 2 Text 3

🔰 Open GitHub page 🔰


[1]: Footnote support via Showdown Footnotes