Skip to content

Commit 18a0adb

Browse files
author
Sychevskyi Henadii
committed
ASUP-340
1 parent e013290 commit 18a0adb

4 files changed

Lines changed: 15 additions & 24 deletions

File tree

3rdparty/mkdocs/mkdocs/nav.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _follow(config_line, url_context, config, header=None, title=None):
334334
header.children.append(page)
335335

336336
yield page
337-
raise StopIteration
337+
return
338338

339339
elif not isinstance(config_line, dict):
340340
msg = ("Line in 'page' config is of type {0}, dict or string "
@@ -347,15 +347,15 @@ def _follow(config_line, url_context, config, header=None, title=None):
347347
"config contains an invalid entry: {0}".format(config_line))
348348
elif len(config_line) == 0:
349349
log.warning("Ignoring empty line in the pages config.")
350-
raise StopIteration
350+
return
351351

352352
next_cat_or_title, subpages_or_path = next(iter(config_line.items()))
353353

354354
if isinstance(subpages_or_path, utils.string_types):
355355
path = subpages_or_path
356356
for sub in _follow(path, url_context, config, header=header, title=next_cat_or_title):
357357
yield sub
358-
raise StopIteration
358+
return
359359

360360
elif not isinstance(subpages_or_path, list):
361361
msg = ("Line in 'page' config is of type {0}, list or string "

Pipfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
markdown = ">=3.3,<4"
8-
pymdown-extensions = ">=9,<11"
9-
mkdocs = "==1.6.1"
7+
markdown = {editable = true, path = "3rdparty/markdown"}
8+
pymdown-extensions = {editable = true, path = "3rdparty/pymdown-extensions"}
9+
mkdocs = {editable = true, path = "3rdparty/mkdocs"}
1010
GitPython = "==3.0.6"
1111
mkdocs_versioned = {editable = true, path = "3rdparty/mkdocs-versioned"}
1212
markdown-tabs = {editable = true, path = "plugins/markdown-tabs"}

mkdocs.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,20 @@ copyright: Copyright &copy; Virtuozzo, Inc.
77
#theme_center_lead: false
88

99

10-
theme:
11-
name: null
12-
custom_dir: 'theme/readthedocs'
10+
theme_dir: './theme/readthedocs'
1311
repo_url: 'https://github.com/virtuozzo/cloudscripting-docs/edit/master/docs/'
1412

1513
markdown_extensions:
1614
- admonition
15+
- toc
1716
- tables
1817
- markdown-tabs
1918
- markdown.extensions.admonition
2019
- markdown.extensions.footnotes
2120
- markdown.extensions.meta
22-
- toc:
23-
permalink: true
21+
- markdown.extensions.toc(permalink=true)
2422
- pymdownx.arithmatex
25-
- pymdownx.betterem:
26-
smart_enable: all
23+
- pymdownx.betterem(smart_enable=all)
2724
- pymdownx.caret
2825
- pymdownx.critic
2926
- pymdownx.emoji:
@@ -32,11 +29,10 @@ markdown_extensions:
3229
- pymdownx.magiclink
3330
- pymdownx.mark
3431
- pymdownx.smartsymbols
35-
- pymdownx.tasklist:
36-
custom_checkbox: true
32+
- pymdownx.tasklist(custom_checkbox=true)
3733
- pymdownx.tilde
3834

39-
nav:
35+
pages:
4036

4137
- GETTING STARTED:
4238
- Overview: index.md

plugins/markdown-tabs/markdown-tabs.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313

1414
class TabsPreprocessor(Preprocessor):
15-
def __init__(self, md):
16-
# Markdown 3.x expects the Markdown instance here
17-
super(TabsPreprocessor, self).__init__(md)
18-
1915
def run(self, lines):
2016
new_lines = []
2117
skip_empty_line = False
@@ -44,11 +40,10 @@ def run(self, lines):
4440

4541

4642
class TabsExtension(Extension):
47-
# Compatible with Markdown 2.x (md, md_globals) and 3.x (md) signatures
48-
def extendMarkdown(self, md, md_globals=None):
43+
def extendMarkdown(self, md, md_globals):
4944
md.registerExtension(self)
50-
# Use the modern registry API; this works across Markdown 3.x
51-
md.preprocessors.register(TabsPreprocessor(md), 'tabs', 25)
45+
md.preprocessors["tabs"] = TabsPreprocessor()
46+
pass
5247

5348

5449
def makeExtension(*args, **kwargs):

0 commit comments

Comments
 (0)