https://github.com/10sr/dmd
Dynamic MarkDown loader
https://github.com/10sr/dmd
Last synced: about 2 months ago
JSON representation
Dynamic MarkDown loader
- Host: GitHub
- URL: https://github.com/10sr/dmd
- Owner: 10sr
- License: unlicense
- Created: 2013-09-18T02:50:56.000Z (over 12 years ago)
- Default Branch: gh-pages
- Last Pushed: 2015-06-04T07:44:50.000Z (about 11 years ago)
- Last Synced: 2025-03-05T22:44:35.321Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://10sr.github.io/dmd/samples/
- Size: 156 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Dynamic MarkDown loader (dmd.js)
================================
Dynamically convert maridown contents into html and show.
You no longer have to convert markdown contents into html sources manually!
This module depends on `marked.js`.
Usage
-----
First, load `dmd.js` and `marked.js` in your html.
`dmd.js` uses two tags: `div#dmd-content` and `ul#dmd-menu`.
Tag `div#dmd-content` is mandatory. This tag has as children some tags who
have a class `dmd-page`. When these tags are `a` tags, referenced pages are
downloaded when required. Otherwise, the contents of these tags (`innerHTML`)
are saved and converted when loaded.
`ul#dmd-menu` is optional. When this tag exists, `dmd.js` adds links to load
pages defined in `dmd-content`.
After loading `dmd-pages` in `dmd-content`, all contents under `dmd-content` are
removed.
Pages defined by `dmd-pages` can be accessed with hashes, and titles defined the
tags are used for name. For example, when a page like
`README`
is defined, this content can be accessed via a url like `index.html#a%20page`.
License
-------
This software is unlicensed. See `LICENSE` for details.