Skip to content

mini-epic: AST uniformization across engines for floats #7062

Open
@cscheid

Description

@cscheid

All float (Figures, Tables, etc) emitted before Pandoc should emit the same markdown AST.

  • Jupyter
  • Knitr
  • OJS
  • mermaid
  • dot

Let's start with writing tests the generate the documents so we can inspect them.

  • Decide what ids/classes/attrs need to appear where

Issues that are blocked because of this:

Current status

Test documents are in tests/docs/smoke-all/issues/7062-ast-uniformization/*.qmd.

TODO

  • Create pre-ast Lua filter that checks for the correct structure in the right places, and fails if the divs don't match.
    • I really wish we had a "Pandoc AST validator" module like we do for YAML, so we could write "Pandoc AST schema"... It would be the same technology, even.

Simple layouts

Currently, "simple layouts" (single figure, caption and label) are (by inspection) compatible with each other. Jupyter and Knitr both emit images as an "image-style" float:

![Caption here](./image-here.jpg){#fig-label attributes}

OJS, mermaid, and dot all emit div-style floats:

::: {#fig-label attributes}

FIGURE_CONTENT_HERE

Caption here

:::

The exact nature of the content isn't important. It is not perfectly equivalent across formats, but it doesn't have to be, since our FloatRefTarget node works well with this structure.

Metadata

Metadata

Assignees

Labels

astissues related to AST processingbugSomething isn't workingepicAn issue that contains other issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions