-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConTeXt Writer: Start and Stop Section Levels #5539
Comments
Have you tried the But yes, this should be documented better (was added in 751b5ad)...
Sounds exactly like pandoc templates. |
Detecting when to stop the current `sectionlevel` could be beyond Pandoc's ability in all circumstances.
Not at all. We already have a hierarchicalize
function that does this, which we use for e.g. docbook.
|
Using the following command: $ pandoc -t context --section-divs test.md Produces the following document: \startsection[title={Inflation Theory},reference={inflation-theory}]
\startsubsection[title={13,813 ± 58},reference={section}]
Time did not start with an explosion\ldots{}
\startsubsubsection[title={Relevance},reference={relevance}]
Our Universe's first three minutes produced vast amounts of
protons\ldots{}
\stopsubsubsection
\stopsubsection
\stopsection Would subsections and sub-subsections interfere with embedding documents? (I suspect so because there'd be no way to distinguish an embedded document's |
Regarding the documentation: yes, having a section that describes additional output formats beyond HTML could be useful. |
I would opt for using the |
The following code maps those sectionlevels to
|
Here's a somewhat hacky approach to this: we could return |
What about using the same approach as with JATS XML? |
Could you expand on that? The JATS model has no concept of explicit section levels, the A cleaner approach than what I suggested above might be to make the behavior depend on |
That's basically my suggestion: Just use sectionslevels throughout. Then, when building a standalone document add something like this to the preamble: \definesectionlevels
[default]
[section,
subsection,
subsubsection,
subsubsubsection,
subsubsubsubsection] Or, with \definesectionlevels
[default]
[chapter,
section,
subsection,
subsubsection,
subsubsubsection,
subsubsubsubsection] |
I don't use pandoc + context too much these days, but I'll chime in to say that I support the default output being |
The document hierarchy is now conveyed using the `\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy to include pandoc-generated snippets in documents at arbitrary levels. The more semantic environments "chapter", "section", "subsection", etc. are used if the `--top-level-division` command line parameter is set to a non-default value. Closes: jgm#5539
The document hierarchy is now conveyed using the `\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy to include pandoc-generated snippets in documents at arbitrary levels. The more semantic environments "chapter", "section", "subsection", etc. are used if the `--top-level-division` command line parameter is set to a non-default value. Closes: jgm#5539
The document hierarchy is now conveyed using the `\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy to include pandoc-generated snippets in documents at arbitrary levels. The more semantic environments "chapter", "section", "subsection", etc. are used if the `--top-level-division` command line parameter is set to a non-default value. Closes: #5539
Required for Pandoc 2.19, see jgm/pandoc#5539
Required for Pandoc 2.19, see jgm/pandoc#5539 Co-authored-by: Vedran Miletić <[email protected]>
Background
Using Pandoc 2.7.2, consider the following document:
This results in a document similar to the following:
Problem
By generating
\chapter
,\section
, and\subsection
, etc., it puts constraints around embedding documents within documents. As Hans Hagen wrote on the ConTeXt mailing list:Expected Output
The expected outputs include a standalone document and a document fragment.
Standalone Document
The relevant portions of the standalone document might resemble:
The
[numbers, numbers, numbers]
code reflects the depth of heading levels in the document. If the document has 5 levels, then[numbers, numbers, numbers, numbers, numbers]
may be necessary.Document Fragment
A document fragment could look as follows:
Discussion
Could detecting when to stop the current
sectionlevel
be beyond Pandoc's ability in certain circumstances?The text was updated successfully, but these errors were encountered: