Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechStep committed Oct 24, 2023
1 parent cd5e4e6 commit d5a7a37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions scripts/preprocessor_concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
LINK_REGEX = re.compile(
r'\[(.*?)\]\(.*\)')


def does_support(backend):
return backend == 'html'


def sub_match_for_concept(m, mut_index, path):
wikidata_id = m.group(1)
text = m.group(2)
Expand All @@ -35,12 +37,14 @@ def sub_match_for_concept(m, mut_index, path):
mut_index.append(index_entry)
return f'{anchor}<b>{text}</b>'


def tag_concepts_chapter_rec_mut(chapter, config, mut_index):
chapter['content'] = CONCEPT_REGEX.sub(
lambda m: sub_match_for_concept(m, mut_index, chapter['path']),
chapter['content'])
tag_concepts_sections_rec_mut(chapter['sub_items'], config, mut_index)


def tag_concepts_sections_rec_mut(sections, config, mut_index):
for section in sections:
chapter = section.get('Chapter')
Expand All @@ -49,13 +53,15 @@ def tag_concepts_sections_rec_mut(sections, config, mut_index):

tag_concepts_chapter_rec_mut(chapter, config, mut_index)


def tag_concepts_root_section(section, config, mut_index):
chapter = section.get('Chapter')
if chapter is not None:
tag_concepts_chapter_rec_mut(chapter, config, mut_index)

return section


if __name__ == '__main__':
if len(sys.argv) > 1:
arguments = sys.argv[1:]
Expand Down
5 changes: 3 additions & 2 deletions src/graph-theory/circuits-undirected-graphs.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ open import graph-theory.undirected-graphs

## Idea

A {{#concept WD=Q245595 "circuit"}} in an [undirected graph](graph-theory.undirected-graphs.md)
`G` consists of a [`k`-gon](graph-theory.polygons.md) `H` equipped with a
A {{#concept WD=Q245595 "circuit"}} in an
[undirected graph](graph-theory.undirected-graphs.md) `G` consists of a
[`k`-gon](graph-theory.polygons.md) `H` equipped with a
[totally faithful](graph-theory.totally-faithful-morphisms-undirected-graphs.md)
[morphism](graph-theory.morphisms-undirected-graphs.md) of undirected graphs
from `H` to `G`. In other words, a circuit is a closed walk with no repeated
Expand Down

0 comments on commit d5a7a37

Please sign in to comment.