Re: Remove everything below nodes.title/nodes.subtitle from doctree?

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=+NCdMbAseRQGFMQjTbA2EpyNxh3B3Bg-kOJDoERY8pRw@mail.gmail.com>
On Fri, Oct 13, 2017 at 11:11 AM, Tony N <[email protected]> wrote:
> This was actually straight forward for me, see an example on a blog post
> here: http://homework.nwsnet.de/releases/af95/
>
> However, even though I’m removing the title, I’m still intending on storing
> reStructuredText.
>
> I forget there’s no reStructuredText Writer for docutils (one could only
> wish). So I ended up using a regex to chop the title portion out.

The Element.line, .source, and .rawsource attributes may be useful.

David Goodger
<http://python.net/~goodger>

> On October 12, 2017 at 2:54:59 PM, Tony N ([email protected]) wrote:
>
> Since I am already able to read the title/subtitle from the doctree, now I
> want to be able to remove the title and subtitle from a doctree:
>
> What would be the canonical way of doing that?
>
> - Removing the nodes.title and nodes.subtitle from the doctree (how can that
> be done? Is there any examples to how that works?)
> - Removing all nodes *after* nodes.title and nodes.subtitle (any examples
> for something like that?)
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.