Skip to content

Commit

Permalink
chore: travis badge on README
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-north committed Feb 16, 2019
1 parent c2ba519 commit e9ff7af
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# mdast-builder

[![Build Status](https://travis-ci.com/mike-north/mdast-builder.svg?branch=master)](https://travis-ci.com/mike-north/mdast-builder)

Use composable functions to buld up a [`mdast`](https://github.com/syntax-tree/mdast) structure

## Use
Expand All @@ -9,12 +11,20 @@ yarn add mdast-builder
```

```ts
import { root, paragraph, text, heading, list, listItem, brk } from 'mdast-builder';
import {
root,
paragraph,
text,
heading,
list,
listItem,
brk
} from 'mdast-builder';
import * as stringify from 'remark-stringify';
import * as unified from 'unified';

const processor = unified().use(stringify, {
bullet: '*',
bullet: '-',
fence: '`',
fences: true,
incrementListMarker: false
Expand All @@ -26,6 +36,7 @@ const output = processor.stringify(
paragraph([
paragraph(text('these are the starting instructions')),
brk,
brk,
list('unordered', [
listItem(text('one')),
listItem(text('two')),
Expand All @@ -41,10 +52,11 @@ const output = processor.stringify(
```md
## Begin

these are the starting instructions
* one
* two
* three
these are the starting instructions

- one
- two
- three
```

## Legal
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('acceptance tests', () => {
expectMd(rootWithTitle(1, text('hello'))).to.eq('# hello\n');
});

it('root foo', () => {
it('README example', () => {
expectMd(
root([
heading(2, text('Begin')),
Expand Down

0 comments on commit e9ff7af

Please sign in to comment.