Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | List of all members
xrefs.XrefExtension Class Reference
Inheritance diagram for xrefs.XrefExtension:

Public Member Functions

None __init__ (self)
 
 extendMarkdown (self, md)
 

Public Attributes

 symbols_index
 
 packages
 

Static Public Attributes

SymbolsIndex symbols_index
 
Dict packages [str, str]
 

Static Protected Member Functions

Dict[str, str] _load_package_config ()
 

Detailed Description

Markdown extension which handles xrefs and links to markdown files.

Definition at line 131 of file xrefs.py.

Constructor & Destructor Documentation

◆ __init__()

None xrefs.XrefExtension.__init__ (   self)

Definition at line 136 of file xrefs.py.

136 def __init__(self) -> None:
137 super().__init__()
138 self.symbols_index = load_index('xref.json')
139 self.packages = XrefExtension._load_package_config()
140

Member Function Documentation

◆ _load_package_config()

Dict[str, str] xrefs.XrefExtension._load_package_config ( )
staticprotected

Definition at line 149 of file xrefs.py.

149 def _load_package_config() -> Dict[str, str]:
150 # Load package_config.json file into a dictionary.
151 with open('.dart_tool/package_config.json',
152 encoding='utf-8') as package_config_file:
153 package_config = json.load(package_config_file)
154 return dict([(pkg['name'],
155 os.path.normpath(
156 os.path.join('.dart_tool/', pkg['rootUri'],
157 pkg['packageUri'])))
158 for pkg in package_config['packages']
159 if 'packageUri' in pkg])

◆ extendMarkdown()

xrefs.XrefExtension.extendMarkdown (   self,
  md 
)

Definition at line 141 of file xrefs.py.

141 def extendMarkdown(self, md):
142 md.xrefs = {}
143 md.treeprocessors.register(_MdLinkFixerTreeprocessor(), 'mdlinkfixer',
144 0)
145 md.inlinePatterns.register(
146 _XrefPattern(md, self.symbols_index, self.packages), 'xref', 200)
147

Member Data Documentation

◆ packages [1/2]

Dict xrefs.XrefExtension.packages [str, str]
static

Definition at line 134 of file xrefs.py.

◆ packages [2/2]

xrefs.XrefExtension.packages

Definition at line 139 of file xrefs.py.

◆ symbols_index [1/2]

SymbolsIndex xrefs.XrefExtension.symbols_index
static

Definition at line 133 of file xrefs.py.

◆ symbols_index [2/2]

xrefs.XrefExtension.symbols_index

Definition at line 138 of file xrefs.py.


The documentation for this class was generated from the following file: