diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2011-01-25 13:23:19 +1300 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2011-01-25 13:23:19 +1300 |
commit | 96f076777392dd02b7afa0c4ffde7c3c74d0c4ff (patch) | |
tree | 411b0ecc100c8ebc6e94cbc2ca47646fcc57874a | |
parent | 0cfb9a7c57c01433abe5b1b07f2ed09cb7a44942 (diff) | |
download | asciidoc-96f076777392dd02b7afa0c4ffde7c3c74d0c4ff.tar.gz |
FIXED: If the input and output file names were different then the output file
name was incorrectly used to synthesize docinfo file names. Reported by
Christian Zuckschwerdt.
-rwxr-xr-x | asciidoc.py | 5 | ||||
-rw-r--r-- | doc/asciidoc.txt | 9 | ||||
-rw-r--r-- | examples/website/index.txt | 3 |
3 files changed, 13 insertions, 4 deletions
diff --git a/asciidoc.py b/asciidoc.py index b6f0551..084f32e 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -1348,8 +1348,9 @@ class Document(object): if self.outfile != '<stdout>': self.attributes['outfile'] = self.outfile self.attributes['outdir'] = os.path.dirname(self.outfile) - self.attributes['docname'] = os.path.splitext( - os.path.basename(self.outfile))[0] + if self.infile == '<stdin>': + self.attributes['docname'] = os.path.splitext( + os.path.basename(self.outfile))[0] ext = os.path.splitext(self.outfile)[1][1:] elif config.outfilesuffix: ext = config.outfilesuffix[1:] diff --git a/doc/asciidoc.txt b/doc/asciidoc.txt index f63d00d..eba92ca 100644 --- a/doc/asciidoc.txt +++ b/doc/asciidoc.txt @@ -4134,7 +4134,7 @@ predefined intrinsic attributes: {revdate} document revision date (from document header) {docdate} document last modified date {doctime} document last modified time - {docname} document file name without extension + {docname} document file name without extension (note 6) {docfile} document file name (note 5) {docdir} document input directory name (note 5) {doctitle} document title (from document header) @@ -4201,6 +4201,10 @@ predefined intrinsic attributes: the current input file which may be the root document or an included file. When the input is being read from the standard input (`stdin`) these attributes are undefined. + +6. If the input file is the standard input and the output file is not + the standard output then `{docname}` is the output file name sans + file extension. ====== @@ -5488,7 +5492,8 @@ docinfo2:: Include `docinfo.<ext>` and `<filename>-docinfo.<ext>` Where `<filename>` is the file name (sans extension) of the AsciiDoc input file and `<ext>` is `.html` for HTML outputs or `.xml` for -DocBook outputs. The following example will include the +DocBook outputs. If the input file is the standard input then the +output file name is used. The following example will include the `mydoc-docinfo.xml` docinfo file in the DocBook `mydoc.xml` output file: diff --git a/examples/website/index.txt b/examples/website/index.txt index df06a52..2b98ef7 100644 --- a/examples/website/index.txt +++ b/examples/website/index.txt @@ -315,6 +315,9 @@ and I'll add them to the list. - The http://csrp.iut-blagnac.fr/jmiwebsite/home/[JMI website] hosts
a number of extras for AsciiDoc and Slidy written by Jean-Michel
Inglebert.
+- Christian Zuckschwerdt has written a
+ https://github.com/zuckschwerdt/asciidoc.tmbundle[TextMate bundle]
+ for AsciiDoc.
Please let me know if any of these links need updating.
|