Thank you.  I've included this code in the trunk.

    - Stephen

On Jun 7, 8:51 pm, yarko <[email protected]> wrote:
> I had been using Leo (and enjoying it) for keeping a Sphinx document
> up-to-date and congruent with development.
>
> However, I wanted to keep closer to the Sphinx way of naming and
> building (and locating files), so that it would be easier to keep up
> with new versions of sphinx (or templates), as well as to import
> existing projects.
>
> The changes I wanted were really only 2:
>
> -  name the rst source file  *.rst;
> -  not have output format (i.e. "html") tied to any part of the source
> filenames;
>
> For the first, I added a configuration option for file name extension,
> consistent with current option naming for "intermediate" files.
> The default is '.txt', as is the current use in Leo documentation
> files.    To make it '.rst' (or anything else), projects only need to
> add an rst3 option:
>
> @string rst3_write_intermediate_extension = .rst
>
> Maybe someone else will also find this handy.
>
> - Yarko
>
> === modified file 'leo/core/leoRst.py'
> --- leo/core/leoRst.py  2010-05-26 14:19:45 +0000
> +++ leo/core/leoRst.py  2010-06-07 21:59:27 +0000
> @@ -288,6 +288,7 @@
>              'rst3_underline_characters': '''#=+*^~"'`-:><_''',
>              'rst3_verbose':True,
>              'rst3_write_intermediate_file': False, # Used only if
> generate_rst is True.
> +            'rst3_write_intermediate_extension': '.txt',
>              # Mode options...
>              'rst3_code_mode': False, # True: generate rst markup from
> @code and @doc parts.
>              'rst3_doc_only_mode': False, # True: generate only from
> @doc parts.
> @@ -850,7 +851,9 @@
>                      return False
>
>              if self.getOption('write_intermediate_file'):
> -                name = self.outputFileName + '.txt'
> +                # name = self.outputFileName + '.txt'
> +                ext = self.getOption('write_intermediate_extension')
> +                name = self.outputFileName.rsplit('.',1)[0] + ext
>                  if g.isPython3: # 2010/04/21
>                      f = open(name,'w',encoding=self.encoding)
>                  else:

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" 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/leo-editor?hl=en.

Reply via email to