ó V!¶\c@s®dZdZddlmZmZddlmZddlmZddlm Z defd„ƒYZ d efd „ƒYZ d efd „ƒYZ d efd„ƒYZ dS(s Directives for document parts. treStructuredTextiÿÿÿÿ(tnodest languages(tparts(t Directive(t directivestContentscBs]eZdZd Zd„ZdZeZiej d6ej d6ed6ej d 6Z d „Z RS( s’ Table of contents. The table of contents is generated in two passes: initial parse and transform. During the initial parse, a 'pending' element is generated which acts as a placeholder, storing the TOC title and any options internally. At a later stage in the processing, the 'pending' element is replaced by a 'topic' element, a title and the table of contents proper. ttoptentrytnonecCs-tj|tjƒ}|dkr%dS|SdS(NR (RtchoiceRtbacklinks_valuestNone(targtvalue((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyt backlinkss itdepthtlocalRtclassc Cs#|jjp!t|jjtjƒs=|jd|jƒ‚n|jj}t j |j j |j ƒ}|jr°|jd}|jj||jƒ\}}tj|d|Œ}n7g}d|jkrÎd}ntjd|jdƒ}tjddgƒ}|dc|jjdgƒ7<|jjƒ\|_|_|jd8_d|jkrh|djdƒn|r‡|jƒ}||7}n |jd}tj|ƒ}|j|ƒsÆ|d j|ƒn|j|ƒtj t!j"d |j#ƒ} | j$j%|jƒ|j&| ƒ|| 7}|g|S( NsBThe "%s" directive may not be used within topics or body elements.itRtcontentstclassesRitnamest rawsource('t state_machinet match_titlest isinstancetnodeRtsidebarterrortnametdocumentRt get_languagetsettingst language_codetreportert argumentststatet inline_texttlinenottitletoptionsR tlabelsttopictgettget_source_and_linetsourcetlinetappendtastexttfully_normalize_namethas_nametnote_implicit_targettpendingRRt block_texttdetailstupdatet note_pending( tselfRtlanguaget title_textt text_nodestmessagesR(R+RR5((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pytrun-sF              (stopsentrysnone(t__name__t __module__t__doc__R Rtoptional_argumentstTruetfinal_argument_whitespaceRtnonnegative_inttflagt class_optiont option_specR?(((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyRs     tSectnumcBs?eZdZied6ed6ejd6ejd6Zd„ZRS(sAutomatic section numbering.RtstarttprefixtsuffixcCs?tjtjƒ}|jj|jƒ|jjj |ƒ|gS(N( RR5RtSectNumR7R8R)RRR9(R:R5((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyR?`s(R@RARBtintRtunchanged_requiredRIR?(((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyRJWs    tHeadercBseZdZeZd„ZRS(sContents of document header.cCsB|jƒ|jjjƒjƒ}|jj|j|j|ƒgS(N( tassert_has_contentRRtget_decorationt get_headerR%t nested_parsetcontenttcontent_offset(R:theader((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyR?ms (R@RARBRDt has_contentR?(((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyRQgstFootercBseZdZeZd„ZRS(sContents of document footer.cCsB|jƒ|jjjƒjƒ}|jj|j|j|ƒgS(N( RRRRRSt get_footerR%RURVRW(R:tfooter((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyR?zs (R@RARBRDRYR?(((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pyRZtsN(RBt __docformat__tdocutilsRRtdocutils.transformsRtdocutils.parsers.rstRRRRJRQRZ(((sI/tmp/pip-install-usGedi/docutils/docutils/parsers/rst/directives/parts.pytsF