Pull dictionary of docinfo fields from a document?
Tony Narlock <[email protected]>
| Newsgroups | gmane.text.docutils.user |
|---|---|
| Message-ID | <CAC8GGzOGGqU26XvCn2dyJgv5xU5jNPKTr2wu1N=zKqHGeUTgkQ@mail.gmail.com> |
My intention is to use DocInfo as a way to scape meta information off RST
files to build an index of them.
There is a DocInfo transformer at docinfo.transforms.frontmatter.DocInfo.
Two things:
1. I don’t want DocInfo fields to show on HTMLWriter
2. I want to pull a python dictionary of key->value fields from DocInfo.
e.g.
==============
Document title
==============
:date: 2017-05-01
:custom_field: value
rest of the file
Being able to extract:
{
"date": datetime.date(2017,5,1),
"custom_field": "value"
}
My understanding is DocInfo handles that fields in biblio_nodes, but also
can handle arbitrary field names. (
http://docutils.sourceforge.net/docs/ref/doctree.html#docinfo). Is that
true?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot