Re: AsciiDoc safe mode unusable in ELinks
Jonas Fonseca <[email protected]>
| Newsgroups | gmane.comp.web.links,gmane.text.formats.asciidoc |
|---|---|
| Message-ID | <[email protected]> |
Kalle Olavi Niemitalo <[email protected]> wrote Sun, Apr 23, 2006: > [ASCIIDOC] doc/elinks.1.html > ERROR: elinks.1.txt: line 38: unsafe: include file: /home/kalle/build/i686-pc-linux-gnu/elinks/doc/option-command.txt > ERROR: elinks.1.txt: line 81: unsafe: {eval:re.match("elinks", "lynx") == None} > ERROR: elinks.1.txt: line 81: unsafe: {eval:re.match("elinks", "lynx") != None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "elinkskeys") == None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "elinkskeys") != None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "elinks.conf") == None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "elinks.conf") != None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "links") == None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "links") != None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "lynx") == None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "lynx") != None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "w3m") == None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "w3m") != None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "wget") == None} > ERROR: elinks.1.txt: line 171: unsafe: {eval:re.match("elinks", "wget") != None} > make: *** [elinks.1.html] Error 1 > > Most of these errors are caused by this macro in asciidoc.conf: > > # Use the man:[] macro to link between elinks manpages > [man-inlinemacro] > {eval:re.match("elinks", "{target}") != None}<a href="{target}.{0}.html">{target}({0})</a> > {eval:re.match("elinks", "{target}") == None}<b>{target}({0})</b> > > I believe this can be rewritten to use conditional attributes and > avoid the unsafe eval, at the cost of requiring AsciiDoc 7.0.4 or > later: > > [man-inlinemacro] > {target@elinks:<a href="{target}.{0}.html">{target}({0})</a>:<b>{target}({0})</b>} But isn't this also fairly new? Anyway I like it and I don't think that many actually build the documentation since they are already available in the tarballs. > However, the first error is more insidious. It comes from this line: > > include::{builddir}option-command.txt[] > > The option-command.txt file is generated by a script that runs > elinks --long-help and converts the result to AsciiDoc. The > output depends on how ELinks was built, so it must be in the > build tree, rather than in the source tree. But elinks.1.txt is > in the source tree, so AsciiDoc in its default safe mode doesn't > let it include the file from the build tree. I don't know. The documentation building has become too complex already. Using VPATH might be a bit ugly so maybe if we could fix both that and this unsafe issue by just copying things to the builddir? On the other hand I have thought about making a small asciidoc wrapper (or even a "to any" wrapper doing .pod and .txt) that did the dependency tracking, etc. Maybe it could copy include files into some tempdir. -- Jonas Fonseca _______________________________________________ elinks-dev mailing list [email protected] http://linuxfromscratch.org/mailman/listinfo/elinks-dev