Fix up the links.
This commit is contained in:
parent
b7954a39a2
commit
81f104fccf
|
|
@ -13,15 +13,17 @@ def title_of(html):
|
||||||
|
|
||||||
html = markdown.markdown(text, output_format="html5")
|
html = markdown.markdown(text, output_format="html5")
|
||||||
|
|
||||||
|
rel = '../' if 'notebooks' in filename else ''
|
||||||
|
|
||||||
print(f'''\
|
print(f'''\
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>{title_of(html)}</title>
|
<title>{title_of(html)}</title>
|
||||||
<link rel="stylesheet" href="css/font/fonts.css">
|
<link rel="stylesheet" href="{rel}css/font/fonts.css">
|
||||||
<link rel="stylesheet" href="css/site.css">
|
<link rel="stylesheet" href="{rel}css/site.css">
|
||||||
<script src="Joy.js"></script>
|
<script src="{rel}Joy.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="joy_interpreter"></div>
|
<div id="joy_interpreter"></div>
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>BigNums in Joy</title>
|
<title>BigNums in Joy</title>
|
||||||
<link rel="stylesheet" href="css/font/fonts.css">
|
<link rel="stylesheet" href="../css/font/fonts.css">
|
||||||
<link rel="stylesheet" href="css/site.css">
|
<link rel="stylesheet" href="../css/site.css">
|
||||||
<script src="Joy.js"></script>
|
<script src="../Joy.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="joy_interpreter"></div>
|
<div id="joy_interpreter"></div>
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Zip</title>
|
<title>Zip</title>
|
||||||
<link rel="stylesheet" href="css/font/fonts.css">
|
<link rel="stylesheet" href="../css/font/fonts.css">
|
||||||
<link rel="stylesheet" href="css/site.css">
|
<link rel="stylesheet" href="../css/site.css">
|
||||||
<script src="Joy.js"></script>
|
<script src="../Joy.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="joy_interpreter"></div>
|
<div id="joy_interpreter"></div>
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Generator Programs</title>
|
<title>Generator Programs</title>
|
||||||
<link rel="stylesheet" href="css/font/fonts.css">
|
<link rel="stylesheet" href="../css/font/fonts.css">
|
||||||
<link rel="stylesheet" href="css/site.css">
|
<link rel="stylesheet" href="../css/site.css">
|
||||||
<script src="Joy.js"></script>
|
<script src="../Joy.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="joy_interpreter"></div>
|
<div id="joy_interpreter"></div>
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Nerd Sniped</title>
|
<title>Nerd Sniped</title>
|
||||||
<link rel="stylesheet" href="css/font/fonts.css">
|
<link rel="stylesheet" href="../css/font/fonts.css">
|
||||||
<link rel="stylesheet" href="css/site.css">
|
<link rel="stylesheet" href="../css/site.css">
|
||||||
<script src="Joy.js"></script>
|
<script src="../Joy.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="joy_interpreter"></div>
|
<div id="joy_interpreter"></div>
|
||||||
|
|
|
||||||
|
|
@ -3,51 +3,51 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Thun Notebooks</title>
|
<title>Thun Notebooks</title>
|
||||||
<link rel="stylesheet" href="css/font/fonts.css">
|
<link rel="stylesheet" href="../css/font/fonts.css">
|
||||||
<link rel="stylesheet" href="css/site.css">
|
<link rel="stylesheet" href="../css/site.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Thun Notebooks</h1>
|
<h1>Thun Notebooks</h1>
|
||||||
<p><a href="/">Home</a></p>
|
<p><a href="..">Home</a></p>
|
||||||
<p>Various Jupyter notebooks, some more polished than others, a few incomplete.
|
<p>Various Jupyter notebooks, some more polished than others, a few incomplete.
|
||||||
I'm in the process of rewriting them.</p>
|
I'm in the process of rewriting them.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="notebooks/0._This_Implementation_of_Joy_in_Python.html">0. This Implementation of Joy in Python</a></li>
|
<li><a href="0._This_Implementation_of_Joy_in_Python.html">0. This Implementation of Joy in Python</a></li>
|
||||||
<li><a href="notebooks/1._Basic_Use_of_Joy_in_a_Notebook.html">1. Basic Use of Joy in a Notebook</a></li>
|
<li><a href="1._Basic_Use_of_Joy_in_a_Notebook.html">1. Basic Use of Joy in a Notebook</a></li>
|
||||||
<li><a href="notebooks/2._Library_Examples.html">2. Library Examples</a></li>
|
<li><a href="2._Library_Examples.html">2. Library Examples</a></li>
|
||||||
<li><a href="notebooks/3._Developing_a_Program.html">3. Developing a Program</a></li>
|
<li><a href="3._Developing_a_Program.html">3. Developing a Program</a></li>
|
||||||
<li><a href="notebooks/Developing_a_Program.html">Developing a Program</a></li>
|
<li><a href="Developing_a_Program.html">Developing a Program</a></li>
|
||||||
<li><a href="notebooks/Advent_of_Code_2017_December_1st.html">Advent of Code 2017 December 1st</a></li>
|
<li><a href="Advent_of_Code_2017_December_1st.html">Advent of Code 2017 December 1st</a></li>
|
||||||
<li><a href="notebooks/Advent_of_Code_2017_December_2nd.html">Advent of Code 2017 December 2nd</a></li>
|
<li><a href="Advent_of_Code_2017_December_2nd.html">Advent of Code 2017 December 2nd</a></li>
|
||||||
<li><a href="notebooks/Advent_of_Code_2017_December_3rd.html">Advent of Code 2017 December 3rd</a></li>
|
<li><a href="Advent_of_Code_2017_December_3rd.html">Advent of Code 2017 December 3rd</a></li>
|
||||||
<li><a href="notebooks/Advent_of_Code_2017_December_4th.html">Advent of Code 2017 December 4th</a></li>
|
<li><a href="Advent_of_Code_2017_December_4th.html">Advent of Code 2017 December 4th</a></li>
|
||||||
<li><a href="notebooks/Advent_of_Code_2017_December_5th.html">Advent of Code 2017 December 5th</a></li>
|
<li><a href="Advent_of_Code_2017_December_5th.html">Advent of Code 2017 December 5th</a></li>
|
||||||
<li><a href="notebooks/Advent_of_Code_2017_December_6th.html">Advent of Code 2017 December 6th</a></li>
|
<li><a href="Advent_of_Code_2017_December_6th.html">Advent of Code 2017 December 6th</a></li>
|
||||||
<li><a href="notebooks/BigInts.html">BigNums</a></li>
|
<li><a href="BigInts.html">BigNums</a></li>
|
||||||
<li><a href="notebooks/Compiling_Joy.html">Compiling Joy</a></li>
|
<li><a href="Compiling_Joy.html">Compiling Joy</a></li>
|
||||||
<li><a href="notebooks/Correcet_Programming.html">Correcet Programming</a></li>
|
<li><a href="Correcet_Programming.html">Correcet Programming</a></li>
|
||||||
<li><a href="notebooks/Derivatives_of_Regular_Expressions.html">Derivatives of Regular Expressions</a></li>
|
<li><a href="Derivatives_of_Regular_Expressions.html">Derivatives of Regular Expressions</a></li>
|
||||||
<li><a href="notebooks/Generator_Programs.html">Generator Programs</a></li>
|
<li><a href="Generator_Programs.html">Generator Programs</a></li>
|
||||||
<li><a href="notebooks/Hylo-,_Ana-,_Cata-,_and_Para-morphisms_-_Recursion_Combinators.html">Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators</a></li>
|
<li><a href="Hylo-,_Ana-,_Cata-,_and_Para-morphisms_-_Recursion_Combinators.html">Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators</a></li>
|
||||||
<li><a href="notebooks/Intro-to-Joy.html">Intro-to-Joy</a></li>
|
<li><a href="Intro-to-Joy.html">Intro-to-Joy</a></li>
|
||||||
<li><a href="notebooks/Joy-in-Jupyter.html">Joy-in-Jupyter</a></li>
|
<li><a href="Joy-in-Jupyter.html">Joy-in-Jupyter</a></li>
|
||||||
<li><a href="notebooks/Multiples-of-3-and-5.html">Multiples-of-3-and-5</a></li>
|
<li><a href="Multiples-of-3-and-5.html">Multiples-of-3-and-5</a></li>
|
||||||
<li><a href="notebooks/NeoAero.html">NeoAero</a></li>
|
<li><a href="NeoAero.html">NeoAero</a></li>
|
||||||
<li><a href="notebooks/Newton-Raphson.html">Newton-Raphson</a></li>
|
<li><a href="Newton-Raphson.html">Newton-Raphson</a></li>
|
||||||
<li><a href="notebooks/Ordered_Binary_Trees.html">Ordered Binary Trees</a></li>
|
<li><a href="Ordered_Binary_Trees.html">Ordered Binary Trees</a></li>
|
||||||
<li><a href="notebooks/Quadratic.html">Quadratic</a></li>
|
<li><a href="Quadratic.html">Quadratic</a></li>
|
||||||
<li><a href="notebooks/Recursion_Combinators.html">Recursion Combinators</a></li>
|
<li><a href="Recursion_Combinators.html">Recursion Combinators</a></li>
|
||||||
<li><a href="notebooks/Remove-Function.html">Remove-Function</a></li>
|
<li><a href="Remove-Function.html">Remove-Function</a></li>
|
||||||
<li><a href="notebooks/Replacing.html">Replacing</a></li>
|
<li><a href="Replacing.html">Replacing</a></li>
|
||||||
<li><a href="notebooks/Square_Spiral.html">Square Spiral</a></li>
|
<li><a href="Square_Spiral.html">Square Spiral</a></li>
|
||||||
<li><a href="notebooks/The_Four_Operations.html">The Four Operations</a></li>
|
<li><a href="The_Four_Operations.html">The Four Operations</a></li>
|
||||||
<li><a href="notebooks/Trees.html">Trees</a></li>
|
<li><a href="Trees.html">Trees</a></li>
|
||||||
<li><a href="notebooks/Treestep.html">Treestep</a></li>
|
<li><a href="Treestep.html">Treestep</a></li>
|
||||||
<li><a href="notebooks/TypeChecking.html">TypeChecking</a></li>
|
<li><a href="TypeChecking.html">TypeChecking</a></li>
|
||||||
<li><a href="notebooks/Types.html">Types</a></li>
|
<li><a href="Types.html">Types</a></li>
|
||||||
<li><a href="notebooks/Zipper.html">Zipper</a></li>
|
<li><a href="Zipper.html">Zipper</a></li>
|
||||||
<li><a href="notebooks/fun_with_scan.html">fun with scan</a></li>
|
<li><a href="fun_with_scan.html">fun with scan</a></li>
|
||||||
<li><a href="notebooks/with_sympy.html">with sympy</a></li>
|
<li><a href="with_sympy.html">with sympy</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ def symbols_of(expression):
|
||||||
return
|
return
|
||||||
|
|
||||||
used_in = {
|
used_in = {
|
||||||
name: sorted(set(symbols_of(joy.text_to_expression(definitions[name]))))
|
name: sorted(set(symbols_of(joy.text_to_expression(def_str))))
|
||||||
for name in definitions
|
for name, def_str in definitions.items()
|
||||||
}
|
}
|
||||||
|
|
||||||
used_by = defaultdict(list)
|
used_by = defaultdict(list)
|
||||||
for name in used_in:
|
for name, syms in used_in.items():
|
||||||
for term in used_in[name]:
|
for term in syms:
|
||||||
used_by[term].append(name)
|
used_by[term].append(name)
|
||||||
for el in used_by.values():
|
for el in used_by.values():
|
||||||
el.sort()
|
el.sort()
|
||||||
|
|
@ -71,9 +71,13 @@ gt lt ge le neq eq
|
||||||
<< >>
|
<< >>
|
||||||
lshift rshift'''.split())
|
lshift rshift'''.split())
|
||||||
|
|
||||||
|
|
||||||
|
# Split the file into chunks at the Horizontal Rules.
|
||||||
k = re.split('^-+$', md, flags=re.MULTILINE)
|
k = re.split('^-+$', md, flags=re.MULTILINE)
|
||||||
#k = md.split('------------------------------------------------------------------------\n')
|
#k = md.split('------------------------------------------------------------------------\n')
|
||||||
|
|
||||||
del k[0]
|
del k[0]
|
||||||
|
|
||||||
k = [section.splitlines() for section in k]
|
k = [section.splitlines() for section in k]
|
||||||
|
|
||||||
##s = set(range(len(k)))
|
##s = set(range(len(k)))
|
||||||
|
|
@ -104,7 +108,7 @@ for section in k:
|
||||||
|
|
||||||
combinators = set(
|
combinators = set(
|
||||||
name
|
name
|
||||||
for (name, section) in sections.items()
|
for name, section in sections.items()
|
||||||
if 'Combinator' in section
|
if 'Combinator' in section
|
||||||
)
|
)
|
||||||
for name in combinators:
|
for name in combinators:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Thun Specification
|
# Thun Specification
|
||||||
|
|
||||||
Version 0.5.0
|
[Thun Version 0.5.0](https://ariadne.systems/pub/~sforman/Thun/)
|
||||||
|
|
||||||
## Grammar
|
## Grammar
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue