[Docstring-checkins] CVS: dps/dps nodes.py,1.34,1.35
Status: Pre-Alpha
Brought to you by:
goodger
From: David G. <go...@us...> - 2002-03-07 04:06:10
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv10534/dps/dps Modified Files: nodes.py Log Message: - Added support for citations, symbolic footnotes, pending, raw. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** nodes.py 4 Mar 2002 04:47:06 -0000 1.34 --- nodes.py 7 Mar 2002 04:06:08 -0000 1.35 *************** *** 522,525 **** --- 522,528 ---- """Mapping of footnote labels to lists of footnote_reference nodes.""" + self.citation_refs = {} + """Mapping of citation labels to lists of citation_reference nodes.""" + self.anonymous_targets = [] """List of anonymous target nodes.""" *************** *** 534,537 **** --- 537,546 ---- """List of auto-numbered footnote_reference nodes.""" + self.symbol_footnotes = [] + """List of symbol footnote nodes.""" + + self.symbol_footnote_refs = [] + """List of symbol footnote_reference nodes.""" + self.anonymous_start = 1 """Initial anonymous hyperlink number.""" *************** *** 540,543 **** --- 549,555 ---- """Initial auto-numbered footnote number.""" + self.symbol_footnote_start = 0 + """Initial symbol footnote symbol index.""" + self.id_start = 1 """Initial ID number.""" *************** *** 646,659 **** self.anonymous_refs.append(refnode) ! def note_autofootnote(self, footnotenode): ! self.autofootnotes.append(footnotenode) def note_autofootnote_ref(self, refnode): self.autofootnote_refs.append(refnode) def note_footnote_ref(self, refnode): self.footnote_refs.setdefault(refnode['refname'], []).append(refnode) self.note_refname(refnode) def note_substitution_def(self, substitutiondefnode, msgnode=None): name = substitutiondefnode['name'] --- 658,681 ---- self.anonymous_refs.append(refnode) ! def note_autofootnote(self, footnote): ! self.autofootnotes.append(footnote) def note_autofootnote_ref(self, refnode): self.autofootnote_refs.append(refnode) + def note_symbol_footnote(self, footnote): + self.symbol_footnotes.append(footnote) + + def note_symbol_footnote_ref(self, refnode): + self.symbol_footnote_refs.append(refnode) + def note_footnote_ref(self, refnode): self.footnote_refs.setdefault(refnode['refname'], []).append(refnode) self.note_refname(refnode) + def note_citation_ref(self, refnode): + self.citation_refs.setdefault(refnode['refname'], []).append(refnode) + self.note_refname(refnode) + def note_substitution_def(self, substitutiondefnode, msgnode=None): name = substitutiondefnode['name'] *************** *** 704,708 **** class section(Structural, Element): pass ! class topic(Structural, Element): pass class transition(Structural, Element): pass --- 726,746 ---- class section(Structural, Element): pass ! ! class topic(Structural, Element): ! ! """ ! Topics are terminal, "leaf" mini-sections, like block quotes with titles, ! or textual figures. A topic is just like a section, except that it has no ! subsections, and it doesn't have to conform to section placement rules. ! ! Topics are allowed wherever body elements (list, table, etc.) are allowed, ! but only at the top level of a section or document. Topics cannot nest ! inside topics or body elements; you can't have a topic inside a table, ! list, block quote, etc. ! """ ! ! pass ! ! class transition(Structural, Element): pass *************** *** 797,800 **** --- 835,876 ---- + class pending(Special, PreBibliographic, Element): + + """ + The "pending" element is used to encapsulate a pending transform: the + transform, the point at which to apply it, and any data it requires. + + For example, say you want a table of contents in your reStructuredText + document. The easiest way to specify where to put it is from within the + document, with a directive:: + + .. contents:: + + But the "contents" directive can't do its work until the entire document + has been parsed (and possibly transformed to some extent). So the + directive code leaves a placeholder behind that will trigger the second + phase of the its processing, something like this:: + + <pending directive="contents" ...other attributes...> + ...any directive data... + + The "pending" node is also appended to `document.pending`, so that a later + stage of processing can easily run all pending transforms. + """ + + def __init__(self, transform, *children, **attributes): + self.transform = transform + """Contains the transform class...""" + + + class raw(Special, Inline, PreBibliographic, TextElement): + + """ + Raw data that is to be passed untouched to the Writer. + """ + + pass + + # ================= # Inline Elements *************** *** 834,839 **** option option_argument option_group option_list option_list_item option_string organization ! paragraph problematic ! reference revision row section status strong substitution_definition substitution_reference subtitle system_message --- 910,915 ---- option option_argument option_group option_list option_list_item option_string organization ! paragraph pending problematic ! raw reference revision row section status strong substitution_definition substitution_reference subtitle system_message |