Skip to content

Commit 25b98e3

Browse files
committed
more docs and website update, build change
1 parent fc81f06 commit 25b98e3

File tree

10 files changed

+519
-410
lines changed

10 files changed

+519
-410
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ configure-check.wasm
6464
*.log
6565

6666

67+
# keep the actual PDF copy
68+
!docs/kscript.pdf
6769

6870
emsdk/
6971

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,13 @@ $ ./bin/ks examples/fib.ks 10
156156
Inside the `docs/` folder, you can run:
157157

158158
```shell
159-
$ pandoc DOCS.md -s --toc --toc-depth 4 --template template.html --lua-filter=pandoc/anchors.lua -o index.html --syntax-highlighting=none
159+
$ pandoc DOCS.md -o index.html --template template.html -s --toc --number-sections --lua-filter=pandoc/anchors.lua --syntax-highlighting=none
160+
```
161+
162+
And, to generate a PDF copy:
163+
164+
```shell
165+
$ pandoc DOCS.md -o kscript.pdf -s --toc --number-sections --pdf-engine=xelatex -V geometry:a4paper -V geometry:margin=2cm -V fontsize=12pt
160166
```
161167

162168
## TODO for final release

configure

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,19 +1180,16 @@ echo "\$(ks_BIN): \$(ks_O) \$(libks_SHARED)" >> $T
11801180
echo " @mkdir -p \$(dir \$@)" >> $T
11811181

11821182
echo " \$(CC) \\" >> $T
1183-
#echo " \$(LDFLAGS) -Wl,-rpath,'@loader_path/../lib' -L./lib -lks -o \$@" >> $T
11841183
echo " \$(LDFLAGS) \\" >> $T
11851184

11861185
if [ "$PLATFORM" = "linux" ]; then
11871186
# on Linux, use rpath origin semantics
1188-
echo " -Wl,-rpath,'\$\$ORIGIN' -Wl,-rpath,'\$\$ORIGIN/../lib -L./lib -lks' \\" >> $T
1187+
echo " -Wl,-rpath,'\$\$ORIGIN' -Wl,-rpath,'\$\$ORIGIN/../lib' -L./lib -lks \\" >> $T
11891188
elif [ "$PLATFORM" = "darwin" ]; then
11901189
# macOS needs the install_name
11911190
echo " -Wl,-rpath,'@loader_path/../lib' -L./lib -lks \\" >> $T
11921191
fi
11931192

1194-
# echo " \$(LDFLAGS) -Wl,-rpath,'@loader_path/../lib' -L./lib -lks \\" >> $T
1195-
11961193
echo " \$(ks_O) \\" >> $T
11971194
echo " -o \$@" >> $T
11981195

docs/DOCS.md

Lines changed: 75 additions & 66 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 353 additions & 231 deletions
Large diffs are not rendered by default.

docs/kscript.pdf

185 KB
Binary file not shown.

docs/pandoc/anchors.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ function DefinitionList(dl)
1919
-- first, start with just stringifying the content
2020
local id = pandoc.utils.stringify(term)
2121

22-
-- convert to lowercase
23-
--id = id:lower()
24-
2522
-- cut it off at the first parenthesis
2623
id = id:match("^[^\\(]*")
2724

docs/repl/index.html

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width,initial-scale=1.0">
8-
<title>kscript REPL</title>
8+
<title>kscript v0.3.1 - REPL</title>
99

1010
<!-- jQuery -->
1111
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
@@ -51,20 +51,6 @@
5151
5252
</template>
5353

54-
<template id="greetings2">
55-
$$\ $$\ $$\
56-
$$ | \__| $$ |
57-
$$ | $$\ $$$$$$$\ $$$$$$$\ $$$$$$\ $$\ $$$$$$\ $$$$$$\
58-
$$ | $$ |$$ _____|$$ _____|$$ __$$\ $$ |$$ __$$\\_$$ _|
59-
$$$$$$ / \$$$$$$\ $$ / $$ | \__|$$ |$$ / $$ | $$ |
60-
$$ _$$< \____$$\ $$ | $$ | $$ |$$ | $$ | $$ |$$\
61-
$$ | \$$\ $$$$$$$ |\$$$$$$$\ $$ | $$ |$$$$$$$ | \$$$$ |
62-
\__| \__|\_______/ \_______|\__| \__|$$ ____/ \____/
63-
$$ |
64-
$$ |
65-
\__|
66-
</template>
67-
6854
<script>
6955
var ks = null;
7056
let hist_cmds = []

docs/site.css

Lines changed: 73 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -38,83 +38,18 @@ nav {
3838
overflow-x: hidden;
3939
padding: 0.5em;
4040
font-size: 0.9rem;
41+
background: #ddd;
4142
}
4243

4344

4445
main {
4546
width: auto;
4647
margin-left: 350px;
47-
padding: 0 2em;
48+
padding: 1em 2em;
4849
}
4950

5051

51-
52-
/* @media print { */
53-
54-
@media print {
55-
nav {
56-
display: none;
57-
}
58-
main {
59-
margin: 0;
60-
/* margin: 1.5em; */
61-
}
62-
pre {
63-
white-space: pre-wrap;
64-
}
65-
66-
@page {
67-
padding: 1em;
68-
}
69-
}
70-
71-
72-
nav.asdf {
73-
background: #ddd;
74-
/* overflow: auto; */
75-
76-
position: fixed;
77-
78-
/* height: 100vh; */
79-
80-
/* height: 100%;
81-
position: fixed;
82-
z-index: 1;
83-
top: 0;
84-
left: 0;
85-
overflow-x: hidden; */
86-
87-
88-
width: 300px;
89-
padding: 0.5em;
90-
font-size: 0.85rem;
91-
92-
/* height: 100vh; */
93-
94-
/* background: #ddd;
95-
font-size: 0.9rem;
96-
width: 300px; */
97-
/* flex: 0 0 300px; */
98-
/* height: 100vh; */
99-
}
100-
101-
102-
103-
main.asdf {
104-
/* background: #eee; */
105-
flex: 1;
106-
/* overflow: auto; */
107-
/* height: 100vh; */
108-
/* overflow-x: hidden; */
109-
padding: 0 1em;
110-
padding-left: 320px;
111-
width: auto;
112-
/* margin: 0; */
113-
/* padding: 1.0em; */
114-
}
115-
11652
/* on the first level of TOC in the nav, don't make it a list */
117-
11853
nav > ul {
11954
list-style: none;
12055
/* padding-left: 0; */
@@ -124,18 +59,9 @@ nav > ul {
12459
display: block;
12560
}
12661

127-
/* on the first level of TOC in the nav, don't make it a list */
128-
nav > ul > li > ul {
129-
list-style: none;
130-
/* padding-left: 0; */
131-
padding: 0;
132-
/* padding: 0.5em; */
133-
margin: 0;
134-
display: block;
135-
}
13662

13763
/* and, add an hr divider psuedo-element after each top-level list item */
138-
nav > ul > li > ul > li::after {
64+
nav > ul > li::after {
13965
content: "";
14066
display: block;
14167
border-bottom: 1px solid #222;
@@ -144,27 +70,20 @@ nav > ul > li > ul > li::after {
14470

14571

14672
/* second level, make it use the first-level list style */
147-
nav ul ul,
148-
nav ul ol,
149-
nav ol ul,
150-
nav ol ol {
73+
nav ul ul {
15174
list-style: initial;
15275
padding-left: 1.6em;
15376
margin: 0;
15477
}
15578

79+
80+
/* color links, but don't underline them */
15681
nav a {
15782
text-decoration: none;
15883
color: #0f52aa;
15984
}
16085

16186

162-
163-
nav li,
164-
nav li {
165-
}
166-
167-
16887
dt {
16988
font-family: monospace;
17089
font-weight: bold;
@@ -211,8 +130,8 @@ pre {
211130
/* use section symbol */
212131
content: "§";
213132

214-
215133
}
134+
216135
h1:hover > .anchor-link,
217136
h2:hover > .anchor-link,
218137
h3:hover > .anchor-link,
@@ -228,6 +147,72 @@ dt:hover > .anchor-link {
228147
visibility: visible;
229148
}
230149

150+
151+
152+
/* for printing to a physical page, we style it differently */
153+
@media print {
154+
/* hide the nav, since it will show up on each page */
155+
nav {
156+
display: none;
157+
}
158+
159+
/* don't need any margin on the main content */
160+
main {
161+
margin: 0;
162+
}
163+
164+
/* overflow would be hidden, since there is no scrollbar */
165+
pre {
166+
white-space: pre-wrap;
167+
}
168+
169+
/* and each actual page should have some padding as well */
170+
@page {
171+
padding: 1em;
172+
}
173+
}
174+
175+
176+
177+
178+
179+
/* Highlight.js Line Numbers Styling */
180+
181+
/* for block of numbers */
182+
.hljs-ln-numbers {
183+
-webkit-touch-callout: none;
184+
-webkit-user-select: none;
185+
-khtml-user-select: none;
186+
-moz-user-select: none;
187+
-ms-user-select: none;
188+
user-select: none;
189+
190+
text-align: center;
191+
color: #333;
192+
border-right: 1px solid #333;
193+
vertical-align: top;
194+
/* padding-right: 5px; */
195+
196+
/* your custom style here */
197+
}
198+
199+
/* for block of code */
200+
.hljs-ln-code {
201+
padding-left: 5px !important;
202+
}
203+
204+
205+
.hljs-ln td {
206+
/* padding: 0 !important; */
207+
}
208+
209+
210+
.hljs-ln-n {
211+
padding-right: 5px !important;
212+
text-align: right !important;
213+
}
214+
215+
231216
/** Code Highlighting **/
232217

233218
pre code.hljs {

docs/template.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset='utf-8'>
55
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
66
<meta name='viewport' content='width=device-width,initial-scale=1.0'>
7-
<title>$title$</title>
7+
<title>kscript v0.3.1 - docs</title>
88

99
<!-- MathJax -->
1010
<script>
@@ -22,9 +22,14 @@
2222
<script src='./site-hljs-kscript.js'></script>
2323
<script>hljs.highlightAll();</script>
2424

25+
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/highlightjs-line-numbers.min.js"></script>
26+
<script>hljs.initLineNumbersOnLoad();</script>
27+
2528
<!-- kscript specific assets -->
2629
<script src='./site.js'></script>
27-
<link rel="stylesheet" href="./site.css">
30+
<link rel="stylesheet" href="./site.css">
31+
32+
2833
</head>
2934
<body>
3035
<nav class="sidenav">

0 commit comments

Comments
 (0)