Keep working on starting-tutorial

This commit is contained in:
Griatch 2020-06-21 19:29:59 +02:00
parent cfd70ea837
commit dc811f2e08
7 changed files with 267 additions and 118 deletions

View file

@ -15,6 +15,8 @@ _IGNORE_FILES = []
_SOURCEDIR_NAME = "source"
_SOURCE_DIR = pathjoin(dirname(dirname(abspath(__file__))), _SOURCEDIR_NAME)
_TOC_FILE = pathjoin(_SOURCE_DIR, "toc.md")
_NO_REMAP_STARTSWITH = ["http://", "https://", "github:", "api:",
"feature-request", "report-bug", "issue", "bug-report"]
_CURRFILE = None
@ -79,6 +81,9 @@ def create_toctree():
grpdict = match.groupdict()
txt, url = grpdict['txt'], grpdict['url']
if any(url.startswith(noremap) for noremap in _NO_REMAP_STARTSWITH):
return f"[{txt}]({url})"
if "http" in url and "://" in url:
urlout = url
else:
@ -98,6 +103,9 @@ def create_toctree():
grpdict = match.groupdict()
txt, url = grpdict['txt'], grpdict['url']
if any(url.startswith(noremap) for noremap in _NO_REMAP_STARTSWITH):
return f"[{txt}]({url})"
if "http" in url and "://" in url:
urlout = url
else: