Skip to content
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

Support of footnotes #4

Open
typiconman opened this issue Mar 24, 2020 · 17 comments
Open

Support of footnotes #4

typiconman opened this issue Mar 24, 2020 · 17 comments
Assignees

Comments

@typiconman
Copy link

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

@typiconman typiconman assigned typiconman and pgmmpk and unassigned typiconman Mar 24, 2020
@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 24, 2020

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.

@pgmmpk pgmmpk closed this as completed Mar 24, 2020
@typiconman
Copy link
Author

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.

@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 24, 2020

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?

@typiconman
Copy link
Author

I am confused. What is the difference between:

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

And the proposed [[double square brackets]]?

@typiconman
Copy link
Author

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

@typiconman typiconman reopened this Mar 24, 2020
@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 24, 2020

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?

@typiconman
Copy link
Author

typiconman commented Mar 24, 2020

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.

@typiconman
Copy link
Author

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

@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 25, 2020

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

@typiconman
Copy link
Author

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

@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 25, 2020

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

@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 25, 2020

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.

@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 25, 2020

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

@typiconman
Copy link
Author

It works, thanks.

@typiconman
Copy link
Author

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?

@pgmmpk
Copy link
Contributor

pgmmpk commented Mar 26, 2020

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...

@ENDrain
Copy link

ENDrain commented Apr 13, 2021

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.

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

No branches or pull requests

3 participants