1.6.2 • Published 12 months ago

schema-markdown-doc v1.6.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 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.6.2

12 months ago

1.6.1

12 months ago

1.6.0

1 year ago

1.5.6

1 year ago

1.5.5

2 years ago

1.4.6

2 years ago

1.5.4

2 years ago

1.4.5

2 years ago

1.5.3

2 years ago

1.4.4

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.9.12

3 years ago

0.9.11

3 years ago

0.9.10

3 years ago

0.9.9

3 years ago

0.9.8

3 years ago

0.9.7

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago