diff --git a/.eslintrc.json b/.eslintrc.json index dd5cffd..4c047d8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,7 +9,6 @@ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", - "plugin:jest/recommended", "plugin:prettier/recommended" ], "globals": { @@ -20,7 +19,7 @@ "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", - "project": ["./tsconfig.json"] + "project": ["./src/tsconfig.json", "./test/tsconfig.json", "./scripts/tsconfig.json"] }, "plugins": ["@typescript-eslint", "no-skip-tests", "no-only-tests"], "rules": { @@ -41,7 +40,7 @@ "settings": { "import/resolver": { "node": { - "extensions": [".js", ".ts", ".spec.ts"] + "extensions": [".js", ".ts"] } } } diff --git a/.github/workflows/lint_and_unittests.yml b/.github/workflows/lint_and_unittests.yml index 0890cab..e2e5fe6 100644 --- a/.github/workflows/lint_and_unittests.yml +++ b/.github/workflows/lint_and_unittests.yml @@ -10,17 +10,17 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - - name: Use Node.js 12.x - uses: actions/setup-node@v1 + - name: Use Node.js + uses: actions/setup-node@v4 with: - node-version: 12.x + node-version: 20.x - run: npm install - run: npm run lint @@ -28,20 +28,19 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x] + node-version: [20.x] steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install - - name: Run the tests and generate coverage reportst + - name: Run the tests run: npm run test - - run: npm run build diff --git a/.gitignore b/.gitignore index 419a7de..77a4b80 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,8 @@ index.js docs/_build docs/examples/*.md docs/nodes -docs/myst.schema.md \ No newline at end of file +docs/myst.schema.md +*.tsbuildinfo + +build +/test/compiled.ts diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index 62c7c0e..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1,29 +0,0 @@ -# Jupyter Book settings -# Learn more at https://jupyterbook.org/customize/config.html - -title: '' -author: Executable Book Project -logo: images/logo-wide.svg - -# Force re-execution of notebooks on each build. -# See https://jupyterbook.org/content/execute.html -execute: - execute_notebooks: force - -# Define the name of the latex output file for PDF builds -latex: - latex_documents: - targetname: book.tex - -# Information about where the book exists on the web -repository: - url: https://github.com/executablebooks/myst-spec # Online location of your book - -# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository -html: - # favicon: images/favicon.ico - # google_analytics_id: G-XXX or UA-XXX - use_issues_button: true - use_repository_button: true - use_edit_page_button: true - extra_navbar: Maintained by Executable Books diff --git a/docs/_toc.yml b/docs/_toc.yml deleted file mode 100644 index 68370e4..0000000 --- a/docs/_toc.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Table of contents -# Learn more at https://jupyterbook.org/customize/toc.html - -format: jb-book -root: index -chapters: - - file: features/overview - - file: features/commonmark - - file: features/admonitions - - file: features/figures - - file: features/tables - - file: features/math - - file: features/references - - file: features/footnotes - - file: features/blocks - - file: myst.schema diff --git a/docs/commonmark.md b/docs/commonmark.md index 8f38ffe..b44d063 100644 --- a/docs/commonmark.md +++ b/docs/commonmark.md @@ -4,5 +4,4 @@ A basic Markdown Abstract Syntax Tree, mdast, is defined at [](https://github.co ## Deviations commonmark mdast -- According to the mdast spec [list items](https://github.com/syntax-tree/mdast#listitem) may only have [flow content](https://github.com/syntax-tree/mdast#flowcontent) children. However, according to the commonmark spec, list items may also be flow or phrasing content, such as [text](https://spec.commonmark.org/0.30/#example-255). This depends on spacing between the list items in the original document. In myst-spec, we choose to follow the commonmark spec and allow `ListItem` children to be `FlowContent` or `PhrasingContent`. - The commonmark spec presents `+++` as an invalid thematic break in [example 44](https://spec.commonmark.org/0.30/#example-44). However, in Myst `+++` is a block break, a non-commonmark feature. Therefore we simply removed example 44 in our test cases. diff --git a/docs/examples/blocks.yml b/docs/examples/blocks.yml index bb36e77..fb9badc 100644 --- a/docs/examples/blocks.yml +++ b/docs/examples/blocks.yml @@ -4,26 +4,23 @@ cases: type: root children: - type: blockBreak - myst: |- - +++ + myst: +++ - title: block break node - with metadata mdast: type: root children: - type: blockBreak meta: '{"meta": "data"}' - myst: |- - +++ {"meta": "data"} + myst: '+++ {"meta": "data"}' - title: block break node - with broken metadata mdast: type: root children: - type: blockBreak meta: '{"meta: data}' - myst: |- - +++ {"meta: data} + myst: '+++ {"meta: data}' - title: block break nodes - dividing flow content - id: blockbreak + id: blockBreak mdast: type: root children: diff --git a/docs/examples/cmark_spec_0.30.yml b/docs/examples/cmark_spec_0.30.yml index eb6d058..f8d0bcb 100644 --- a/docs/examples/cmark_spec_0.30.yml +++ b/docs/examples/cmark_spec_0.30.yml @@ -142,8 +142,10 @@ cases: - type: listItem spread: true children: - - type: text - value: foo + - type: paragraph + children: + - type: text + value: foo - type: list ordered: false spread: false @@ -151,8 +153,10 @@ cases: - type: listItem spread: true children: - - type: text - value: bar + - type: paragraph + children: + - type: text + value: bar - type: list ordered: false spread: false @@ -160,8 +164,10 @@ cases: - type: listItem spread: true children: - - type: text - value: baz + - type: paragraph + children: + - type: text + value: baz myst: " - foo\n - bar\n\t - baz\n" html: |-