Navigation¶
Navigation tags
- class disseminate.tags.navigation.Epublink(name, content, **kwargs)¶
Bases:
disseminate.tags.navigation.OtherLink
Produces a link to the epub target for the root document.
- other_filepath(target=None)¶
The filepath for the other document target or src_filepath to create a link to.
- class disseminate.tags.navigation.Next(name, content, **kwargs)¶
Bases:
disseminate.tags.ref.Ref
Produces links to the next document.
Notes
As opposed to the parent Ref tag, if a label is not found, an empty string is returned by the target format functions.
The following are tag attributes that are recognized:
- kindstr
The kind of label to reference by this tag. By default, it’s a heading.
- default_fmt(**kwargs)¶
Convert the tag to a text string.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- cacheOptional[dict]
If specified, the cache values will be used instead of being evaluated. Possibilities: - ‘label’:
types.Label
- ‘documents_by_id’: Dict[str,document.Document
]
- contentOptional[Union[str, List[Union[str, list,
- Returns
- text_stringstr
A text string with the tags stripped.
- html_fmt(cache=None, **kwargs)¶
Convert the tag to an (x)html string or (x)html element.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- cacheOptional[dict]
If specified, the cache values will be used instead of being evaluated. Possibilities: - ‘label’:
types.Label
- ‘documents_by_id’: Dict[str,document.Document
] - ‘format_str’: str- format_funcOptional[str]
The tag format function to use in rendering the reference tag. (ex: ‘html_fmt’ or ‘xhtml_fmt’)
- methodOptional[str]
The rendering method for the string. ex: ‘html’ or ‘xml’
- levelOptional[int]
The level of the tag.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- htmlstr or html element
A string in HTML format or an HTML element (
lxml.builder.E
).
- tex_fmt(cache=None, **kwargs)¶
Format the tag in LaTeX format.
Note
This function renders tex links to compiled pdf documents
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- mathmodeOptional[bool]
If True, the tag will be rendered in math mode. Otherwise (default) latex text mode is assumed.
- cacheOptional[dict]
If specified, the cache values will be used instead of being evaluated. Possibilities: - ‘label’:
types.Label
- ‘documents_by_id’: Dict[str,document.Document
]- levelOptional[int]
The level of the tag.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- tex_stringstr
The formatted tex string.
- xhtml_fmt(**kwargs)¶
Convert the tag to an xhtml string or html element.
- Returns
- xhtmlstr or xhtml element
A string in XHTML format or an XHTML element (
lxml.builder.E
).
- class disseminate.tags.navigation.OtherLink(name, content, **kwargs)¶
Bases:
disseminate.tags.tag.Tag
Produces a link to a source document or another target for this document.
- default_fmt(**kwargs)¶
Convert the tag to a text string.
Strips the tag information and simply return the content of the tag.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- text_stringstr
A text string with the tags stripped.
- html_fmt(**kwargs)¶
Convert the tag to an html string or html element.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- format_funcOptional[str]
The format function to use with by formatted_content when formatting sub-tags.
- methodOptional[str]
The rendering method for the string. ex: ‘html’ or ‘xml’
- levelOptional[int]
The level of the tag.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- htmlstr or html element
A string in HTML format or an HTML element (
lxml.builder.E
).
- other_filepath(target=None)¶
The filepath for the other document target or src_filepath to create a link to.
- other_relpath(this_target, other_target=None)¶
Produce the the relpath for the other target.
- tex_fmt(**kwargs)¶
Format the tag in LaTeX format.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- mathmodeOptional[bool]
If True, the tag will be rendered in math mode. Otherwise (default) latex text mode is assumed.
- levelOptional[int]
The level of the tag.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- tex_stringstr
The formatted tex string.
- this_filepath(target)¶
The filepath for this (target) document.
- xhtml_fmt(**kwargs)¶
Convert the tag to an xhtml string or html element.
- Returns
- xhtmlstr or xhtml element
A string in XHTML format or an XHTML element (
lxml.builder.E
).
- class disseminate.tags.navigation.Pdflink(name, content, **kwargs)¶
Bases:
disseminate.tags.navigation.OtherLink
Produces a link to the pdf target for this document
- class disseminate.tags.navigation.Prev(name, content, **kwargs)¶
Bases:
disseminate.tags.ref.Ref
Produces links to the previous document.
Notes
As opposed to the parent Ref tag, if a label is not found, an empty string is returned by the target format functions.
The following are tag attributes that are recognized
- kindstr
The kind of label to reference by this tag. By default, it’s a heading.
- default_fmt(**kwargs)¶
Convert the tag to a text string.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- cacheOptional[dict]
If specified, the cache values will be used instead of being evaluated. Possibilities: - ‘label’:
types.Label
- ‘documents_by_id’: Dict[str,document.Document
]
- contentOptional[Union[str, List[Union[str, list,
- Returns
- text_stringstr
A text string with the tags stripped.
- html_fmt(cache=None, **kwargs)¶
Convert the tag to an (x)html string or (x)html element.
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- cacheOptional[dict]
If specified, the cache values will be used instead of being evaluated. Possibilities: - ‘label’:
types.Label
- ‘documents_by_id’: Dict[str,document.Document
] - ‘format_str’: str- format_funcOptional[str]
The tag format function to use in rendering the reference tag. (ex: ‘html_fmt’ or ‘xhtml_fmt’)
- methodOptional[str]
The rendering method for the string. ex: ‘html’ or ‘xml’
- levelOptional[int]
The level of the tag.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- htmlstr or html element
A string in HTML format or an HTML element (
lxml.builder.E
).
- tex_fmt(cache=None, **kwargs)¶
Format the tag in LaTeX format.
Note
This function renders tex links to compiled pdf documents
- Parameters
- contentOptional[Union[str, List[Union[str, list,
Tag
]]] Specify an alternative content from the tag’s content. It can either be a string, a tag or a list of strings, tags and lists.
- attributesOptional[Union[str,
Attributes
]] Specify an alternative attributes dict from the tag’s attributes. It can either be a string or an attributes dict.
- mathmodeOptional[bool]
If True, the tag will be rendered in math mode. Otherwise (default) latex text mode is assumed.
- cacheOptional[dict]
If specified, the cache values will be used instead of being evaluated. Possibilities: - ‘label’:
types.Label
- ‘documents_by_id’: Dict[str,document.Document
]- levelOptional[int]
The level of the tag.
- contentOptional[Union[str, List[Union[str, list,
- Returns
- tex_stringstr
The formatted tex string.
- xhtml_fmt(**kwargs)¶
Convert the tag to an xhtml string or html element.
- Returns
- xhtmlstr or xhtml element
A string in XHTML format or an XHTML element (
lxml.builder.E
).
- class disseminate.tags.navigation.Srclink(name, content, **kwargs)¶
Bases:
disseminate.tags.navigation.OtherLink
Produces a link to the src file for this document
- other_filepath(target=None)¶
The filepath for the other document target or src_filepath to create a link to.
- class disseminate.tags.navigation.Texlink(name, content, **kwargs)¶
Bases:
disseminate.tags.navigation.OtherLink
Produces a link to the tex target for this document.
- class disseminate.tags.navigation.Txtlink(name, content, **kwargs)¶
Bases:
disseminate.tags.navigation.OtherLink
Produces a link to the txt target for this document.
Receivers¶
Navigation tags
- disseminate.tags.navigation.set_navigation_labels(root_document)
Set the navigation labels in the context of all documents in a document tree.