A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://sphinx-gallery.github.io/stable/gen_modules/sphinx_gallery.py_source_parser.html below:

sphinx_gallery.py_source_parser — Sphinx-Gallery 0.19.0-git documentation

sphinx_gallery.py_source_parser#

Parser for python source files.

Functions#

Pull out the file-specific config specified in the docstring.

Return the content of code_block with in-file config comments removed.

Comment lines of the pattern ‘# sphinx_gallery_[option] = [val]’ are removed, but surrounding empty lines are preserved.

Parameters:

code_block (str) – A code segment.

sphinx_gallery.py_source_parser.split_code_and_text_blocks(source_file, return_node=False)#

Return list with source file separated into code and text blocks.

Parameters:
  • source_file (str) – Path to the source file.

  • return_node (bool) – If True, return the ast node.

Returns:
  • file_conf (dict) – File-specific settings given in source file comments as: # sphinx_gallery_<name> = <value>

  • blocks (list) – (label, content, line_number) List where each element is a tuple with the label (‘text’ or ‘code’), the corresponding content string of block and the leading line number.

  • node (ast.Module) – The parsed ast node.

Examples using sphinx_gallery.py_source_parser.split_code_and_text_blocks# Classes#
class sphinx_gallery.py_source_parser.Block(type, content, lineno)#
content#

Alias for field number 1

lineno#

Alias for field number 2

type#

Alias for field number 0


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4