asciidoc-py / asciidoc-py2

Deprecated python2 implementation of AsciiDoc.py. See asciidoc-py/asciidoc-py for current work.
https://asciidoc.org/
GNU General Public License v2.0
466 stars 128 forks source link

[Question] Document attributes can reference each other, but not conf attributes? #97

Closed ShadowKyogre closed 8 years ago

ShadowKyogre commented 8 years ago

Minimal test case:

:ABC: CYE
:DEF: byee{ABC}

{ABC}{DEF}
hihi

Output when piped to asciidoc: https://ptpb.pw/3X_d.html

Output when piped to asciidoc with asciidoc -a ABC=LOL -a DEF='{ABC}{ABC}NONONO': https://ptpb.pw/T6SM.html

I'm not sure why this happens. I hadn't noticed this for a while since for what I've written, I wrote the attribute definitions in an asciidoc and included those in other asciidocs to get expanded attributes that reference each other.

ShadowKyogre commented 8 years ago

In addition to this, document-level attributes can start with a number. conf level attributes can't, peculiarly enough.

elextr commented 8 years ago

1) it appears that it is substituted, but ABC is found to be undefined and so the DEF attribute is undefined, so your line gets dropped. This could be because the order of processing the command line options is undefined. Best to use the include file method.

2) Attribute names in attribute lists are limited to valid Python identifiers as a side effect of the implementation, and so the parser for document attributes is the same. But command line attributes are not parsed, so they are not limited. Its just a side-effect of the implementation.