mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-10 07:36:52 +02:00
[docs] minor code refactoring
This commit is contained in:
parent
cec2c79d6a
commit
652113443d
4 changed files with 25 additions and 25 deletions
17
docs/source/_ext/utils.py
Normal file
17
docs/source/_ext/utils.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from myst_parser.docutils_ import Parser
|
||||
from myst_parser.mdit_to_docutils.base import make_document
|
||||
|
||||
|
||||
def md_to_docutils(text):
|
||||
parser = Parser()
|
||||
doc = make_document(parser_cls=Parser)
|
||||
parser.parse(text, doc)
|
||||
return doc
|
||||
|
||||
|
||||
def get_link_key(node):
|
||||
link_keys = ['uri', 'refuri', 'refname']
|
||||
for key in link_keys:
|
||||
if key in node.attributes.keys():
|
||||
return key
|
||||
return None
|
Loading…
Add table
Add a link
Reference in a new issue