Skip to content

Commit cae4c4d

Browse files
committed
first commit
0 parents  commit cae4c4d

16 files changed

+613
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[test/fixtures/*]
16+
insert_final_newline = false
17+
trim_trailing_whitespace = false

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Enforce Unix newlines
2+
*.* text eol=lf
3+
*.css text eol=lf
4+
*.html text eol=lf
5+
*.js text eol=lf
6+
*.json text eol=lf
7+
*.less text eol=lf
8+
*.md text eol=lf
9+
*.yml text eol=lf
10+
11+
*.jpg binary
12+
*.gif binary
13+
*.png binary
14+
*.jpeg binary

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.sublime-*
2+
_gh_pages
3+
actual
4+
bower_components
5+
node_modules
6+
npm-debug.log
7+
temp
8+
test/actual
9+
tmp
10+
TODO.md
11+
vendor

.jshintrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"asi": false,
3+
"boss": true,
4+
"indent": 2,
5+
"curly": true,
6+
"eqeqeq": true,
7+
"eqnull": true,
8+
"esnext": true,
9+
"immed": true,
10+
"latedef": true,
11+
"laxcomma": false,
12+
"newcap": true,
13+
"noarg": true,
14+
"node": true,
15+
"sub": true,
16+
"undef": true,
17+
"unused": true,
18+
"mocha": true
19+
}

.npmignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*.sublime-*
2+
_gh_pages
3+
actual
4+
bower_components
5+
node_modules
6+
npm-debug.log
7+
temp
8+
test/actual
9+
tmp
10+
TODO.md
11+
vendor
12+
13+
# npmignore
14+
test
15+
.editorconfig
16+
.gitattributes
17+
.jshintrc
18+
.verb*
19+
CONTRIBUTING.md

.verb.md

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# {%= name %} {%= badge("fury") %}
2+
3+
> {%= description %}
4+
5+
6+
## Usage examples
7+
8+
With Handlebars:
9+
10+
```handlebars
11+
{{md "posts/foo.md"}}
12+
```
13+
14+
Results in something like:
15+
16+
17+
```html
18+
<h1>Heading</h1>
19+
<blockquote>
20+
<p>this is markdown</p>
21+
</blockquote>
22+
<p>foo bar baz</p>
23+
```
24+
25+
{%= include("install-npm", {save: true}) %}
26+
27+
28+
## Register the helper
29+
30+
> This should work with any engine, here are a few examples
31+
32+
### [template]
33+
34+
Register the helper for use with any template engine
35+
36+
```js
37+
template.helper('{%= nickname %}', require('{%= name %}'));
38+
```
39+
40+
### [assemble]
41+
42+
To register the helper for use with [assemble] v0.6.x:
43+
44+
```js
45+
assemble.helper('{%= nickname %}', require('{%= name %}'));
46+
```
47+
48+
### [verb]
49+
50+
Register the helper for use with [verb]:
51+
52+
```js
53+
var verb = require('verb');
54+
verb.helper('{%= nickname %}', require('{%= name %}'));
55+
```
56+
57+
### [handlebars]
58+
59+
```js
60+
var handlebars = require('handlebars');
61+
handlebars.registerHelper('{%= nickname %}', require('{%= name %}'));
62+
```
63+
64+
### [Lo-Dash] or [underscore]
65+
66+
```js
67+
var {%= nickname %} = require('{%= name %}');
68+
69+
// as a mixin
70+
_.mixin({{%= nickname %}: {%= nickname %}});
71+
_.template('<%= _.{%= nickname %}("posts/foo.md") %>', {});
72+
//=> '<h1>heading</h1>\n'
73+
74+
// passed on the context
75+
_.template('<%= {%= nickname %}("posts/foo.md") %>', {{%= nickname %}: {%= nickname %}});
76+
//=> '<h1>heading</h1>\n'
77+
78+
// as an import
79+
var settings = {imports: {{%= nickname %}: {%= nickname %}}};
80+
_.template('<%= {%= nickname %}("posts/foo.md") %>', {}, settings);
81+
//=> '<h1>heading</h1>\n'
82+
```
83+
84+
85+
## Run tests
86+
87+
```bash
88+
npm test
89+
```
90+
91+
92+
## Contributing
93+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})
94+
95+
To request or contribute a helper to the [github.com/helpers][helpers] org, please read [this contributing guide][guide] to get started.
96+
97+
## Author
98+
{%= include("author") %}
99+
100+
## License
101+
{%= copyright() %}
102+
{%= license() %}
103+
104+
***
105+
106+
{%= include("footer") %}
107+
108+
[assemble]: https://github.com/assemble/assemble
109+
[generator-verb]: https://github.com/assemble/generator-verb
110+
[handlebars-helpers]: https://github.com/assemble/handlebars-helpers/
111+
[handlebars]: https://github.com/wycats/handlebars.js/
112+
[helpers]: https://github.com/helpers
113+
[Lo-Dash]: https://lodash.com/
114+
[template]: https://github.com/jonschlinkert/template
115+
[underscore]: https://github.com/jashkenas/underscore
116+
[verb]: https://github.com/assemble/verb
117+
[guide]: https://github.com/helpers/requests

CONTRIBUTING.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
To contribute a helper to the [github.com/helpers][helpers] org, follow these steps:
2+
3+
### 1. Use [generator-verb] to generate the project, including documentation.
4+
5+
To install [generator-verb], run:
6+
7+
```bash
8+
npm i -g generator-verb
9+
```
10+
11+
### 2. Generate your helper project
12+
13+
In the command line, run:
14+
15+
```bash
16+
yo verb --helper
17+
```
18+
19+
### 3. Create a repo
20+
21+
Create a repo on GitHub under your own account.
22+
23+
### 4. Last, request a transfer
24+
25+
Create an issue to [request a transfer](https://github.com/helpers/requests/issues/new) to the [helpers] org.
26+
27+
[assemble]: https://github.com/assemble/assemble
28+
[generator-verb]: https://github.com/assemble/generator-verb
29+
[handlebars-helpers]: https://github.com/assemble/handlebars-helpers/
30+
[handlebars]: https://github.com/wycats/handlebars.js/
31+
[helpers]: https://github.com/helpers
32+
[Lo-Dash]: https://lodash.com/
33+
[template]: https://github.com/jonschlinkert/template
34+
[underscore]: https://github.com/jashkenas/underscore
35+
[verb]: https://github.com/assemble/verb
36+
[guide]: https://github.com/helpers/requests

LICENSE-MIT

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

README.md

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# helper-md [![NPM version](https://badge.fury.io/js/helper-md.svg)](http://badge.fury.io/js/helper-md)
2+
3+
> Markdown template helper. Uses remarkable to render markdown in templates. Should work with Handlebars, Lo-Dash or any template engine that supports helper functions.
4+
5+
6+
## Usage examples
7+
8+
With Handlebars:
9+
10+
```handlebars
11+
{{md "posts/foo.md"}}
12+
```
13+
14+
Results in something like:
15+
16+
17+
```html
18+
<h1>Heading</h1>
19+
<blockquote>
20+
<p>this is markdown</p>
21+
</blockquote>
22+
<p>foo bar baz</p>
23+
```
24+
25+
## Install with [npm](npmjs.org)
26+
27+
```bash
28+
npm i helper-md --save
29+
```
30+
31+
32+
## Register the helper
33+
34+
> This should work with any engine, here are a few examples
35+
36+
### [template]
37+
38+
Register the helper for use with any template engine
39+
40+
```js
41+
template.helper('md', require('helper-md'));
42+
```
43+
44+
### [assemble]
45+
46+
To register the helper for use with [assemble] v0.6.x:
47+
48+
```js
49+
assemble.helper('md', require('helper-md'));
50+
```
51+
52+
### [verb]
53+
54+
Register the helper for use with [verb]:
55+
56+
```js
57+
var verb = require('verb');
58+
verb.helper('md', require('helper-md'));
59+
```
60+
61+
### [handlebars]
62+
63+
```js
64+
var handlebars = require('handlebars');
65+
handlebars.registerHelper('md', require('helper-md'));
66+
```
67+
68+
### [Lo-Dash] or [underscore]
69+
70+
```js
71+
var md = require('helper-md');
72+
73+
// as a mixin
74+
_.mixin({md: md});
75+
_.template('<%= _.md("posts/foo.md") %>', {});
76+
//=> '<h1>heading</h1>\n'
77+
78+
// passed on the context
79+
_.template('<%= md("posts/foo.md") %>', {md: md});
80+
//=> '<h1>heading</h1>\n'
81+
82+
// as an import
83+
var settings = {imports: {md: md}};
84+
_.template('<%= md("posts/foo.md") %>', {}, settings);
85+
//=> '<h1>heading</h1>\n'
86+
```
87+
88+
89+
## Run tests
90+
91+
```bash
92+
npm test
93+
```
94+
95+
96+
## Contributing
97+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/helpers/helper-md/issues)
98+
99+
To request or contribute a helper to the [github.com/helpers][helpers] org, please read [this contributing guide][guide] to get started.
100+
101+
## Author
102+
103+
**Jon Schlinkert**
104+
105+
+ [github/helpers](https://github.com/helpers)
106+
+ [twitter/helpers](http://twitter.com/helpers)
107+
108+
## License
109+
Copyright (c) 2014 Jon Schlinkert
110+
Released under the MIT license
111+
112+
***
113+
114+
_This file was generated by [verb](https://github.com/assemble/verb) on December 12, 2014. To update, run `npm i -g verb && verb`._
115+
116+
[assemble]: https://github.com/assemble/assemble
117+
[generator-verb]: https://github.com/assemble/generator-verb
118+
[handlebars-helpers]: https://github.com/assemble/handlebars-helpers/
119+
[handlebars]: https://github.com/wycats/handlebars.js/
120+
[helpers]: https://github.com/helpers
121+
[Lo-Dash]: https://lodash.com/
122+
[template]: https://github.com/jonschlinkert/template
123+
[underscore]: https://github.com/jashkenas/underscore
124+
[verb]: https://github.com/assemble/verb
125+
[guide]: https://github.com/helpers/requests

0 commit comments

Comments
 (0)