Showing posts with label how to convert rst2html?. Show all posts
Showing posts with label how to convert rst2html?. Show all posts

Sunday 19 August 2012

How to convert rst2html?


                                                                                                    Pinakin Nayi
                                                                                                    OpenERP, Info-city,
                                                                                                    Gandhinagar.
                                                                                                    (nayi.pinakin@gmail.com)

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;
                                    docutils.transforms.frontmatter.DocTitle).
                 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="http://www.slideshare.net/slideshow/embed_code/7804331" 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="http://www.slideshare.net/openobject/openerp-crm-marketing-screencast" title="OpenERP CRM &amp; Marketing Screencast" target="_blank">OpenERP CRM &amp; Marketing Screencast</a> </strong> from <strong><a href="http://www.slideshare.net/openobject" target="_blank">OpenERP.tv</a></strong> </div>
    </div>
      http://docutils.sourceforge.net/docs/user/rst/quickref.html

You can also refer documentation :

And you can also use Online Demo

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


..Enjoy...