Coverage for src/lcdoc/mkdocs/tools.py: 83.10%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

244 statements  

1import datetime lppytest

2import importlib lppytest

3import shutil lppytest

4import sys lppytest

5import time lppytest

6from functools import partial lppytest

7 

8from lcdoc.const import AttrDict, PageStats, Stats, now_ms, t0 lppytest

9from lcdoc.tools import ( lppytest

10 app, 

11 dirname, 

12 exists, 

13 now, 

14 os, 

15 project, 

16 read_file, 

17 require, 

18 write_file, 

19) 

20from mkdocs.config import config_options lppytest

21from mkdocs.plugins import BasePlugin lppytest

22from mkdocs.plugins import log as mkdlog lppytest

23 

24script = lambda s: '<script>\n%s\n</script>' % s lplp|features/lp/plugs/lightbox/index.mdlp|index.mdpytest

25style = lambda s: '<style>\n%s\n</style>' % s lplp|features/lp/examples.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/syntax.mdlp|index.mdpytest

26 

27 

28def add_post_page_func(kw, f, once=False): lppytest

29 p = kw['LP'].page lp|index.mdlp|index.md

30 h = getattr(p, 'lp_on_post_page', []) lp|index.mdlp|index.md

31 if once and f in h: 31 ↛ 32line 31 didn't jump to line 32, because the condition on line 31 was never truelp|index.mdlp|index.md

32 return 

33 h.append(f) lp|index.mdlp|index.md

34 p.lp_on_post_page = h lp|index.mdlp|index.md

35 

36 

37def srclink(fn, config, line=None, match=None, title=''): lppytest

38 # TODO: allow others: 

39 u = config['repo_url'] + 'blob/master' lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

40 r = project.root(config) lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

41 if fn[0] == '/': lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

42 fnr = fn.split(r, 1)[1] lp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/show_src/index.md

43 else: 

44 fnr = '/' + fn lp|about/navigation.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

45 lnk = u + fnr lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

46 if match: lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

47 s = read_file(r + fnr, dflt='') lp|about/navigation.mdlp|features/lp/examples.md

48 m = s.split(match, 1) lp|about/navigation.mdlp|features/lp/examples.md

49 if len(m) > 1: 49 ↛ 51line 49 didn't jump to line 51, because the condition on line 49 was never falselp|about/navigation.mdlp|features/lp/examples.md

50 line = len(m[0].splitlines()) lp|about/navigation.mdlp|features/lp/examples.md

51 if line: lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

52 lnk += '#L%s' % line lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/show_src/index.md

53 # return T 

54 title = (title + ' ') if title else '' lp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/xterm.mdlp|index.md

55 return { 

56 'link': '[%s:fontawesome-brands-git-alt:](%s)' % (title, lnk), 

57 'url': lnk, 

58 } # {align=right}' 

59 

60 

61def find_md_files(match, config): lppytest

62 flw = '' lp

63 if ':follow' in match: 63 ↛ 67line 63 didn't jump to line 67, because the condition on line 63 was never falselp

64 match = match.replace(':follow', '') lp

65 flw = '-L' lp

66 

67 require('fd --version') lp

68 dd = config['docs_dir'] lp

69 # no --type file because we want also symlinks: 

70 cmd = "cd '%s' && fd %s -I -e md | grep '%s'" % (dd, flw, match) lp

71 r = os.popen(cmd).read().strip().splitlines() lp

72 # print('cmd find', cmd) 

73 # some versions of fd deliver ./foo others foo -> normalize to the latter: 

74 r = [fn[2:] if fn.startswith('./') else fn for fn in r] lp

75 # split off docs dir: 

76 return r lp

77 

78 

79def theme_dir(config): lppytest

80 """strangly we don't see custom_dir in config.theme - it only inserts it, when given, into config.theme.dirs 

81 """ 

82 cd = config['theme'].dirs[0] 

83 if cd.endswith('/' + config['theme'].name): 

84 app.debug('Theme dir is docs dir') 

85 return config['docs_dir'] 

86 app.info('Theme dir is custom', dir=cd) 

87 return cd 

88 

89 

90def link_assets(plugin, fn_plugin, config): lppytest

91 """Linking assets folder content into D/lcd/<pluginname>, where D is either docs dir or custom_dir 

92 Setting plugin.d_assets to that folder. 

93 """ 

94 # extra css and js has be in docs dir, even with custom dir: 

95 d = dirname(fn_plugin) + '/assets' lplp|about/changelog.md

96 if not exists(d): 96 ↛ 97line 96 didn't jump to line 97, because the condition on line 96 was never truelplp|about/changelog.md

97 app.die('Cannot link: No assets found', dir=d) 

98 n = fn_plugin.rsplit('/', 2)[-2] lplp|about/changelog.md

99 to = config['docs_dir'] + '/lcd' lplp|about/changelog.md

100 t = to + '/' + n lplp|about/changelog.md

101 plugin.d_assets = t lplp|about/changelog.md

102 if exists(t): 102 ↛ 103line 102 didn't jump to line 103, because the condition on line 102 was never truelplp|about/changelog.md

103 app.debug('Assets link exists already', linkdest=t) 

104 return t 

105 app.warning('Linking', frm=d, to=t) lplp|about/changelog.md

106 os.makedirs(dirname(t), exist_ok=True) lplp|about/changelog.md

107 cmd = 'ln -s "%s" "%s"' % (d, t) lplp|about/changelog.md

108 if os.system(cmd): 108 ↛ 109line 108 didn't jump to line 109, because the condition on line 108 was never truelplp|about/changelog.md

109 app.die('Could not link assets') 

110 app.info('Assets for git changelog linked', frm=d, to=t) lplp|about/changelog.md

111 return t lplp|about/changelog.md

112 

113 

114def split_off_fenced_blocks(markdown, fc_crit=None, fc_process=None, fcb='```'): lppytest

115 fc_crit = (lambda s: True) if fc_crit is None else fc_crit lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

116 lines = markdown if isinstance(markdown, list) else markdown.splitlines() lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

117 mds, fcs = [[]], [] lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

118 lnr = 0 lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

119 while lines: lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

120 l = lines.pop(0) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

121 # if 'lp:bash' in l: breakpoint() # FIXME BREAKPOINT 

122 lnr += 1 lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

123 ls = l.lstrip() lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

124 if ls[:4] == '`lp:' and l.rstrip().endswith('`'): lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

125 l = l.replace('`lp:', '```shortform lp:').rstrip()[:-1] lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|task_runner.md

126 ls = l.strip() lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|task_runner.md

127 s = (len(l) - len(ls)) * ' ' lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|task_runner.md

128 lines.insert(0, s + '```') lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|task_runner.md

129 if not ls.startswith(fcb): lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

130 mds[-1].append(l) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

131 continue lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

132 beg = (' ' * (len(l) - len(l.lstrip()))) + fcb lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

133 if not fc_crit(ls): lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

134 # an fc but crit is not met (e.g. not lp) -> ignore all till closed: 

135 while lines: 135 ↛ 143line 135 didn't jump to line 143, because the condition on line 135 was never falselp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

136 mds[-1].append(l) lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

137 l = lines.pop(0) lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

138 lnr += 1 lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

139 if l.startswith(beg) and l.strip() == fcb: lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

140 mds[-1].append(l) lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

141 lnr -= 1 lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

142 break lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

143 continue lp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/sessions.mdlp|features/lp/examples.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|index.md

144 

145 fc = [] lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

146 mds.append([]) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

147 fc.append(l) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

148 fc_ln_start = lnr lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

149 while lines: 149 ↛ 159line 149 didn't jump to line 159, because the condition on line 149 was never falselplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

150 l = lines.pop(0) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

151 lnr += 1 lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

152 fc.append(l) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

153 if l.startswith(beg) and l.strip() == fcb: lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

154 break lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

155 elif not lines: 155 ↛ 156line 155 didn't jump to line 156, because the condition on line 155 was never truelplp|about/changelog.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.md

156 msg = 'Closing fenced block. Your markdown will not be correctly rendered' 

157 app.warning(msg, block=fc) 

158 lines.append(beg) 

159 if fc_process: lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

160 fc = fc_process(fc) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

161 fc['linenr'] = fc_ln_start lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

162 fcs.append(fc) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

163 return mds, fcs lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

164 

165 

166hooks = [ 

167 'on_serve', 

168 'on_config', 

169 'on_pre_build', 

170 # 'on_files', 

171 # 'on_nav', 

172 # 'on_env', 

173 'on_post_build', 

174 # 'on_build_error', 

175 # 'on_pre_template', 

176 # 'on_template_context', 

177 # 'on_post_template', 

178 # 'on_pre_page', 

179 # 'on_page_read_source', 

180 'on_page_markdown', 

181 'on_page_content', 

182 # 'on_page_context', 

183 'on_post_page', 

184] 

185 

186clsn = lambda o: o.__class__.__name__ lppytest

187 

188 

189def get_page(hookname, a, kw, c={}): lppytest

190 """return the page passed to a hook, if any (run within the hook deco)""" 

191 pos = c.get(hookname) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

192 if pos is None: lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

193 if 'page' in kw: lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

194 pos = 'kw' lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

195 else: 

196 h = None lp

197 for i, arg in zip(range(len(a)), a): lp

198 if getattr(arg, 'is_page', None): 198 ↛ 199line 198 didn't jump to line 199, because the condition on line 198 was never truelp

199 h = i 

200 break 

201 if h is None: 201 ↛ 204line 201 didn't jump to line 204, because the condition on line 201 was never falselp

202 c[hookname] = -1 lp

203 return lp

204 if pos == 'kw': lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

205 return kw['page'] lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

206 if pos < 0: 206 ↛ 208line 206 didn't jump to line 208, because the condition on line 206 was never falselp

207 return lp

208 return a[pos] 

209 

210 

211def wrap_hook(plugin, hook, hookname): lppytest

212 """Decorates the actual lcd- plugin hooks with stats and logging""" 

213 n = clsn(plugin) lppytest

214 Stats[n][hookname] = {} lppytest

215 PageStats[n][hookname] = {} lppytest

216 

217 def wrapped_hook(*a, plugin=plugin, hook=hook, name=n, hookname=hookname, **kw): lppytest

218 plugin.stats = stats = Stats[n][hookname] lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

219 page = get_page(hookname, a, kw) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

220 p = t = '' lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

221 if page: lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

222 stats = PageStats[n][hookname] lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

223 stats[(page.url, page.title)] = stats = page.stats = AttrDict() lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

224 f = page.file.src_path lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

225 p = ':%s' % '/'.join(f.rsplit('/', 2)[-2:]) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

226 t = ': %s' % f lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

227 on = app.name # orig name lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

228 app.name = n.replace('Plugin', '') + p # e.g. LPPlugin lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

229 app.debug('%s.%s%s' % (n, hookname, t)) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

230 t0 = now() lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

231 r = hook(*a, **kw) lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

232 dt = now() - t0 lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

233 stats['dt'] = stats.get('dt', 0) + dt lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

234 app.name = on lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

235 return r lplp|about/changelog.mdlp|about/coverage.mdlp|about/credits.mdlp|about/navigation.mdlp|features/lp/bash/index.mdlp|features/lp/bash/sessions.mdlp|features/lp/eval.mdlp|features/lp/examples.mdlp|features/lp/parameters.mdlp|features/lp/plugs/_tech.mdlp|features/lp/plugs/chart/index.mdlp|features/lp/plugs/chartist/index.mdlp|features/lp/plugs/column/index.mdlp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/flowchart/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/lightbox/index.mdlp|features/lp/plugs/make_badges/index.mdlp|features/lp/plugs/make_file/index.mdlp|features/lp/plugs/markmap/index.mdlp|features/lp/plugs/mermaid/index.mdlp|features/lp/plugs/show_file/index.mdlp|features/lp/plugs/show_src/index.mdlp|features/lp/python/_tech.mdlp|features/lp/sessions.mdlp|features/lp/syntax.mdlp|features/lp/tips.mdlp|features/lp/xterm.mdlp|index.mdlp|task_runner.md

236 

237 setattr(plugin, hookname, wrapped_hook) lppytest

238 

239 

240def run_docs_hooks(hookname, config): lppytest

241 d = project.root(config) + '/scripts/docs/hooks/' + hookname lp

242 if not exists(d): 242 ↛ 243line 242 didn't jump to line 243, because the condition on line 242 was never truelp

243 return 

244 sys.path.insert(0, d) lp

245 for h in [i for i in os.listdir(d) if i.endswith('.py')]: lp

246 mod = importlib.import_module(h[:-3]) lp

247 mod.run(config) lp

248 

249 

250def page_dir(kw): lppytest

251 page = kw.get('page') or kw['LP'].page lp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

252 return dirname(page.file.abs_src_path) + '/' lp|features/lp/plugs/drawio/index.mdlp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

253 

254 

255last_img_hash = {} lppytest

256 

257 

258def make_img(create_func, fn=None, kw=None): lppytest

259 """Takes care about 

260 

261 - fn in docs dir or not 

262 - creation of containing dir 

263 - creates fn also in site_dir always, i.e. change detection for svg may be disabled 

264 

265 Returns the image link 

266 """ 

267 if not fn: 267 ↛ 270line 267 didn't jump to line 270, because the condition on line 267 was never falselp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

268 fn = kw.get('fn') # default lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

269 # if fn and 'call_fl' in fn: breakpoint() # FIXME BREAKPOINT 

270 if fn and not fn.endswith('.svg'): 270 ↛ 272line 270 didn't jump to line 272, because the condition on line 270 was never falselp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

271 fn += '.svg' lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

272 f = create_func # string or creation func lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

273 if isinstance(f, str): 273 ↛ 275line 273 didn't jump to line 275, because the condition on line 273 was never falselp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

274 create_func = lambda fn, s=f: write_file(fn, s) lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

275 LP = kw['LP'] lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

276 page = kw.get('page') or LP.page lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

277 config = LP.config lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

278 

279 def make(fn_abs, copy_frm=None, kw=kw): lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

280 os.makedirs(dirname(fn_abs), exist_ok=True) lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

281 if not exists(fn_abs) or last_img_hash.get(fn_abs) != kw['id']: 281 ↛ exitline 281 didn't return from function 'make', because the condition on line 281 was never falselp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

282 if copy_frm: 282 ↛ 283line 282 didn't jump to line 283, because the condition on line 282 was never truelp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

283 app.info('Copying svg', frm=copy_frm, to=fn_abs) 

284 shutil.copyfile(copy_frm, fn_abs) 

285 else: 

286 app.info('Creating svg', fn=fn_abs) lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

287 create_func(fn_abs) lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

288 

289 fn_abs_docs = False lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

290 if fn: 290 ↛ 301line 290 didn't jump to line 301, because the condition on line 290 was never falselp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

291 in_docs = True lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

292 # image wanted within docs dir: 

293 if fn.startswith('/'): 293 ↛ 294line 293 didn't jump to line 294, because the condition on line 293 was never truelp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

294 app.error('no absolute filename allowed', fn=fn, page=page) 

295 raise 

296 # fn parameter was given -> create in docs dir: 

297 fn_abs = fn_abs_docs = os.path.abspath(page_dir(kw) + fn) lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

298 make(fn_abs) lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

299 

300 # should work even with svg change detection off: 

301 if 'serve' in sys.argv or not fn: 301 ↛ 302line 301 didn't jump to line 302, because the condition on line 301 was never truelp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

302 if not fn: 

303 fn = 'img/plot_lp_%s.svg' % LP.lpnr # lp block number on page 

304 fn_abs = config['site_dir'] + '/' + page.file.src_path.rsplit('.md', 1)[0] 

305 if fn_abs.endswith('/index'): 

306 fn_abs = fn_abs.rsplit('/', 1)[0] 

307 fn_abs += '/' + fn 

308 fn_abs = os.path.abspath(fn_abs) 

309 make(fn_abs, copy_frm=fn_abs_docs) 

310 

311 last_img_hash[fn_abs] = kw['id'] lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

312 return '![](%s)' % fn lp|features/lp/plugs/kroki/index.mdlp|features/lp/plugs/kroki/index.md

313 

314 

315def reset_if_is_first_loaded_plugin_and_hash_changed(plugin, c={}): lppytest

316 """mkdocs serve, we must detect if this is a new build""" 

317 cl = clsn(plugin) lppytest

318 if c and not cl in c: lppytest

319 return lp

320 if not c: 320 ↛ 322line 320 didn't jump to line 322, because the condition on line 320 was never falselppytest

321 c[cl] = 0 lppytest

322 if c[cl] == hash(plugin): 322 ↛ 323line 322 didn't jump to line 323, because the condition on line 322 was never truelppytest

323 return 

324 c[cl] = hash(plugin) lppytest

325 return reset() lppytest

326 

327 

328def reset(): lppytest

329 import lcdoc.const as c lppytest

330 

331 t0[0] = now_ms() lppytest

332 

333 [k.clear() for k in [c.Stats, c.PageStats]] lppytest

334 c.LogStats.update({k: 0 for k in c.LogStats}) lppytest

335 return True lppytest

336 

337 

338class MDPlugin(BasePlugin): lppytest

339 def __init__(self): lppytest

340 # also on mkdocs serve, this is called at each rebuild: 

341 r = reset_if_is_first_loaded_plugin_and_hash_changed(self) lppytest

342 app.setup_logging(mkdlog, name='lcd') lppytest

343 if r: lppytest

344 d = datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%SZ') lppytest

345 app.info('Ran reset, cleared stats', reset=r, utc=d, unix=int(time.time())) lppytest

346 Stats[clsn(self)] = {} lppytest

347 PageStats[clsn(self)] = {} lppytest

348 for h in hooks: lppytest

349 f = getattr(self, h, None) lppytest

350 if not f: lppytest

351 continue lppytest

352 wrap_hook(self, f, h) lppytest

353 

354 

355""" 

356All Hooks with Params: 

357https://www.mkdocs.org/dev-guide/plugins/ 

358"""