diff --git a/README.md b/README.md index 38fcbdd..bec8fd6 100644 --- a/README.md +++ b/README.md @@ -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": "" } }` | -| `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": "" } }` | +| `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. @@ -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). diff --git a/package-lock.json b/package-lock.json index dbb7a06..233bf7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "json2md", - "version": "1.8.0", + "version": "1.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3e5514d..04d322c 100644 --- a/package.json +++ b/package.json @@ -61,4 +61,4 @@ "bloggify.json", "bloggify/" ] -} \ No newline at end of file +}