Hi list,

I'm looking to implement a consistent syntax for cross-references in
KeenWrite <https://keenwrite.com/> and am wondering what you think would
make the most sense for translating into ConTeXt commands.

First, some background (the first two give an overview, the others are
cross-reference references for various syntaxes):

   - https://talk.commonmark.org/t/cross-references-and-citations/4013/7
   - https://thesynack.com/posts/markdown-captions
   - https://quarto.org/docs/authoring/cross-references.html
   - https://mystmd.org/guide/cross-references
   - https://lierdakil.github.io/pandoc-crossref
   - https://github.com/tomduck/pandoc-eqnos

I'm leaning towards the following syntax:

Markdown Item (table, blockquote, TeX block, figure, code, R chunk, etc.)

: caption text {#type:label}

See [@type:label] for details.

There's a unit test that shows what's currently being generated with a
number of examples for images, tables, blockquotes, internationalization,
and so on:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/test/java/com/keenwrite/processors/markdown/extensions/references/CrossReferencesExtensionTest.java#L51

The code is a work-in-progress; so the tests may have changed depending on
if/when you view the Java source code. Presently, the captions produce
anchor references, mostly. The following seems easier to typeset using
ConTeXt:

<p><span class="caption">Meschiya Lake - Lucky Devil <a data-type="lyrics"
name="blues" /></span></p>

This diverges from the HTML specification for tables (table/caption) and
figures (figure/figcaption). It would also mean having to write ConTeXt
macros that flip the spans and anchors to produce a caption such as:

*Lyrics 1.1.* Meschiya Lake - Lucky Devil

While there are plenty of ways of presenting captions (e.g., multi-column
images with sub-figure numbers) the majority of cross-references are to a
single "thing" with a single "caption".

What are your thoughts on this proposal? (Keeping in mind I'm the only
person working on KeenWrite and while I'm trying to keep the syntax
compatible with pandoc, implementing the full pandoc-crossref syntax is out
of scope for me.

Thank you!
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to