2.0.0 • Published 8 months ago

schema-markdown-doc v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

schema-markdown-doc

npm GitHub

The schema-markdown-doc package generates documentation for Schema Markdown schemas.

Links

The Schema Markdown Documentation Component

The schemaMarkdownDoc function generates the element model for a Schema Markdown user type's documentation. For example:

import {parseSchemaMarkdown} from 'schema-markdown/lib/parser.js';
import {schemaMarkdownDoc} from 'schema-markdown-doc/lib/schemaMarkdownDoc.js';

const types = parseSchemaMarkdown(`\
# My struct
struct MyStruct

    # My member
    string member
`);
const elements = schemaMarkdownDoc(types, 'MyStruct');

The element model is rendered using element-model's renderElements function.

import {renderElements} from 'element-model/lib/elementModel.js';

renderElements(window.document.body, elements);

The Schema Markdown Documentation Viewer

To host your Schema Markdown type model's documentation, first, download the schema-markdown-doc application stub to the directory containing your type model's JSON:

curl -O https://craigahobbs.github.io/schema-markdown-doc/extra/index.html

By default, the schema-markdown-doc application stub displays documentation for "model.json". You can override the resource URL and specify a schema title by updating the schema-markdown-doc application stub, "index.html". For example:

~~~ markdown-script
include 'https://craigahobbs.github.io/schema-markdown-doc/doc/app.mds'

schemaMarkdownDoc('myModel.json', 'My Model')
~~~

To host locally, start a local static web server:

python3 -m http.server

You can also override the resource URL by adding the "var.vURL" hash parameter (i.e., "#var.vURL='myModel.json'").

Development

This package is developed using javascript-build. It was started using javascript-template as follows:

template-specialize javascript-template/template/ schema-markdown-doc/ -k package schema-markdown-doc -k name 'Craig A. Hobbs' -k email 'craigahobbs@gmail.com' -k github 'craigahobbs' -k noapp 1
1.8.0

9 months ago

2.0.0

8 months ago

1.9.0

9 months ago

1.7.0

9 months ago

1.6.3

1 year ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.4.6

3 years ago

1.5.4

3 years ago

1.4.5

3 years ago

1.5.3

3 years ago

1.4.4

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.3.0

3 years ago

1.2.1

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.9.12

4 years ago

0.9.11

4 years ago

0.9.10

4 years ago

0.9.9

4 years ago

0.9.8

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago