Skip to content

Commit 3593b60

Browse files
committed
Merge branch 'mkdocs-build'
* Branch commit log: .gitignore: add OUTLINE.md misc/subdirs.mk: use $O or out/ as builddir if unset .github/workflows/pages.yml: name workflow doc/copyright.ini: fix missing licenses doc/mkdocs.yml: fix site URL, cleanup, improve nav doc/*: remove old sections doc/index.md: merge intro and install info doc/mkdocs.yml: add comment about future feature doc/Makefile.mk: use new tab for external links doc/Makefile.mk: add comments doc/mkdocs.yml: trim Doxygen generation of mkdoxy * doc/Makefile.mk: remove useless listing of anonymous namespaces doc/mkdocs.yml: enableMathJAX rendering * doc/ch-appendix.md: simplify for MathJAX * doc/javascripts/mathjax.js: detect MathJAX blocks * doc/Makefile.mk: allow extra Javascript doc/mkdocs.yml: use new nav structure doc/how-audio.md: add "Howto Setup Audio (Linux)" * doc/Makefile.mk: add doc/how-audio.md to doc files * doc/mkdocs.yml: add doc/how-audio.md to nav doc/tut-play.md: add "Tutorial 1: Starting to Play Notes" * doc/Makefile.mk: add doc/tut-play.md to doc files * doc/mkdocs.yml: add doc/tut-play.md to nav doc/mkdocs.yml: enable markdown_extensions doc/index.md: add mkdocs front page * doc/Makefile.mk: add index.md to docs * doc/mkdocs.yml: add index.md to nav .github/workflows/pages.yml: build docu with mkdocs and deploy pages doc/Makefile.mk: extend mkdocs, add pdf doc/Makefile.mk: add mkdocs rule doc/mkdocs.yml: build modernized docs with mkdocs, mkdoxy misc/Dockerfile.jammy: update build dependencies, add mkdocs ui/eslintrc.js: allow attrs w/o newlines package.json: update Vue, Electron, Lit and development dependencies package.json: add moxygen Signed-off-by: Tim Janik <[email protected]>
2 parents 9505432 + 895a0ae commit 3593b60

File tree

17 files changed

+599
-218
lines changed

17 files changed

+599
-218
lines changed

.github/workflows/pages.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2+
#
3+
# Workflow for mkdocs building and deploying to GitHub Pages
4+
#
5+
# Linting: xclip -sel c <.github/workflows/pages.yml # https://rhysd.github.io/actionlint/
6+
#
7+
name: Deploy mkdocs site to Pages
8+
9+
on:
10+
# Runs on pushes targeting the default branch
11+
push:
12+
branches: ["trunk"]
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
23+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
24+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
25+
concurrency:
26+
group: "pages"
27+
cancel-in-progress: false
28+
29+
jobs:
30+
# Build job
31+
build:
32+
runs-on: ubuntu-latest
33+
container: { image: 'ghcr.io/tim-janik/anklang-ci:jammy-latest' }
34+
steps:
35+
- name: Checkout Anklang
36+
run: |
37+
pwd && ls -al
38+
rm -rf * .[^.]* ..?*
39+
git clone --recurse-submodules https://github.com/tim-janik/anklang.git .
40+
- name: Setup Pages
41+
id: pages
42+
uses: actions/configure-pages@v5
43+
- run: echo -e 'prefix=/\n CC=clang \n CXX=clang++ \n CLANG_TIDY=clang-tidy ' > config-defaults.mk
44+
- run: make mkdocs -j`nproc`
45+
- run: ls -al out/site/
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: ./out/site/
50+
51+
# Deployment job
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.submodule-stamp
55
/.vscode/
66
/BACKLOG.md
7+
/OUTLINE.md
78
/TAGS
89
/bun.lockb
910
/compile_commands.json

doc/Makefile.mk

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ doc/all:
77

88
# == doc/ files ==
99
doc/manual-chapters ::= $(strip \
10-
doc/ch-intro.md \
11-
doc/ch-install.md \
12-
doc/ch-editing.md \
1310
$>/doc/b/cliplist.md \
1411
$>/doc/b/pianoroll.md \
1512
$>/doc/b/piano-ctrl.md \
@@ -250,3 +247,76 @@ doc/uninstall: FORCE uninstall--doc/style/install.files
250247
uninstall: doc/uninstall
251248

252249
doc/all: $(doc/install.files)
250+
251+
252+
# == mkdocs ==
253+
doc/mkdocs.mdlist ::= $(doc/manual-chapters) $(doc/internals-chapters) doc/index.md doc/tut-play.md doc/how-audio.md
254+
$>/site/search/search_index.js: # $>/mkdocs/anklang-cxx.pdf $>/mkdocs/anklang-cxx.html
255+
$>/site/search/search_index.js: doc/mkdocs.yml $(doc/mkdocs.mdlist) | $>/mkdocs/
256+
@$(QECHO) RUN mkdocs
257+
$Q rm -rf $>/site/
258+
$Q # prepare mkdocs inputs
259+
$Q cp $< $>/mkdocs.yml && cp $(doc/mkdocs.mdlist) $>/mkdocs/
260+
$Q cp -r doc/javascript $>/mkdocs/
261+
$Q # mkdocs build to $>/site/
262+
$Q cd $> && mkdocs build
263+
$Q # remove useless listing of anonymous namespaces
264+
$Q sed 's|<li><strong>namespace</strong> *<a[^>]*><strong>@[0-9]+</strong></a> *</li>||' \
265+
-r -i $>/site/AnklangCxx/namespaces.html $>/site/AnklangCxx/annotated.html
266+
$Q # use new tab for external links
267+
$Q sed -r '/http[^ ]*github.io\/anklang/!s|<a (href="https?://[^">]+")>|<a \1 target="_blank">|g' \
268+
-i out/site/*.html
269+
$Q # TODO: Section on Piano-Ctrl needs SVG tools icons
270+
mkdocs:
271+
rm -rf $>/mkdocs/
272+
$(MAKE) $>/site/search/search_index.js
273+
define doc_doxygen_xmlcfg
274+
PROJECT_NAME = "Anklang C++ API"
275+
PROJECT_NUMBER = $(version_short)
276+
OUTPUT_DIRECTORY = $>/doxygen/
277+
ALLOW_UNICODE_NAMES = YES
278+
EXTRACT_LOCAL_CLASSES = NO
279+
HIDE_UNDOC_MEMBERS = YES
280+
HIDE_UNDOC_CLASSES = YES
281+
HIDE_FRIEND_COMPOUNDS = YES
282+
INTERNAL_DOCS = YES
283+
HIDE_COMPOUND_REFERENCE= YES
284+
SHOW_INCLUDE_FILES = NO
285+
INLINE_INFO = NO
286+
SHOW_USED_FILES = NO
287+
SHOW_FILES = NO
288+
INPUT = ase/ devices/
289+
VERBATIM_HEADERS = NO
290+
HTML_COLORSTYLE_SAT = 60
291+
HTML_DYNAMIC_MENUS = NO
292+
GENERATE_HTML = NO
293+
GENERATE_XML = YES
294+
XML_PROGRAMLISTING = NO
295+
PREDEFINED = "ASE_CLASS_DECLS(x)="
296+
HIDE_UNDOC_RELATIONS = YES
297+
COLLABORATION_GRAPH = NO
298+
GROUP_GRAPHS = NO
299+
INCLUDE_GRAPH = NO
300+
INCLUDED_BY_GRAPH = NO
301+
GRAPHICAL_HIERARCHY = NO
302+
DIRECTORY_GRAPH = NO
303+
DOT_IMAGE_FORMAT = svg
304+
LATEX_CMD_NAME = xelatex
305+
COMPACT_LATEX = YES
306+
LATEX_HIDE_INDICES = YES
307+
endef
308+
export doc_doxygen_xmlcfg
309+
$>/doxygen/latex/refman.tex: doc/Makefile.mk
310+
@$(QECHO) RUN doxygen
311+
$Q cat > $>/Doxyfile <<<$$doc_doxygen_xmlcfg
312+
$Q rm -rf $>/doxygen/ && doxygen $>/Doxyfile
313+
$>/doxygen/xml/index.xml: $>/doxygen/latex/refman.tex
314+
$>/mkdocs/anklang-cxx.pdf: $>/doxygen/latex/refman.tex | $>/mkdocs/
315+
@$(QGEN)
316+
$Q cd $>/doxygen/latex/ && $(MAKE)
317+
$Q cp $>/doxygen/latex/refman.pdf $@
318+
$>/mkdocs/anklang-cxx.html: $>/doxygen/xml/index.xml | $>/mkdocs/
319+
@$(QGEN)
320+
$Q node_modules/.bin/moxygen -h -n -o $>/anklang-cxx.md $>/doxygen/xml/
321+
$Q pandoc $>/anklang-cxx.md -o $@ && rm -f $>/anklang-cxx.md
322+

doc/ch-appendix.md

Lines changed: 54 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,115 @@
1-
\appendix
2-
31
# Appendix
42

5-
&nbsp;
6-
73
## One-dimensional Cubic Interpolation
84

9-
\def\V#1{V_{#1}}
10-
11-
\def\W#1{W_{#1}}
12-
13-
\def\w#1{w_{#1}}
14-
15-
With four sample values $\V0$, $\V1$, $\V2$ and $\V3$, cubic interpolation approximates
16-
the curve segment connecting $\V1$ and $\V2$, by using the beginning and ending
5+
With four sample values $V_0$, $V_1$, $V_2$ and $V_3$, cubic interpolation approximates
6+
the curve segment connecting $V_1$ and $V_2$, by using the beginning and ending
177
slope, the curvature and the rate of curvature change to construct a cubic
188
polynomial.
199

2010

2111
The cubic polynomial starts out as:
2212

23-
(@a) $f(x) = \w3 x^3 + \w2 x^2 + \w1 x + \w0$
13+
* a) $f(x) = w_3 x^3 + w_2 x^2 + w_1 x + w_0$
2414

2515
Where $0 <= x <= 1$, specifying the sample value of the curve segment between
26-
$\V1$ and $\V2$ to obtain.
16+
$V_1$ and $V_2$ to obtain.
2717

28-
To calculate the coefficients $\w0,…,\w3$, we set out the following conditions:
18+
To calculate the coefficients $w_0…w_3$, we set out the following conditions:
2919

30-
(@b) $f(0) = \V1$
31-
(@c) $f(1) = \V2$
32-
(@d) $f'(0) = \V1'$
33-
(@e) $f'(1) = \V2'$
20+
* b) $f(0) = V_1$
21+
* c) $f(1) = V_2$
22+
* d) $f'(0) = V_1'$
23+
* e) $f'(1) = V_2'$
3424

35-
We obtain $\V1'$ and $\V2'$ from the respecting slope triangles:
25+
We obtain $V_1'$ and $V_2'$ from the respecting slope triangles:
3626

37-
(@f) $\V1' = \frac {\V2 - \V0} {2}$
38-
(@g) $\V2' = \frac {\V3 - \V1} {2}$
27+
* f) $V_1' = \frac {V_2 - V_0} {2}$
28+
* g) $V_2' = \frac {V_3 - V_1} {2}$
3929

40-
With (@f) → (@d) and (@g) → (@e) we get:
30+
With (f)→(d) and (g)→(e) we get:
4131

42-
(@h) $f'(0) = \frac {\V2 - \V0} {2}$
43-
(@i) $f'(1) = \frac {\V3 - \V1} {2}$
32+
* h) $f'(0) = \frac {V_2 - V_0} {2}$
33+
* i) $f'(1) = \frac {V_3 - V_1} {2}$
4434

4535
The derivation of $f(x)$ is:
4636

47-
(@j) $f'(x) = 3 \w3 x^2 + 2 \w2 x + \w1$
37+
* j) $f'(x) = 3 w_3 x^2 + 2 w_2 x + w_1$
38+
39+
From $x=0$ →(a), i.e. (b), we obtain $w_0$ and from $x=0$ →(j),
40+
i.e. (h), we obtain $w_1$. With $w_0$ and $w_1$ we can solve the
41+
linear equation system formed by (c)→(a) and (e)→(j)
42+
to obtain $w_2$ and $w_3$.
4843

49-
From $x=0$ → (@a), i.e. (@b), we obtain $\w0$ and from $x=0$ → (@j),
50-
i.e. (@h), we obtain $\w1$. With $\w0$ and $\w1$ we can solve the
51-
linear equation system formed by (@c) → (@a) and (@e) → (@j)
52-
to obtain $\w2$ and $\w3$.
44+
$(c)→(a): w_3 + w_2 + \frac {V_2 - V_0} {2} + V_1 = V_2$
5345

54-
(@c_a_)   (@c) → (@a):   $\w3 + \w2 + \frac {\V2 - \V0} {2} + \V1 = \V2$
55-
(@e_j_)   (@e) → (@j):   $3 \w3 + 2 \w2 + \frac {\V2 - \V0} {2} = \frac {\V3 - \V1} {2}$
46+
$(e)→(j): 3 w_3 + 2 w_2 + \frac {V_2 - V_0} {2} = \frac {V_3 - V_1} {2}$
5647

5748
With the resulting coefficients:
5849

5950
$$
6051
\begin{aligned}
61-
\w0 &= \V1 & &(initial\:value) \\
62-
\w1 &= \frac{\V2 - \V0} {2} & &(initial\:slope) \\
63-
\w2 &= \frac{-\V3 + 4 \V2 - 5 \V1 + 2 \V0} {2} & &(initial\:curvature) \\
64-
\w3 &= \frac{\V3 - 3 \V2 + 3 \V1 - \V0} {2} & &(rate\:change\:of\:curvature)
52+
w_0 &= V_1 & &(initial\:value) \\
53+
w_1 &= \frac{V_2 - V_0} {2} & &(initial\:slope) \\
54+
w_2 &= \frac{-V_3 + 4 V_2 - 5 V_1 + 2 V_0} {2} & &(initial\:curvature) \\
55+
w_3 &= \frac{V_3 - 3 V_2 + 3 V_1 - V_0} {2} & &(rate\:change\:of\:curvature)
6556
\end{aligned}
6657
$$
6758

68-
Reformulating (@a) to involve just multiplications and additions (eliminating power), we get:
59+
Reformulating (a) to involve just multiplications and additions (eliminating power), we get:
6960

70-
(@k) $f(x) = ((\w3 x + \w2) x + \w1) x + \w0$
61+
* k) $f(x) = ((w_3 x + w_2) x + w_1) x + w_0$
7162

72-
Based on $\V0,…,\V3$, $\w0,…,\w3$ and (@k), we can now approximate all values of the
73-
curve segment between $\V1$ and $\V2$.
63+
Based on $V_0…V_3$, $w_0…w_3$ and (k), we can now approximate all values of the
64+
curve segment between $V_1$ and $V_2$.
7465

7566
However, for practical resampling applications where only a specific
7667
precision is required, the number of points we need out of the curve
7768
segment can be reduced to a finite amount.
7869
Lets assume we require $n$ equally spread values of the curve segment,
79-
then we can precalculate $n$ sets of $\W{0,…,3}[i]$, $i=[0,…,n]$, coefficients
70+
then we can precalculate $n$ sets of $W_{0…3}[i]$, $i=[0n]$, coefficients
8071
to speed up the resampling calculation, trading memory for
81-
computational performance. With $\w{0,…,3}$ in (@a):
72+
computational performance. With $w_{0…3}$ in (a):
8273

8374
$$
8475
\begin{alignedat} {2}
85-
f(x) \ &= & \frac{\V3 - 3 \V2 + 3 \V1 - \V0} 2 x^3 \ + & \\
86-
& & \frac{-\V3 + 4 \V2 - 5 \V1 + 2 \V0} 2 x^2 \ + & \\
87-
& & \frac{\V2 - \V0} 2 x \ + & \\
88-
& & V1 \ \ &
76+
f(x) \ &= & \frac{V_3 - 3 V_2 + 3 V_1 - V_0} 2 x^3 \ + & \\
77+
& & \frac{-V_3 + 4 V_2 - 5 V_1 + 2 V_0} 2 x^2 \ + & \\
78+
& & \frac{V_2 - V_0} 2 x \ + & \\
79+
& & V1 \ \ \ \ &
8980
\end{alignedat}
9081
$$
9182

92-
sorted for $\V0,…,\V4$, we have:
83+
sorted for $V_0…V_4$, we have:
9384

94-
(@l) $$\begin{aligned}
95-
f(x) \ = \ & \V3 \ (0.5 x^3 - 0.5 x^2) \ + & \\
96-
& \V2 \ (-1.5 x^3 + 2 x^2 + 0.5 x) \ + & \\
97-
& \V1 \ (1.5 x^3 - 2.5 x^2 + 1) \ + & \\
98-
& \V0 \ (-0.5 x^3 + x^2 - 0.5 x) &
99-
\end{aligned}$$
85+
* l) $\begin{aligned}
86+
f(x) \ = \ & V_3 \ (0.5 x^3 - 0.5 x^2) \ + & \\
87+
& V_2 \ (-1.5 x^3 + 2 x^2 + 0.5 x) \ + & \\
88+
& V_1 \ (1.5 x^3 - 2.5 x^2 + 1) \ + & \\
89+
& V_0 \ (-0.5 x^3 + x^2 - 0.5 x) &
90+
\end{aligned}$
10091

101-
With (@l) we can solve $f(x)$ for all $x = \frac i n$, where $i = [0, 1, 2, …, n]$ by
92+
With (l) we can solve $f(x)$ for all $x = \frac i n$, where $i = [0, 1, 2, …, n]$ by
10293
substituting $g(i) = f(\frac i n)$ with
10394

104-
(@m) $g(i) = \V3 \W3[i] + \V2 \W2[i] + \V1 \W1[i] + \V0 \W0[i]$
95+
* m) $g(i) = V_3 W_3[i] + V_2 W_2[i] + V_1 W_1[i] + V_0 W_0[i]$
10596

106-
and using $n$ precalculated coefficients $\W{0,…,3}$ according to:
97+
and using $n$ precalculated coefficients $W_{0…3}$ according to:
10798

10899
$$
109100
\begin{alignedat}{4}
110101
m &= \frac i n \\
111-
\W3[i] &=& 0.5 m^3 & - & 0.5 m^2 & & \\
112-
\W2[i] &=& -1.5 m^3 & + & 2 m^2 & + 0.5 m & \\
113-
\W1[i] &=& 1.5 m^3 & - & 2.5 m^2 & & + 1 \\
114-
\W0[i] &=& -0.5 m^3 & + & m^2 & - 0.5 m &
102+
W_3[i] &=& 0.5 m^3 & - & 0.5 m^2 & & \\
103+
W_2[i] &=& -1.5 m^3 & + & 2 m^2 & + 0.5 m & \\
104+
W_1[i] &=& 1.5 m^3 & - & 2.5 m^2 & & + 1 \\
105+
W_0[i] &=& -0.5 m^3 & + & m^2 & - 0.5 m &
115106
\end{alignedat}
116107
$$
117108

118-
We now need to setup $\W{0,…,3}[0,…,n]$ only once, and are then able to
109+
We now need to setup $W_{0…3}[0n]$ only once, and are then able to
119110
obtain up to $n$ approximation values of the curve segment between
120-
$\V1$ and $\V2$ with four multiplications and three additions using (@m),
121-
given $\V0,…,\V3$.
111+
$V_1$ and $V_2$ with four multiplications and three additions using (m),
112+
given $V_0…V_3$.
122113

123114

124115
## Modifier Keys
@@ -141,7 +132,6 @@ none → copy (else move (else link))
141132

142133
Regarding selections, the following email provides a short summary:
143134

144-
> ~~~
145135
> From: Tim Janik <[email protected]>
146136
> To: Hacking Gnomes <[email protected]>
147137
> Subject: modifiers for the second selection
@@ -201,4 +191,3 @@ Regarding selections, the following email provides a short summary:
201191
>
202192
> ---
203193
> ciaoTJ
204-
> ~~~

doc/ch-editing.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)