From 81f104fccfef077b4d4ae5e510121c58856ded48 Mon Sep 17 00:00:00 2001 From: sforman Date: Tue, 14 Nov 2023 10:40:24 -0800 Subject: [PATCH] Fix up the links. --- docs/build_index.py | 8 ++- docs/html/notebooks/BigInts.html | 6 +- docs/html/notebooks/DeriveZip.html | 6 +- docs/html/notebooks/Generator_Programs.html | 6 +- docs/html/notebooks/NerdSnipe.html | 6 +- docs/html/notebooks/index.html | 78 ++++++++++----------- docs/reference/to_html.py | 14 ++-- docs/source/Thun.md | 2 +- 8 files changed, 66 insertions(+), 60 deletions(-) diff --git a/docs/build_index.py b/docs/build_index.py index d9a43fa..9896d39 100644 --- a/docs/build_index.py +++ b/docs/build_index.py @@ -13,15 +13,17 @@ def title_of(html): html = markdown.markdown(text, output_format="html5") +rel = '../' if 'notebooks' in filename else '' + print(f'''\ {title_of(html)} - - - + + +
diff --git a/docs/html/notebooks/BigInts.html b/docs/html/notebooks/BigInts.html index 298b3e4..fcc1248 100644 --- a/docs/html/notebooks/BigInts.html +++ b/docs/html/notebooks/BigInts.html @@ -3,9 +3,9 @@ BigNums in Joy - - - + + +
diff --git a/docs/html/notebooks/DeriveZip.html b/docs/html/notebooks/DeriveZip.html index b27a5ac..7bb0b32 100644 --- a/docs/html/notebooks/DeriveZip.html +++ b/docs/html/notebooks/DeriveZip.html @@ -3,9 +3,9 @@ Zip - - - + + +
diff --git a/docs/html/notebooks/Generator_Programs.html b/docs/html/notebooks/Generator_Programs.html index 8df9d9d..eddcbd3 100644 --- a/docs/html/notebooks/Generator_Programs.html +++ b/docs/html/notebooks/Generator_Programs.html @@ -3,9 +3,9 @@ Generator Programs - - - + + +
diff --git a/docs/html/notebooks/NerdSnipe.html b/docs/html/notebooks/NerdSnipe.html index 70e0b94..cc0fc4c 100644 --- a/docs/html/notebooks/NerdSnipe.html +++ b/docs/html/notebooks/NerdSnipe.html @@ -3,9 +3,9 @@ Nerd Sniped - - - + + +
diff --git a/docs/html/notebooks/index.html b/docs/html/notebooks/index.html index 940f1de..8d20bf8 100644 --- a/docs/html/notebooks/index.html +++ b/docs/html/notebooks/index.html @@ -3,51 +3,51 @@ Thun Notebooks - - + +

Thun Notebooks

-

Home

+

Home

Various Jupyter notebooks, some more polished than others, a few incomplete. I'm in the process of rewriting them.

diff --git a/docs/reference/to_html.py b/docs/reference/to_html.py index ce54218..39de3c7 100644 --- a/docs/reference/to_html.py +++ b/docs/reference/to_html.py @@ -32,13 +32,13 @@ def symbols_of(expression): return used_in = { - name: sorted(set(symbols_of(joy.text_to_expression(definitions[name])))) - for name in definitions + name: sorted(set(symbols_of(joy.text_to_expression(def_str)))) + for name, def_str in definitions.items() } used_by = defaultdict(list) -for name in used_in: - for term in used_in[name]: +for name, syms in used_in.items(): + for term in syms: used_by[term].append(name) for el in used_by.values(): el.sort() @@ -71,9 +71,13 @@ gt lt ge le neq eq << >> lshift rshift'''.split()) + +# Split the file into chunks at the Horizontal Rules. k = re.split('^-+$', md, flags=re.MULTILINE) #k = md.split('------------------------------------------------------------------------\n') + del k[0] + k = [section.splitlines() for section in k] ##s = set(range(len(k))) @@ -104,7 +108,7 @@ for section in k: combinators = set( name - for (name, section) in sections.items() + for name, section in sections.items() if 'Combinator' in section ) for name in combinators: diff --git a/docs/source/Thun.md b/docs/source/Thun.md index 4b3f004..d5fec57 100644 --- a/docs/source/Thun.md +++ b/docs/source/Thun.md @@ -1,6 +1,6 @@ # Thun Specification -Version 0.5.0 +[Thun Version 0.5.0](https://ariadne.systems/pub/~sforman/Thun/) ## Grammar