jupyter-book / myst-spec

MyST is designed to create publication-quality, computational documents written entirely in Markdown.
https://mystmd.org/spec
MIT License
14 stars 6 forks source link

Distribute examples as JSON #27

Closed chrisjsewell closed 2 years ago

chrisjsewell commented 2 years ago

Then you can import them directly for testing (with https://www.typescriptlang.org/tsconfig#resolveJsonModule)

chrisjsewell commented 2 years ago

(i.e. import * as data from 'myst-spec/dist/examples/commonmark.basic.json'

rowanc1 commented 2 years ago

The JSON should be there?

https://unpkg.com/browse/myst-spec@0.0.3/dist/

See the myst.tests.json does the import work? This is the full test suite, but can be stripped down by title I think?

chrisjsewell commented 2 years ago

Ah yeh missed that cheers.

But, as just mentioned on slack, it might be helpful to allow for breaking down by "category" i.e. the original filenames. Either having the tests as separate JSON, or appending it to each test case dict.

For, https://github.com/executablebooks/unified-myst, I wanted to start introducing the tests incrementally (starting with the "basic" commonmark ones)

chrisjsewell commented 2 years ago

No worries, I figured it out