https://github.com/nswbmw/markdown-css
add CSS to Markdown
https://github.com/nswbmw/markdown-css
Last synced: 3 months ago
JSON representation
add CSS to Markdown
- Host: GitHub
- URL: https://github.com/nswbmw/markdown-css
- Owner: nswbmw
- License: mit
- Created: 2013-09-28T09:37:34.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-01T01:52:24.000Z (about 12 years ago)
- Last Synced: 2025-06-09T11:48:55.992Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 242 KB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### markdown-css ###
As you might expect , markdown-css is a fine choice that add some CSS styles to markdown text , and finally , it will be converted to HTML .
### Installation ###
npm install markdown-css
### Usage ###
It's unbelievably easy to use . For example :
var MC = require('markdown-css');
var result = MC("[google](http://google.com){{#f00 bold 3em}}");
console.log(result);
//=>You just need to put some CSS styles between `{{` and `}}` .
### Examples ###
Here are some simple usage :
**hello world**{{#f00 3em 900}}
//=> hello world**hello world**{{color:#0f0 2em line-height:3em}}
//=> hello world**{{#f00 3em}}**
//=>
hello{{#00f bold 1.5em}}world
//=>helloworld
hello{{rgb(0,255,0) italic 150%}}world
//=>helloworld
hello world
//=>hello world
hello world
{{#f00}}
//=>hello world
{{#f00}}hello world
//=>hello world
hello {{#f00}}world
//=>helloworld
**hello world**{{margin[5px,10px] padding[5px,10px,8px]}}
//=> hello world> hello {{#f00 20px}}world
//=>
hello world
### Customizable ###
The most exciting is that you can make your customized CSS Mapping, like `#000` means `color:#000` , `bold` means `font-weight:bold` . you can find them in `/lib/toCSS.js` .
### LICENSE ###
MIT