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

add log node #38

Open chrisjsewell opened 2 years ago

chrisjsewell commented 2 years ago

docutils has the concept of a system_message node, which can be inserted into the AST at points of failure.

As an example, in unified-myst, this is what is currently output for an error in the table directive:

```{table} This is a caption
:name: test
:class: a

Hallo

```yaml
type: root
children:
  - type: mystDirective
    name: table
    args:
      - This is a caption
    options:
      name: test
      class:
        - a
    value: Hallo
    bodyOffset: 4
    children:
      - type: log
        message: >-
          Error parsing content block for the "table" directive: exactly one
          table expected.
        level: error