module sphinxext.sphinx_sharenet_extension
¶
Short summary¶
module pyquickhelper.sphinxext.sphinx_sharenet_extension
Defines a sphinx extension to add button to share a page
Classes¶
class |
truncated documentation |
---|---|
Defines sharenet node. |
|
Adds buttons to share a page. It can be done by adding |
Functions¶
Properties¶
property |
truncated documentation |
---|---|
|
Return the document root node of the tree containing this Node. |
Methods¶
method |
truncated documentation |
---|---|
Runs the directve. |
Documentation¶
Defines a sphinx extension to add button to share a page
- class pyquickhelper.sphinxext.sphinx_sharenet_extension.ShareNetDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]¶
Bases:
Directive
Adds buttons to share a page. It can be done by adding:
.. sharenet:: :facebook: 1 :linkedin: 2 :twitter: 3 :head: False
Which gives:
The integer indicates the order in which they need to be displayed. It is optional. The option
:head: False
specifies the javascript part is added to the html body and not the header. The header can be overwritten by other custom commands.- option_spec = {'facebook': <function unchanged>, 'head': <function unchanged>, 'linkedin': <function unchanged>, 'size': <function unchanged>, 'twitter': <function unchanged>}[source]¶
Mapping of option names to validator functions.
- sharenet_class[source]¶
alias of
sharenet_node
- pyquickhelper.sphinxext.sphinx_sharenet_extension.depart_sharenet_node(self, node)[source]¶
what to do when leaving a node sharenet the function should have different behaviour, depending on the format, or the setup should specify a different function for each.
It does only html for the time being.
- pyquickhelper.sphinxext.sphinx_sharenet_extension.depart_sharenet_node_html(self, node)[source]¶
what to do when leaving a node sharenet the function should have different behaviour, depending on the format, or the setup should specify a different function for each.
It does only html for the time being.
- pyquickhelper.sphinxext.sphinx_sharenet_extension.depart_sharenet_node_rst(self, node)[source]¶
what to do when leaving a node sharenet the function should have different behaviour, depending on the format, or the setup should specify a different function for each.
- class pyquickhelper.sphinxext.sphinx_sharenet_extension.sharenet_node(rawsource='', *children, **attributes)[source]¶
Bases:
Structural
,Element
Defines sharenet node.
- pyquickhelper.sphinxext.sphinx_sharenet_extension.sharenet_role(role, rawtext, text, lineno, inliner, options=None, content=None)[source]¶
Defines custom roles sharenet. The following instructions defines buttons of size 20 ( ):
:sharenet:`facebook-linkedin-twitter-20-body`
The last term indicates the javascript part will be included in the HTML body instead of the head as this part might be tweaked by other custom commands.
- Parameters:
role – The role name used in the document.
rawtext – The entire markup snippet, with role.
text – The text marked with the role.
lineno – The line number where rawtext appears in the input.
inliner – The inliner instance that called us.
options – Directive options for customization.
content – The directive content for customization.
- pyquickhelper.sphinxext.sphinx_sharenet_extension.visit_sharenet_node(self, node)[source]¶
what to do when visiting a node sharenet the function should have different behaviour, depending on the format, or the setup should specify a different function for each.