Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Oct 8, 2020
1 parent 6976acc commit 3bcb3f5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,22 @@ Converts a JSON input to markdown.

**Supported elements**

| Type | Element | Data | Example |
|--------------|--------------------|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `h1` | Heading 1 | The heading text as string. | `{ h1: "heading 1" }` |
| `h2` | Heading 2 | The heading text as string. | `{ h2: "heading 2" }` |
| `h3` | Heading 3 | The heading text as string. | `{ h3: "heading 3" }` |
| `h4` | Heading 4 | The heading text as string. | `{ h4: "heading 4" }` |
| `h5` | Heading 5 | The heading text as string. | `{ h5: "heading 5" }` |
| `h6` | Heading 6 | The heading text as string. | `{ h6: "heading 6" }` |
| `p` | Paragraphs | The paragraph text as string or array (multiple paragraphs). | `{ p: "Hello World"}` or multiple paragraphs: `{ p: ["Hello", "World"] }` |
| `blockquote` | Blockquote | The blockquote as string or array (multiple blockquotes) | `{ blockquote: "Hello World"}` or multiple blockquotes: `{ blockquote: ["Hello", "World"] }` |
| `img` | Image | An object or an array of objects containing the `title`, `source` and `alt` fields. | `{ img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } }` |
| `ul` | Unordered list | An array of strings representing the items. | `{ ul: ["item 1", "item 2"] }` |
| `ol` | Ordered list | An array of strings representing the items. | `{ ol: ["item 1", "item 2"] }` |
| `code` | Code block element | An object containing the `language` (`String`) and `content` (`Array` or `String`) fields. | `{ code: { "language": "html", "content": "<script src='dummy.js'></script>" } }` |
| `table` | Table | An object containing the `headers` (`Array` of `String`s) and `rows` (`Array` of `Array`s or `Object`s). | `{ table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } }` or `{ table: { headers: ["a", "b"], rows: [["col1", "col2"]] } }` |
| `link` | Link | An object containing the `title` and the `source` fields. | `{ title: 'hello', source: 'https://ionicabizau.net' }
| Type | Element | Data | Example |
|--------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `h1` | Heading 1 | The heading text as string. | `{ h1: "heading 1" }` |
| `h2` | Heading 2 | The heading text as string. | `{ h2: "heading 2" }` |
| `h3` | Heading 3 | The heading text as string. | `{ h3: "heading 3" }` |
| `h4` | Heading 4 | The heading text as string. | `{ h4: "heading 4" }` |
| `h5` | Heading 5 | The heading text as string. | `{ h5: "heading 5" }` |
| `h6` | Heading 6 | The heading text as string. | `{ h6: "heading 6" }` |
| `p` | Paragraphs | The paragraph text as string or array (multiple paragraphs). | `{ p: "Hello World"}` or multiple paragraphs: `{ p: ["Hello", "World"] }` |
| `blockquote` | Blockquote | The blockquote as string or array (multiple blockquotes) | `{ blockquote: "Hello World"}` or multiple blockquotes: `{ blockquote: ["Hello", "World"] }` |
| `img` | Image | An object or an array of objects containing the `title`, `source` and `alt` fields. | `{ img: { title: "My image title", source: "http://example.com/image.png", alt: "My image alt" } }` |
| `ul` | Unordered list | An array of strings representing the items. | `{ ul: ["item 1", "item 2"] }` |
| `ol` | Ordered list | An array of strings representing the items. | `{ ol: ["item 1", "item 2"] }` |
| `code` | Code block element | An object containing the `language` (`String`) and `content` (`Array` or `String`) fields. | `{ code: { "language": "html", "content": "<script src='dummy.js'></script>" } }` |
| `table` | Table | An object containing the `headers` (`Array` of `String`s) and `rows` (`Array` of `Array`s or `Object`s) and optionally `aligns` (`Array` of `String`s). | `{ table: { headers: ["a", "b"], rows: [{ a: "col1", b: "col2" }] } }` or `{ table: { headers: ["a", "b"], rows: [["col1", "col2"]] } }` or `{ table: { headers: ["a", "b"], aligns: ["left", "center"], rows: [["col1", "col2"]] } }` |
| `link` | Link | An object containing the `title` and the `source` fields. | `{ title: 'hello', source: 'https://ionicabizau.net' } |

You can extend the `json2md.converters` object to support your custom types.

Expand Down Expand Up @@ -319,14 +319,15 @@ If you are using this library in one of your projects, add it in this list. :spa
- `rober19-config`
- `solidity-benchmark`
- `@bonitasoft/dependency-list-to-markdown`
- `dokuinjs`
- `lggn`
- `gatsby-source-google-docs-sheets`
- `machine-ip`
- `parse-google-docs-json`
- `node-red-contrib-json2md`
- `gatsby-source-google-docs`
- `@feizheng/react-markdown-props`I am using this library to generate documentation for my projects, being integrated with [blah](https://github.com/IonicaBizau/node-blah).
- `@feizheng/react-markdown-props`
- `@s-ui/changelog`
- `dokuinjs`
- `gatsby-source-google-docs`I am using this library to generate documentation for my projects, being integrated with [blah](https://github.com/IonicaBizau/node-blah).



Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
"bloggify.json",
"bloggify/"
]
}
}

0 comments on commit 3bcb3f5

Please sign in to comment.