Markdown generation from ECSchema JSON
npm install @bentley/ecjson2mdsh
npm install -g @bentley/ecjson2md
`
$3
`sh
npm install @bentley/ecjson2md
`
Usage
---------------------------------------------------------------
$3
`sh
ecjson2md -i -r -o
`
_Note: If no search directories are needed, you don't need to include the -r option_
_Note: When using multiple search paths, enclose them in single quotes_
$3
`Typescript
import { ECJsonMarkdownGenerator } from "@bentley/ecjsom2md";
mdGenerator = new ECJsonMarkdownGenerator();
mdGenerator.generate(, `
_Note: Additional static methods are also available for more specific use_
Updating
---------------------------------------------------------------
$3
`sh
npm update -g @bentley/ecjson2md
`
$3
`sh
npm update @bentley/ecjson2md
`
Use with Bemetalsmith
---------------------------------------------------------------
Bemetalsmith with plugin called addRemarks which can be used to splice human written notes into the files that are generated by ecjson2md.
In most cases, Bemetalsmith will do this out-of-the-box without additional configuration.
$3
- The "-n" option in ecjson2md will generate short code for bemetalsmith to include an alert stating that the documentation is for an unreleased schema
- Human-written remarks must be contained in markdown files alongside the generated docs
- Each schema must have a separate remarks file if it has any remarks
- The name of the remarks file does not matter
- The front matter of the remarks file must point to the schema doc that it corresponds to (see below examples)
- The remarks are spliced in "as is" including any markdown tags
$3
`markdown
#
.
.
.
## Classes
###
.
.
.
Base class: [link_to /# text=" "]
.
.
.
<---- Human-written remark for class1 will go here
###
.
.
.
<---- Human-written remark for class2 will go here
###
.
.
.
`
$3
- At the top of the remarks file, include:
`markdown
---
remarksTarget:
---
`
- Add a remark after each ### header
$3
| target.md || remarks.md |
| --------- |----| ---------- |
|.
.
.
\#\#\# Texture
.
.
.
\#\#\# TypeDefinitionElement
.
.
.
\#\#\# TypeDefinitionHasElement || ---
remarksTarget: target.md
---
\#\#\# Texture
More information at docs.example
\#\#\# TypeDefinitionElement
\ready for release\|
⇩ addRemarks ⇩
| target.md || remarks.md |
| --------- |----| ---------- |
|.
.
.
\#\#\# Texture
.
.
.
More information at docs.example
\#\#\# TypeDefinitionElement
\ready for release\
.
.
.
\#\#\# TypeDefinitionHasElement
|| ---
remarksTarget: target.md
---
\#\#\# Texture
More information at docs.example
\#\#\# TypeDefinitionElement
\ready for release\|
Notes
---------------------------------------------------------------
- When using the CLI tool, providing a list of directories that are separated by comma + space such as: `-r ./one, ./two, /three` will only add the first directory to the locator. Use only a comma or quotes instead, e.g. `-r ./one,./two,./three` or `-r './one, ./two, ./three'``