Skip to content

schelp: citations, tables, images, instance methods, quotes, multi-paragraph footnotes - #1

Merged
aeskildsen merged 2 commits into
mainfrom
feature/schelp-gaps
Nov 18, 2026
Merged

aeskildsen merged 2 commits into
mainfrom
feature/schelp-gaps

Conversation

@aeskildsen

@aeskildsen aeskildsen commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Fills the gaps of the schelp backend. See docs/schelp.md for the details of each construct.

What changes

  • Citations ([@key]): with the new bibliography argument of convert_schelp, the program pandoc writes the citations (built-in Chicago author-date style), and each citation becomes a footnote::. The first citation of a source gives its reference entry with the locator, a later citation the short form (Doe 1999, 30.). A citation in a footnote gives the short form in parentheses. There is no list of references. Without a bibliography, a citation stops the conversion as before. md2misc reads Pandoc's JSON tree, not its Markdown output, so that Pandoc's escapes are not read as Markdown again.
  • Tables outside the methods sections give table::. SCDoc has no header row: the header row is a first row in bold; a header row with only empty cells gives no row.
  • Images: ![caption](path) alone in a paragraph gives image::path#caption::. Relative paths only; SCDoc copies the file from HelpSource.
  • Instance methods: ## Instance methods with ### -name headings gives INSTANCEMETHODS::. #### Discussion in a method gives discussion::.
  • Block quotes that are not alerts give italic paragraphs with quotation marks (SCDoc has no quote tag; as in the JITLib overview).
  • Footnotes can have more than one line and paragraph.
  • An inline tag directly after a letter (word**bold**, word[^1]) gave a syntax error in SCDoc, which reads letters directly before :: as a tag name. md2misc now puts a word joiner (U+2060, not visible, no line break) between the letter and the tag. A footnote gets a space in its place, which SCDoc removes in the HTML.
  • The TeX output does not change.

Tests

  • New fixtures: citations, tables, images, quotes; methods and footnotes extended.
  • The citation tests need pandoc and are skipped without it; MD2MISC_REQUIRE_PANDOC=1 makes that an error, as for sclang. The whole-file comparison of the citations fixture runs only with the Pandoc version in tests/schelp/PANDOC_VERSION (3.7.0.2).
  • CI installs pandoc in both jobs. Checked locally with Podman: ubuntu:24.04 (pandoc 3.1.3) and debian:forky (pandoc 3.11, sclang 3.14.1) pass, with only the version-bound comparisons skipped. Locally, 569 tests pass with pandoc 3.7.0.2 and sclang 3.14.1.

The version in pyproject.toml is not changed.

…ragraph footnotes

- Citations with a bibliography: pandoc writes them, and each citation becomes a
  footnote (the reference entry first, the short form after). Opt-in through the
  `bibliography` argument of `convert_schelp`; pandoc is an external program.
- Pipe tables outside the methods sections give `table::`, with the header row in bold.
- An image alone in a paragraph gives `image::path#caption::`.
- `## Instance methods` with `### -name` headings, and `#### Discussion` in a method.
- A block quote that is not an alert gives italic paragraphs in quotation marks.
- Footnotes can have more than one line and paragraph.
- A footnote tag directly after a letter gets a space before it (SCDoc cannot parse
  the tag there, and removes the space in the HTML).
- Tests: fixtures for each construct; pandoc tests are skipped without pandoc
  (MD2MISC_REQUIRE_PANDOC=1 makes it an error), as for sclang. CI installs pandoc.
SCDoc reads letters directly before `::` as the name of a tag, thus
`word**bold**` gave `wordstrong::bold::`, which SCDoc cannot parse. A word
joiner (U+2060) between the letter and the tag is not visible and keeps the
line from breaking there. Footnotes keep the space, which SCDoc removes.
@aeskildsen
aeskildsen merged commit 42aff3f into main Nov 18, 2026
4 checks passed
@aeskildsen
aeskildsen deleted the feature/schelp-gaps branch November 28, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant