Sunday, 19 August 2012

How to convert rst2html?

                                                                                                    Pinakin Nayi
                                                                                                    OpenERP, Info-city,

How to convert rst2html??
 Here are code that may be useful to you.
 Before that install python-docutils

Step : 1 
     Import library
                 from docutils.core import publish_string
 Step : 2
     overides :  that is overide the default setting.
                 embed_stylesheet : that is true/false that make to use default stylesheet or not
                 doctitle_xform   : Enable or disable the promotion of a lone top-level section
                                    title to document title (and subsequent section title to
                                    document subtitle promotion;
                 stylesheet_path='./css/voidspace.css', you can set external style sheet

   Examples :
         overrides = dict(embed_stylesheet= False, doctitle_xform= False)
         output = publish_string(source= desc, writer_name= 'html', settings_overrides= overrides)

Html rst tags : 
      put Video in rst :
    .. raw:: html

    <div style="margin-top:10px;">
      <iframe src="" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="" title="OpenERP CRM &amp; Marketing Screencast" target="_blank">OpenERP CRM &amp; Marketing Screencast</a> </strong> from <strong><a href="" target="_blank"></a></strong> </div>

You can also refer documentation :

And you can also use Online Demo

How to look like : 
 before : 
  After : (apply rst2html)


No comments:

Post a Comment