hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
310 stars 60 forks source link

Commented out regions generate errors #109

Closed simetenn closed 6 years ago

simetenn commented 7 years ago

It seems commented out regions are parsed and then generate errors. Commented out regions should be ignored completely by Doconce.

This file:

# text[^footnote]
# [^footnote]: This is a footnote

Gives the following output:

$doconce format latex error.do.txt 
translating doconce text in error.do.txt to latex
*** error: definition of footnote with name "footnote"
    has no corresponding footnote [^footnote]
KGHustad commented 7 years ago

I think DocOnce currently tries to translate comments in the do.txt file into comments in the target language. That behaviour doesn't really make sense to me, though. I assume DocOnce then tries to parse the comment as normal source text, which causes trouble.

A workaround for now is to wrap comments causing errors in a ifdef clause with an undefined variable.

KGHustad commented 6 years ago

Lines which start with a double hash are removed from the document altogether. The following does not cause an error:

## text[^footnote]
## [^footnote]: This is a footnote

This is mentioned in the manual, but it's easy to miss.