Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)
Adds a ``Node`` object to the Document.
Returns ``True`` in case of success.

src/r/s/rst-0.1/examples/example1.py   rst(Download)
def main():
    doc = rst.Document('Title of the report')
    para = rst.Paragraph('Just another paragraph. We need few more of these.')
    doc.add_child(para)
    sec = rst.Section('Another', 2)
    doc.add_child(sec)
    para = rst.Paragraph('Can we do this? Yes we can.')
    doc.add_child(para)
    blt.add_item('Debian')
 
    doc.add_child(blt)
 
    blt = rst.Bulletlist()
    blt.add_item('Lisp')
 
    doc.add_child(blt)
 
 

src/r/s/rst-0.1/tests.py   rst(Download)
    def test_paragraph(self):
        "test the paragraph in the document"
        doc = rst.Document(u(""))
        para = rst.Paragraph(u('This is a paragraph.'))
        doc.add_child(para)
    def test_sections(self):
        "test the sections in the document"
        doc = rst.Document(u("Title"))
        sec = rst.Section('Section One', 2)
        doc.add_child(sec)
        sec2 = rst.Section('Section Two', 3)
        doc.add_child(sec2)
        blt.add_item('Fedora')
        blt.add_item('Debian')
        doc.add_child(blt)
        text = doc.get_rst()
        actual_text = u('=\nT\n=\n\n    1. Fedora\n    2. Debian\n\n')