A start on styling notebooks.
I'd like the website to have some consistency.
This commit is contained in:
parent
610de03e0b
commit
1256fb47d8
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
.input {
|
||||||
|
background: #ddd;
|
||||||
|
color: black;
|
||||||
|
font-family: 'Inconsolata';
|
||||||
|
border-left: 0.2em solid black;
|
||||||
|
padding: 0.25em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -18,12 +18,20 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": 2,
|
||||||
"id": "08a49b81",
|
"id": "08a49b81",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"2147483648"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"1 31 << "
|
"1 31 lshift "
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,11 @@ index.html: build_index.py $(docs_html)
|
||||||
python build_index.py > index.html
|
python build_index.py > index.html
|
||||||
|
|
||||||
$(docs_html): %.html : %.ipynb
|
$(docs_html): %.html : %.ipynb
|
||||||
jupyter nbconvert --to html --template lab $<
|
jupyter nbconvert --to html --template basic $<
|
||||||
|
|
||||||
mov: $(docs_html) index.html
|
mov: $(docs_html) index.html
|
||||||
mv -v $? ../html/notebooks/
|
mv -v $? ../html/notebooks/
|
||||||
|
|
||||||
|
|
||||||
# markdown Functor-Reference.md | tidy5 -utf8 --add-meta-charset yes > ../../html/FR.html
|
# markdown Functor-Reference.md | tidy5 -utf8 --add-meta-charset yes > ../../html/FR.html
|
||||||
|
# --HTMLExporter.embed_images=True
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright © 2022 Simon Forman
|
# Copyright © 2022 - 2023 Simon Forman
|
||||||
#
|
#
|
||||||
# This file is part of Thun
|
# This file is part of Thun
|
||||||
#
|
#
|
||||||
|
|
@ -266,6 +266,7 @@ def reversed_stack(stack):
|
||||||
██╔══╝ ██╔██╗ ██╔═══╝ ██╔══██╗██╔══╝ ╚════██║╚════██║██║██║ ██║██║╚██╗██║
|
██╔══╝ ██╔██╗ ██╔═══╝ ██╔══██╗██╔══╝ ╚════██║╚════██║██║██║ ██║██║╚██╗██║
|
||||||
███████╗██╔╝ ██╗██║ ██║ ██║███████╗███████║███████║██║╚██████╔╝██║ ╚████║
|
███████╗██╔╝ ██╗██║ ██║ ██║███████╗███████║███████║██║╚██████╔╝██║ ╚████║
|
||||||
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
|
╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
|
||||||
|
Expression
|
||||||
|
|
||||||
As elegant as it is to model the expression as a stack, it's not very
|
As elegant as it is to model the expression as a stack, it's not very
|
||||||
efficient, as concatenating definitions and other quoted programs to
|
efficient, as concatenating definitions and other quoted programs to
|
||||||
|
|
@ -300,6 +301,7 @@ def next_term(expression):
|
||||||
██╔═══╝ ██╔══██║██╔══██╗╚════██║██╔══╝ ██╔══██╗
|
██╔═══╝ ██╔══██║██╔══██╗╚════██║██╔══╝ ██╔══██╗
|
||||||
██║ ██║ ██║██║ ██║███████║███████╗██║ ██║
|
██║ ██║ ██║██║ ██║███████║███████╗██║ ██║
|
||||||
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
||||||
|
Parser
|
||||||
|
|
||||||
There is a single function for converting text to joy expressions
|
There is a single function for converting text to joy expressions
|
||||||
as well as a Symbol class and an Exception type. The Symbol
|
as well as a Symbol class and an Exception type. The Symbol
|
||||||
|
|
@ -389,6 +391,7 @@ def text_to_expression(text):
|
||||||
██╔═══╝ ██╔══██╗██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗
|
██╔═══╝ ██╔══██╗██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗
|
||||||
██║ ██║ ██║██║██║ ╚████║ ██║ ███████╗██║ ██║
|
██║ ██║ ██║██║██║ ╚████║ ██║ ███████╗██║ ██║
|
||||||
╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
|
╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
Printer
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -565,6 +568,7 @@ def interp(stack=(), dictionary=None):
|
||||||
██║ ██║██║██║ ██║ ██║██║ ██║██║╚██╗██║██╔══██║██╔══██╗ ╚██╔╝
|
██║ ██║██║██║ ██║ ██║██║ ██║██║╚██╗██║██╔══██║██╔══██╗ ╚██╔╝
|
||||||
██████╔╝██║╚██████╗ ██║ ██║╚██████╔╝██║ ╚████║██║ ██║██║ ██║ ██║
|
██████╔╝██║╚██████╗ ██║ ██║╚██████╔╝██║ ╚████║██║ ██║██║ ██║ ██║
|
||||||
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
|
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
|
||||||
|
Dictionary
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -643,6 +647,7 @@ def help_(stack, expression, dictionary):
|
||||||
██║ ██║ ██║██║╚██╔╝██║██╔══██╗██║██║╚██╗██║██╔══██║ ██║ ██║ ██║██╔══██╗╚════██║
|
██║ ██║ ██║██║╚██╔╝██║██╔══██╗██║██║╚██╗██║██╔══██║ ██║ ██║ ██║██╔══██╗╚════██║
|
||||||
╚██████╗╚██████╔╝██║ ╚═╝ ██║██████╔╝██║██║ ╚████║██║ ██║ ██║ ╚██████╔╝██║ ██║███████║
|
╚██████╗╚██████╔╝██║ ╚═╝ ██║██████╔╝██║██║ ╚████║██║ ██║ ██║ ╚██████╔╝██║ ██║███████║
|
||||||
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
|
||||||
|
Combinators
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -754,6 +759,7 @@ def quit(stack, expr, dictionary):
|
||||||
██║ ██║ ██║██╔══██╗██╔══╝ ██║███╗██║██║ ██║██╔══██╗██║ ██║╚════██║
|
██║ ██║ ██║██╔══██╗██╔══╝ ██║███╗██║██║ ██║██╔══██╗██║ ██║╚════██║
|
||||||
╚██████╗╚██████╔╝██║ ██║███████╗ ╚███╔███╔╝╚██████╔╝██║ ██║██████╔╝███████║
|
╚██████╗╚██████╔╝██║ ██║███████╗ ╚███╔███╔╝╚██████╔╝██║ ██║██████╔╝███████║
|
||||||
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝
|
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝
|
||||||
|
Core Words
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1076,6 +1082,7 @@ for alias, name in (
|
||||||
██║ ██║██╔══╝ ██╔══╝ ██║██║╚██╗██║██║ ██║ ██║██║ ██║██║╚██╗██║╚════██║
|
██║ ██║██╔══╝ ██╔══╝ ██║██║╚██╗██║██║ ██║ ██║██║ ██║██║╚██╗██║╚════██║
|
||||||
██████╔╝███████╗██║ ██║██║ ╚████║██║ ██║ ██║╚██████╔╝██║ ╚████║███████║
|
██████╔╝███████╗██║ ██║██║ ╚████║██║ ██║ ██║╚██████╔╝██║ ╚████║███████║
|
||||||
╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
|
╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
|
||||||
|
Definitions
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1133,6 +1140,9 @@ class Def(object):
|
||||||
██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗ ╚════██║
|
██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗ ╚════██║
|
||||||
██║ ██║ ██║ ███████╗ ╚██████╗██║ ██║███████╗╚██████╗██║ ██╗███████║
|
██║ ██║ ██║ ███████╗ ╚██████╗██║ ██║███████╗╚██████╗██║ ██╗███████║
|
||||||
╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝
|
╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝
|
||||||
|
Type Checks
|
||||||
|
|
||||||
|
Simple guard functions, for type inference see the Prolog versions.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue