Menu

#4 How to programatically use the commandline parameters?

v1.0_(example)
closed
nobody
None
5
2020-09-08
2017-09-12
No

I want to generate html5 plus css of an specific Bootstrap writer but without using the command line

so the code is

from html5css3 import Writer
from docutils.core import publish_string

variable_string='\nsome text\n========='
result = publish_string(variable_string, writer=Writer(), writer_name='html5)

And it returns the expected result en html5 but without bootstrap style, so my next step is to programatically use some command line arguments

cmd >>> rst2html5 --boostrap-css -jequery input.rst > outputfile.html

But I don't know how.

Discussion

  • David Goodger

    David Goodger - 2017-09-12

    Those documents refer to the core Docutils code. But you seem to be using a third-party front-end tool. If you need help for that tool, you should ask its author.

    Note that core Docutils also has a rst2html5.py front end. It is NOT the same as the one you referenced (https://github.com/marianoguerra/rst2html5). I don't know how that one works or if it is compatible, and we cannot help you with specifics about that tool.

     
  • Sebastián López

    It would be helpful to know how it will be the programatically use of the command line

    using by docutils.core Publish

    rst2s5.py --theme medium-black slides.txt slides.html
    

    and an equivalent code could be

    from docutils.core import publish_string
    
    variable_string='\nsome text\n========='
    result = publish_string(variable_string, writer_name='rst2s5')
    

    And again how to pass the theme keyyword. That's because the front end (https://github.com/marianoguerra/rst2html5) also uses the publish_cmdline(writer_name='html', description=description)

     
  • Günter Milde

    Günter Milde - 2020-09-08
    • status: open --> closed
     

Log in to post a comment.