sphinx_social package#

Submodules#

sphinx_social.facebook module#

Directive dedicated to the facebook platform.

class sphinx_social.facebook.Facebook(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: Social

Custom version of the Social directive.

class sphinx_social.facebook.facebook_node(rawsource='', *children, **attributes)[source]#

Bases: social_node

same node new name.

parse(url)[source]#

parse the url to transform it into a embed link.

Parameters:

url (str) –

Return type:

str

sphinx_social.linkedin module#

Directive dedicated to the linkedin platform.

class sphinx_social.linkedin.Linkedin(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: Social

Custom version of the Social directive.

class sphinx_social.linkedin.linkedin_node(rawsource='', *children, **attributes)[source]#

Bases: social_node

same node new name.

parse(url)[source]#

parse the url to transform it into a embed link.

Parameters:

url (str) –

Return type:

str

sphinx_social.mastodon module#

Directive dedicated to the mastodon platform.

class sphinx_social.mastodon.Mastodon(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: Social

Custom version of the Social directive.

class sphinx_social.mastodon.mastodon_node(rawsource='', *children, **attributes)[source]#

Bases: social_node

same node new name.

parse(url)[source]#

parse the url to transform it into a embed link.

Parameters:

url (str) –

Return type:

str

sphinx_social.twitter module#

Directive dedicated to the twitter platform.

class sphinx_social.twitter.Twitter(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: Social

Custom version of the Social directive.

class sphinx_social.twitter.twitter_node(rawsource='', *children, **attributes)[source]#

Bases: social_node

same node new name.

parse(url)[source]#

parse the url to transform it into a embed link.

Parameters:

url (str) –

Return type:

str

sphinx_social.utils module#

Skeleton of the social directive ready to be extended for specific providers.

class sphinx_social.utils.Social(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]#

Bases: Directive

Abstract Video directive.

final_argument_whitespace = False#

May the final argument contain whitespace?

has_content = True#

May the directive have content?

optional_arguments = 0#

Number of optional arguments after the required arguments.

required_arguments = 1#

Number of required directive arguments.

run()[source]#

Setup the directive in the builder context.

Return type:

List[Node]

sphinx_social.utils.depart_social_node(translator, node)[source]#

Depart any video node.

Parameters:
  • translator (SphinxTranslator) –

  • node (social_node) –

Return type:

None

class sphinx_social.utils.social_node(rawsource='', *children, **attributes)[source]#

Bases: General, Element

Video node.

parse(url)[source]#

Parse the url according to the platform needs.

Parameters:

url (str) –

Return type:

str

sphinx_social.utils.visit_video_node_html(translator, node)[source]#

Visit html video node.

Parameters:
  • translator (SphinxTranslator) –

  • node (social_node) –

Return type:

None

sphinx_social.utils.visit_video_node_unsupported(translator, node)[source]#

Visit unsuported video node.

Parameters:
  • translator (SphinxTranslator) –

  • node (social_node) –

Return type:

None

Module contents#

The init file of the package.

sphinx_social.setup(app)[source]#

Setup Sphinx application.

Parameters:

app (Sphinx) –

Return type:

Dict[str, Any]