Ah! I see. I was hoping it was not hard-coded. 

Fortunately I found a workaround by first writing the name in a temporary 
file and then use {sys:cat name_temp.tmp} in the NAME section and for the 
title problem I send in the custom attribute from the command line using 
the -a switch.

Anyway, thanks for your help.

Best Regards, Magnus

Den fredagen den 6:e juni 2014 kl. 14:08:48 UTC+2 skrev Lex Trotman:
>
> On 6 June 2014 21:13, Magnus Höglund <[email protected] <javascript:>> 
> wrote: 
> > Ok, it compiles, but the intrinsic attribute substitutes to the empty 
> > string. 
> > 
> > Also, if I try to use {docname} in the title (first line of the file) I 
> get 
> > an error message: 
> > 
> > asciidoc: ERROR: test.txt: line 2: undefined attribute in manpage title 
> > asciidoc: FAILED: test.txt: line 2: unexpected error: 
> > asciidoc: ------------------------------------------------------------ 
> > Traceback (most recent call last): 
> >   File "../asciidoc-8.6.9/asciidoc.py", line 5944, in asciidoc 
> >     has_header = document.parse_header(doctype,backend) 
> >   File "../asciidoc-8.6.9/asciidoc.py", line 1592, in parse_header 
> >     Header.parse() 
> >   File "../asciidoc-8.6.9/asciidoc.py", line 1822, in parse 
> >     if mantitle == mantitle.upper(): 
> > AttributeError: 'NoneType' object has no attribute 'upper' 
> > 
>
> Ok, this provided the hint :) 
>
> Due to the special handling required of title and name in the manpage 
> processing, the header and following "name" sections are processed 
> specially, and earlier than they would be for normal documents.  That 
> means it is done before the docname is defined, not after.  You will 
> notice that docname does substitute into the synopsis which is more 
> normally processed. 
>
> Since this is hard coded, I'm not sure what you can do except use your 
> favourite external processor to substitute the document name before 
> passing to asciidoc. 
>
> Cheers 
> Lex 
>
> > 
> > 
> > Attached is the .txt file I used. 
> > 
> > The version of asciidoc I used is 8.6.9. 
> > 
> > This is the command I used: 
> > 
> > asciidoc.py -o test.xml -b docbook -d manpage test.txt 
> > 
> > Best Regards, Magnus 
> > 
> > 
> > Den fredagen den 6:e juni 2014 kl. 11:53:58 UTC+2 skrev Lex Trotman: 
> >> 
> >> Works for me. 
> >> 
> >> Please post a *minimal* example that fails, the version of asciidoc 
> >> and the command(s) you run. 
> >> 
> >> Cheers 
> >> Lex 
> >> 
> >> On 6 June 2014 18:19, Magnus Höglund <[email protected]> wrote: 
> >> > I have a very specific problem regarding the manpage document type. 
> >> > 
> >> > I try to use the {docname} intrinsic (or any other attribute which 
> holds 
> >> > the 
> >> > name of the .txt-file) to set the name title to the same as the file 
> >> > name of 
> >> > the asciidoc source file. 
> >> > 
> >> > The reason I want to do this is because I have a lot of commands to 
> >> > write 
> >> > man pages for, and therefore I wish to automate the process a little 
> by 
> >> > inserting the file name (without the .txt extension) from attributes. 
> >> > 
> >> > I know that the NAME section has very specific requirements, but why 
> >> > can't I 
> >> > put attributes in the title paragraph? 
> >> > 
> >> > However, it seems I can use the {sys:<command>} intrinsic, but why 
> not 
> >> > any 
> >> > other? 
> >> > 
> >> > Best Regards, Magnus 
> >> > 
> >> > -- 
> >> > You received this message because you are subscribed to the Google 
> >> > Groups 
> >> > "asciidoc" group. 
> >> > To unsubscribe from this group and stop receiving emails from it, 
> send 
> >> > an 
> >> > email to [email protected]. 
> >> > To post to this group, send email to [email protected]. 
> >> > Visit this group at http://groups.google.com/group/asciidoc. 
> >> > For more options, visit https://groups.google.com/d/optout. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "asciidoc" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/asciidoc. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to