On 7/23/2012 12:05 AM, ping wrote:
On 7/22/2012 1:36 AM, Lex Trotman wrote:
On 22 July 2012 14:25, ping <[email protected]> wrote:
On 7/21/2012 11:29 PM, Lex Trotman wrote:

On 22 July 2012 13:15, ping <[email protected]> wrote:

experts:
is there a way to define the destination output dir for asciidoc
command?
I know -o provide the dest *file*, but not the dest *dir*.
by default, the output file will be put in the same dir as the source
file...


Just give the output file a directory path.


no that one I tried before sending query, but failed:

//this is OK
ping@640g-laptop:~/living files$ asciidoc -a toc -a toclevels=6 -o
/mnt/public_html/temp/asciidoctips.html asciidoctips.txt

Yes thats correct, if you specify the -o you have to put the full path
to the output file, and the directory specified is the outdir.


got it. the reason I thought something like a -D (dest folder) might be
useful is, you can then easily create a bind/map in vim to generate web
page for all files, regardless of the file name:

:!asciidoc -a toc -a toclevels=6 -D /mnt/my/webserverfolder/ "%"

otherwise you need some more work to generate the output file name from
the input one (side question -- given % as curr filename (abc.txt), how
to get the output filename (abc.html) in general in vim?)

That is the normal behaviour of the -o option on most commands.

Cheers
Lex


asciidoc: WARNING: asciidoctips.txt: line 308: list item index:
expected 1
got 17
asciidoc: WARNING: asciidoctips.txt: line 858: list item index:
expected 1
got 4
asciidoc: WARNING: asciidoctips.txt: line 870: list item index:
expected 1
got 4
ping@640g-laptop:~/living files$
ping@640g-laptop:~/living files$

//this failed
ping@640g-laptop:~/living files$ asciidoc -a toc -a toclevels=6 -o
/mnt/public_html/temp/ asciidoctips.txt
asciidoc: FAILED: asciidoctips.txt: line 4: unexpected error:
asciidoc: ------------------------------------------------------------
Traceback (most recent call last):
   File "/usr/bin/asciidoc", line 5945, in asciidoc
     writer.open(outfile, reader.bom)
   File "/usr/bin/asciidoc", line 4372, in open
     self.f = open(fname,'wb+')
IOError: [Errno 21] Is a directory: '/mnt/public_html/temp'
asciidoc: ------------------------------------------------------------




b.t.w, I found the solution in vim that I can use this to automatically generate output file name for any curr filename.

:w|!asciidoc -a toc -a toclevels=6 -o /mnt/public_html/temp/%:t:r.html "%"


--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to