Sábado, 2 de Março de 2013 5:02:28 UTC, Jonathan Waltman escreveu:
>
> > Thanks a lot. It works fine ... but only for the base directory. We have
> > also other .rst files under (for example)
> >
> > source/supplements/dbase
> >
> > and it fails because tries to reproduce this directory tree in the build
> > dir. i.e (Windows + MinGW here)
>
> That little script I gave you was more of an example than a
> definitive solution :)
>
> It didn't handle Windows style file paths (i.e. / vs \)
> Here's a more platform independent version:
>
> import os
> man_pages = []
> for dirpath, dirnames, filenames in os.walk('.'):
> for f in filenames:
> if f.endswith('.rst'):
> srcfile = os.path.normpath(os.path.join(dirpath, f[:-4]))
> outfile = srcfile.replace(os.sep, '-')
> man_pages.append((srcfile,
> outfile,
> 'description of %s' % outfile,
> 'A. Author', 1))
>
>
> --
>
Jonathan,
Thanks again. I understand that it was an example script but I'm not versed
in python / sphinx well enough to do much modifications.
The second version doesn't generate errors but it prepends the directory
structure to the output file name. For example, a file that resides under
supplements/mgd77/mgd77info.rst
will become
supplements-mgd77-mgd77info.1
OK, I could get around this with multiple calls to
outfile = outfile.replace('supplements-', '')
outfile = outfile.replace('mgd77-', '')
While this solves my problem, I think it would be nice to have a general
solution that works like the conversion to html does.
Joaquim
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" 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/sphinx-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.