Skip to content

Commit 66a36dd

Browse files
committed
.
0 parents  commit 66a36dd

23 files changed

+11380
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*.log
3+
.DS_Store
4+
bundle.js

.npmignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
*.log
3+
.DS_Store
4+
bundle.js
5+
test
6+
test.js
7+
example.*
8+
index.html
9+
fonts

LICENSE.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This software is released under the MIT license:
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# stackgl-readme-css
2+
![](http://img.shields.io/badge/stability-experimental-orange.svg?style=flat)
3+
![](http://img.shields.io/npm/v/stackgl-readme-css.svg?style=flat)
4+
![](http://img.shields.io/npm/dm/stackgl-readme-css.svg?style=flat)
5+
![](http://img.shields.io/npm/l/stackgl-readme-css.svg?style=flat)
6+
7+
Reusable CSS for styling README/Markdown content consistently.
8+
9+
**[example here](http://stack.gl/stackgl-readme-css)**
10+
11+
## Usage
12+
13+
[![NPM](https://nodei.co/npm/stackgl-readme-css.png)](https://nodei.co/npm/stackgl-readme-css/)
14+
15+
Can be imported using [sheetify](http://github.com/sheetify/sheetify) or
16+
[rework-npm](https://github.com/reworkcss/rework-npm) like so:
17+
18+
``` css
19+
@import 'stackgl-readme-css';
20+
```
21+
22+
Or required as a string from [browserify](http://browserify.org/) or node:
23+
24+
``` javascript
25+
require('insert-css')(require('stackgl-readme-css'))
26+
```
27+
28+
## Fonts
29+
30+
### Roboto
31+
32+
For headings. Can be sourced easily from [Google Fonts](http://www.google.com/fonts/).
33+
34+
### Fantasque Sans Mono
35+
36+
For body text and code. It's [Open Source](https://github.com/belluzj/fantasque-sans)!
37+
A copy has also been included in this repo for hosting on `gh-pages` with.
38+
39+
## Colors
40+
41+
* Blue: `#66C4FF`
42+
* Yellow: `#FFE169`
43+
* Red: `#FF6F5C`
44+
* Green: `#61FF90`
45+
* Black: `#34363B`
46+
* Dark Grey: `#4A4F5E`
47+
* Grey: `#5B6173`
48+
* Light Grey: `#A9B0C2`
49+
* Lighter Grey: `#DEE7FF`
50+
* White: `#FFFFFF`
51+
52+
## License
53+
54+
MIT. See [LICENSE.md](http://github.com/hughsk/stackgl-readme-css/blob/master/LICENSE.md) for details.

example.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
var pygmentize = require('pygmentize-bundled')
2+
var cheerio = require('cheerio')
3+
var marked = require('marked')
4+
var fs = require('fs')
5+
6+
var markedOpts = {
7+
highlight: function(code, lang, done) {
8+
if (!lang) return done(null, code)
9+
pygmentize({ lang: lang, format: 'html' }, code, function(err, result) {
10+
result = String(result)
11+
result = cheerio.load(result)('.highlight > pre').html()
12+
result = result.trim()
13+
done(err, result)
14+
})
15+
}
16+
}
17+
18+
marked(fs.readFileSync('example.md', 'utf8')
19+
, markedOpts
20+
, function(err, readme) {
21+
if (err) throw err
22+
23+
fs.writeFileSync('index.html', [
24+
'<!DOCTYPE html>'
25+
, '<html>'
26+
, '<head>'
27+
, ' <title>stackgl-readme-css</title>'
28+
, ' <link rel="stylesheet" href="index.css"/>'
29+
, ' <link rel="stylesheet" href="fonts/style.css"/>'
30+
, ' <link href="http://fonts.googleapis.com/css?family=Roboto:400,100,300" rel="stylesheet" type="text/css">'
31+
, ' <style>'
32+
, ' .stackgl-readme {'
33+
, ' margin: 0 auto;'
34+
, ' max-width: 650px;'
35+
, ' padding: 2rem;'
36+
, ' }'
37+
, ' </style>'
38+
, '</head>'
39+
, '<body><div class="stackgl-readme">'
40+
, readme
41+
, '</div></body>'
42+
, '</html>'
43+
].join('\n'))
44+
})

0 commit comments

Comments
 (0)