mirror of
https://0xacab.org/anarsec/anarsec.guide.git
synced 2025-06-08 14:52:54 -04:00
csrc links to notrace.how, miscellaneous edits
This commit is contained in:
parent
9d659896fa
commit
d83276dadb
17 changed files with 42 additions and 153 deletions
|
@ -101,8 +101,13 @@
|
|||
}
|
||||
else if it.dest.starts-with("/glossary#") or it.dest.starts-with("/glossary/#") {
|
||||
locate(location => {
|
||||
let elements = query(label(it.dest.trim("/glossary#", at: start).trim("/glossary/#", at: start)), location)
|
||||
text[#super[†]]
|
||||
let elements = query(heading.where(label: label(it.dest.trim("/glossary#", at: start).trim("/glossary/#", at: start)), level: 2), location)
|
||||
if elements.len() != 0 {
|
||||
text[#super[†]]
|
||||
}
|
||||
else {
|
||||
footnote[anarsec.guide/glossary]
|
||||
}
|
||||
})
|
||||
}
|
||||
else if it.dest.starts-with("/") {
|
||||
|
|
|
@ -135,17 +135,6 @@ class Converter:
|
|||
for match in re.findall(r'\[.*?\]\(/glossary\/?#(.*?)\)', markdown_content):
|
||||
glossary_entries.add(slugify.slugify(match))
|
||||
|
||||
# Add to glossary entries the glossary entries that appear in glossary entries, recursively
|
||||
added_entry = True
|
||||
while added_entry:
|
||||
added_entry = False
|
||||
for entry in list(glossary_entries):
|
||||
for match in re.findall(r'\[.*?\]\((?:/glossary|)\/?#(.*?)\)', glossary[entry][1]):
|
||||
new_entry = slugify.slugify(match)
|
||||
if new_entry not in glossary_entries:
|
||||
glossary_entries.add(new_entry)
|
||||
added_entry = True
|
||||
|
||||
# Add glossary entries to the Markdown content
|
||||
if glossary_entries:
|
||||
markdown_content += "\n\n# Glossary\n\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue