slavonic / cumd

Church Slavonic Markdown Dialect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support of footnotes

typiconman opened this issue · comments

We seem to have a problem with the support of footnotes. Right now the footnote is encoded in the Markdown like this:

text[^n]

[^n]: footnote

This seems to be more or less ignored in VS Code. In cumd's conversion to HTML, this is treated as a bukvitsa (see attached files).
test1.zip

Version 1.3.0 pushed to pypi. Changes:

  • cumd command now allows user to specify extensions to use

Example:

cumd -e footnotes --html input.md output.html

Enables standard extension footnotes.

Tests have been added to confirm that Bukvitsa and Footnotes can be used together with expected results.

Thanks, it works now!
In the documentation here we say that

For footnote use [[footnote text]] (Attention: this is likely to change)

Is this right? We seem to be using [^n] syntax in odt2md.

We need a syntax for CU-style footnotes (кавыки). As of now, we do not have any. Double square brackets was tentative. Code has nothing yet.

Lets decide what pattern we will use and implement?

I am confused. What is the difference between:

꙾text꙾[^n]
[^n]: ꙾note꙾

And the proposed [[double square brackets]]?

Maybe instead of the syntax we have now, it makes more sense to do something like this?
[[꙾text꙾]](꙾note꙾)

Modern footnotes use superscript label. Slavonic ones do not. We need both, because modern and CU-style footnotes can be used in one book (I've seen books that have Preface with modern-style footnotes, with traditional CU-style footnotes in the main text).

Yes, we need both - the labeled span in the text, and the replacement/comment section. Your suggestion looks good.

Another note for the discussion: Markdown is basically a version of HTML. Both do not have any explicit pagination. Footnote handling moves footnote text to the end of the document, or, sometimes, it makes sense to move footnote text just after the current paragraph. Would be also nice to be able to adjust generated HTML. Any ideas, comments?

OK, but the example in question is a Slavonic footnote (strictly speaking, a marginal note, but I don't think we need to make that distinction).

test

Regarding the placement of footnotes, I think it is a layout issue rather than a markup issue. In TeX, the layout engine will decide where to position the notes. In HTML, I don't think there is a trivial way to put the notes after the relevant paragraph. Perhaps what makes sense is to have the notes as tooltip text. This is what is done here.

If we don't use the html flag, the note [^n] is treated as bukvitsa, e.g.:

cumd input.md output.html

If we add the -e flag, the program throws an error:

cumd -e footnote input.md output.html
usage: cumd [-h] [--html] [--extension [EXTENSION [EXTENSION ...]]]
            input output
cumd: error: the following arguments are required: input, output

What is wrong, exactly? To process footnotes (Modern ones) one has to use footnotes extension (this is how Python Markdown works - we may decide add this to the default set, if needed).

Without footnotes extension, caret will be treated as bukvitsa. I think this is acceptable, because footnote syntax is not known to markdown processor without footnotes extension.

Something like this should work as expected:

cumd -e footnotes input.md output.html

I get an error message:

$ cumd -e footnotes 08pnd1.md 08pnd1.html 
usage: cumd [-h] [--html] [--extension [EXTENSION [EXTENSION ...]]]
            input output
cumd: error: the following arguments are required: input, output

Oops. Flag -e is multi-values (so that one can enable multiple extensions: footnotes, latex-math, etc). Therefore, it must be the last on the command line, like this:

cumd input.md output.html -e footnotes

Maybe it make sense to improve this and list extensions with comma separator instead. Then one can put -e at any place in the command line.... Please advise.

Version 1.4.0 improves the implementation of the -e flag:

  1. Long name changed to plural --extensions
  2. multiple extensions can be listed, separated by comma
  3. -e flag now can be in any position on the command line

It works, thanks.

Shall we leave these footnotes the way they are, or do you want to change the Markdown syntax to something like

[[꙾text꙾]](꙾note꙾)

or something else?

Yes, the plan is to add CU-style footnotes, so that both Modern footnotes and CU-style footnotes can be used in the same document, as needed.

I will research the suggested [[꙾text꙾]](꙾note꙾) syntax. Looks good, but may have clashes with MD links...

Looks to me that [['text']]('note') syntax is gonna have clashes with MD alright. But we could use something entirely different to avoid conflicts. Like, {'text'}('note'). { } symbols make no appearance in MD unless I'm horribly wrong. And we could reserve the [['ipsum']] syntax for something else should need arise.