JS M.D. - Client side support for Markdown (based on marked)
Browsers should support markdown in addition of all the HTML versions they support.
But they don't.
This quick'n'dirty hack allows you to write markdown files and generate html content on the client-side, on the fly.
Please open an issue or a pull request if you have bugs, suggestions or improvements.
- Place the index.html file in the root of your website on your server1.
- Create new files, containing your content, formatted in markdown.
- Name those files after the name of each of your pages2 (the internal links in your markdown), and add an
.md
extension to their name3. - Add some CSS style (optional).
- Edit/Add HTML
<meta ... />
fields for SEO (optional). - Profit.
1 Using that code on a local, serverless environment (e.g., double clicking on index.html), will not work, due to the security limitations on Ajax requests.
2 The default page (that corresponds to the link /
) shall be named index.md
.
3 Note that for each markdown link ending with /
, a folder with the name of your link will be searched for and index.md
file, instead of a file ending with .md
placed at the root of your website.