sphinx_gallery.backreferences¶
Backreferences Generator¶
Parses example file code in order to keep track of used functions
Functions¶
-
sphinx_gallery.backreferences.
get_short_module_name
(module_name, obj_name)¶ Get the shortest possible module name
-
sphinx_gallery.backreferences.
identify_names
(filename)¶ Builds a codeobj summary by identifying and resolving used names
Examples using sphinx_gallery.backreferences.identify_names
¶
-
sphinx_gallery.backreferences.
parse_source_file
(filename)¶ Parse source file into AST node
Parameters: filename (str) – File path Returns: - node (AST node)
- content (utf-8 encoded string)
-
sphinx_gallery.backreferences.
scan_used_functions
(example_file, gallery_conf)¶ save variables so we can later add links to the documentation
-
sphinx_gallery.backreferences.
write_backreferences
(seen_backrefs, gallery_conf, target_dir, fname, snippet)¶ Writes down back reference files, which include a thumbnail list of examples using a certain module
Classes¶
-
class
sphinx_gallery.backreferences.
NameFinder
¶ Finds the longest form of variable names and their imports in code
Only retains names from imported modules.
-
class
sphinx_gallery.backreferences.
partial
¶ partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
-
args
¶ tuple of arguments to future partial calls
-
func
¶ function object to use in future partial calls
-
keywords
¶ dictionary of keyword arguments to future partial calls
-