From: David G. <go...@py...> - 2008-04-20 22:15:11
|
[Peter McNabb - 2008-04-20 17:50] > In a document, I declare a table of contents like this: > > .. contents:: > :backlinks: none > > From a python script, I read this document into "raw_content" and > call publish_parts() like this: > > from docutils import core > parts = core.publish_parts(source=raw_content,writer_name='html') > > When I go to use the html output, stored in "parts['body']", backlinks > exist. I thought I turned them off? Is there something else I need to > do to disable the backlinks? It works for me: >>> source=""" ... .. contents:: :backlinks: none ... ... one ... === ... ... para ... ... two ... === ... ... para ... """ >>> from docutils import core >>> parts = core.publish_parts(source=source, writer_name='html') >>> print parts['body'] <div class="contents topic" id="contents"> <p class="topic-title first">Contents</p> <ul class="simple"> <li><a class="reference internal" href="#one" id="id1">one</a></li> <li><a class="reference internal" href="#two" id="id2">two</a></li> </ul> </div> <div class="section" id="one"> <h1>one</h1> <p>para</p> </div> <div class="section" id="two"> <h1>two</h1> <p>para</p> </div> No backlinks (links from the <h1>s back to the table of contents). What do you see, or expect? -- David Goodger <http://python.net/~goodger> |