Repository navigation
schelp: citations, tables, images, instance methods, quotes, multi-paragraph footnotes - #1
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fills the gaps of the schelp backend. See
docs/schelp.mdfor the details of each construct.What changes
[@key]): with the newbibliographyargument ofconvert_schelp, the programpandocwrites the citations (built-in Chicago author-date style), and each citation becomes afootnote::. 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.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.alone in a paragraph givesimage::path#caption::. Relative paths only; SCDoc copies the file fromHelpSource.## Instance methodswith### -nameheadings givesINSTANCEMETHODS::.#### Discussionin a method givesdiscussion::.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.Tests
citations,tables,images,quotes;methodsandfootnotesextended.pandocand are skipped without it;MD2MISC_REQUIRE_PANDOC=1makes that an error, as forsclang. The whole-file comparison of the citations fixture runs only with the Pandoc version intests/schelp/PANDOC_VERSION(3.7.0.2).pandocin both jobs. Checked locally with Podman:ubuntu:24.04(pandoc 3.1.3) anddebian: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.tomlis not changed.