Compare commits

..

30 Commits

Author SHA1 Message Date
26410655d9 fix: tikz svgs
All checks were successful
build / build (push) Successful in 43s
Fixes #9
2026-03-05 15:09:37 -07:00
faa84f986d doc: doerg-temml-worker
All checks were successful
build / build (push) Successful in 1m24s
2026-03-05 11:47:59 -07:00
9ec8bca383 feat: warning message on timeout
All checks were successful
build / build (push) Successful in 40s
2026-03-05 09:52:29 -07:00
d946c57bff Merge pull request 'fix: namespace error lol' (#8) from ns-error into main
All checks were successful
build / build (push) Successful in 4s
Reviewed-on: #8
2026-03-05 09:49:24 -07:00
7c4ad64d58 fix: increase snippet timeout to 20s
All checks were successful
build / build (push) Successful in 5s
2026-03-05 09:49:04 -07:00
56742cf72d fix: namespace error lol
Some checks failed
build / build (push) Failing after 1m1s
2026-03-05 09:36:49 -07:00
a92b387e63 refactor: more.
Some checks failed
build / build (push) Failing after 3h13m17s
2026-03-02 15:18:35 -07:00
98c106b3cf fix: trim temml/render input 2026-03-02 15:17:57 -07:00
b336aa873e refactor: more cleanup >_<
Some checks failed
build / build (push) Has been cancelled
2026-03-02 14:59:11 -07:00
e49f847f20 refactor: move texslop into tex module
Some checks failed
build / build (push) Has been cancelled
2026-03-02 14:53:07 -07:00
ec4ad7c9c2 fix: set doerg-parser in config 2026-03-02 14:12:52 -07:00
762324d9f0 fix: config spec 2026-03-02 14:06:50 -07:00
c97b7ab0dc chore: clean doerg sources
All checks were successful
build / build (push) Successful in 5s
2026-03-01 12:18:14 -07:00
c45852097b chore: package.nix → default.nix
All checks were successful
build / build (push) Successful in 5s
2026-03-01 12:08:21 -07:00
74e48264ea chore: clean up serialise
Some checks failed
build / build (push) Has been cancelled
2026-03-01 11:56:06 -07:00
283c18fd9e chore: remove demo action
All checks were successful
build / build (push) Successful in 4s
2026-03-01 11:52:58 -07:00
570fca833d Merge pull request 'tex' (#7) from tex into main
All checks were successful
build / build (push) Successful in 4s
Gitea Actions Demo / build (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1s
Reviewed-on: #7
2026-03-01 11:50:07 -07:00
eb53516a2d feat: build on push
All checks were successful
build / build (push) Successful in 57s
Gitea Actions Demo / build (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1s
2026-03-01 11:46:40 -07:00
8b2fb7a010 refactor: rename doerg-tex → doerg-temml-worker 2026-03-01 11:46:22 -07:00
6ef81a4a45 fix: nix stuff and config 2026-03-01 11:46:22 -07:00
17e61aabc8 fix: config spec 2026-03-01 11:46:22 -07:00
c34b239d01 feat: kaocha 2026-03-01 11:46:22 -07:00
de96a6245b fix: align display math 2026-03-01 11:46:22 -07:00
c077186c10 feat: tests 2026-03-01 11:46:22 -07:00
c0a69bdbed feat: to-html 2026-03-01 11:44:13 -07:00
99bf9aae03 refactor: split tex modules 2026-03-01 11:44:13 -07:00
18350f6600 fix: render-temml 2026-03-01 11:44:13 -07:00
5c92dc153c fix: temml css 2026-03-01 11:44:13 -07:00
66586e6239 refactor: split up render-temml 2026-03-01 11:44:13 -07:00
49990228c9 feat: xelatex rendering 2026-03-01 11:44:02 -07:00
33 changed files with 806 additions and 198 deletions

View File

@@ -0,0 +1,11 @@
name: build
on: [push]
jobs:
build:
runs-on: nixos
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: build doerg
run: nix build -L .#doerg

View File

@@ -10,6 +10,16 @@
} }
], ],
"mvn-deps": [ "mvn-deps": [
{
"mvn-path": "aero/aero/1.1.6/aero-1.1.6.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-9LCpJy2lDICRxVKcn+NVxHI08e65X+kiluLCP3h/PSI="
},
{
"mvn-path": "aero/aero/1.1.6/aero-1.1.6.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-WUXPjq14D3SX6G8piWPyeGgdUZrpshvpSfrFQg8F01A="
},
{ {
"mvn-path": "babashka/fs/0.5.24/fs-0.5.24.jar", "mvn-path": "babashka/fs/0.5.24/fs-0.5.24.jar",
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
@@ -40,6 +50,31 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-LVp6g6ymqHa1ZOMHYD0CRaNxZ4osT0xoEH7dC5sLv7s=" "hash": "sha256-LVp6g6ymqHa1ZOMHYD0CRaNxZ4osT0xoEH7dC5sLv7s="
}, },
{
"mvn-path": "ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-mMPxj10NZCzV8yfMckVmzRlklibH2I9wFDvXBMlBV9U="
},
{
"mvn-path": "ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Ond3RjIf1uIuOMzf1PY0vKNysA7mIAPlJ/aqRkkF8+g="
},
{
"mvn-path": "ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-R8D9NCmV0zFbj6zKzDJLKnYUOyfEMNSy1qKeq8MfXBQ="
},
{
"mvn-path": "ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-ziBX5rWqOWLWyNtAxJ6LzhFQqaobNhXtS6b1I9O5pwA="
},
{
"mvn-path": "ch/qos/logback/logback-parent/1.1.3/logback-parent-1.1.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-ag4n7GeP9dkLjMZku0UZifXitbMAamW95Lld7BmHOHE="
},
{ {
"mvn-path": "cheshire/cheshire/6.1.0/cheshire-6.1.0.jar", "mvn-path": "cheshire/cheshire/6.1.0/cheshire-6.1.0.jar",
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
@@ -125,6 +160,26 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-dXkdZHooK97QEyeXodFSC942EiB9B8MlHUNZlbH8nvI=" "hash": "sha256-dXkdZHooK97QEyeXodFSC942EiB9B8MlHUNZlbH8nvI="
}, },
{
"mvn-path": "com/nextjournal/beholder/1.0.2/beholder-1.0.2.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-iQOMTbidIDu1sSpfsa2qkpXgWirEsk+u2ZbJNOqJ0Xo="
},
{
"mvn-path": "com/nextjournal/beholder/1.0.2/beholder-1.0.2.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-LRJkSGdQPfLoeGjLwU3deFKoaum2dW/QJ46lCK0d4u4="
},
{
"mvn-path": "com/rpl/specter/1.1.6/specter-1.1.6.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-vqmD19/KmPN99xUGxINR1L2PzgwiUEoa+da1r39BE9U="
},
{
"mvn-path": "com/rpl/specter/1.1.6/specter-1.1.6.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-2Fv7Xf/j/e+vS9pjGOyCkOyQEqA+0rzjZzo3p4T2WmU="
},
{ {
"mvn-path": "com/unboundid/unboundid-ldapsdk/5.1.1/unboundid-ldapsdk-5.1.1.jar", "mvn-path": "com/unboundid/unboundid-ldapsdk/5.1.1/unboundid-ldapsdk-5.1.1.jar",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -185,6 +240,36 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-2OgLA0KFMl6QX1RkmhWYtoe5pKmaOk9LlO7TWXyyEEg=" "hash": "sha256-2OgLA0KFMl6QX1RkmhWYtoe5pKmaOk9LlO7TWXyyEEg="
}, },
{
"mvn-path": "expound/expound/0.9.0/expound-0.9.0.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-1qNyYJkY4DUb+mqL1pPRi8GZ6Lp6r67BHola+uAY+Vw="
},
{
"mvn-path": "expound/expound/0.9.0/expound-0.9.0.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-kJSODD3MvE8aCvaABWue2JizAcvtLd4/9CR5eWmXxdk="
},
{
"mvn-path": "fipp/fipp/0.6.27/fipp-0.6.27.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-qK1dAlan2r+90UOm6QvnZXURhA/is4MMp9tnK20RDPc="
},
{
"mvn-path": "fipp/fipp/0.6.27/fipp-0.6.27.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-ugagpDW5XBNQMTr+1z3s6r5TXwbF/pw6Ffrcc4Tzlvk="
},
{
"mvn-path": "hawk/hawk/0.2.11/hawk-0.2.11.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-6UPy8MSHxsWmsg5wzpHdXzHkBIlXCRe7oT/OpzyaekM="
},
{
"mvn-path": "hawk/hawk/0.2.11/hawk-0.2.11.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-q4PzoWHUY53W2TZWihPpw+qXB4QWWVnS1iW3WlvIxFg="
},
{ {
"mvn-path": "hiccup/hiccup/2.0.0-RC4/hiccup-2.0.0-RC4.jar", "mvn-path": "hiccup/hiccup/2.0.0-RC4/hiccup-2.0.0-RC4.jar",
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
@@ -215,6 +300,56 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-7Vh2tzj7zXYdGd03xiyTExP/beuWSi8Nn1NmRKkw9bQ=" "hash": "sha256-7Vh2tzj7zXYdGd03xiyTExP/beuWSi8Nn1NmRKkw9bQ="
}, },
{
"mvn-path": "io/methvin/directory-watcher/0.17.3/directory-watcher-0.17.3.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-BSPdOKOTpjt15DIP9SMDSgrDzqaX9hUaesiok8MiUx4="
},
{
"mvn-path": "io/methvin/directory-watcher/0.17.3/directory-watcher-0.17.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Y/C4zR1No0m2Dfk4kdHgDF0/0sm9M9jlvu0HWijNiFQ="
},
{
"mvn-path": "lambdaisland/clj-diff/1.4.78/clj-diff-1.4.78.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-oovG5LKVI8wppHLlfm6rlYD6DQNorXvliypH6JGhRZw="
},
{
"mvn-path": "lambdaisland/clj-diff/1.4.78/clj-diff-1.4.78.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-2QZ6mFjx7+UGI232PUr3CzsQenqd+xcRsbqEpxs32w0="
},
{
"mvn-path": "lambdaisland/deep-diff2/2.12.219/deep-diff2-2.12.219.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-BkOq5C/7omo09wyTTg7nkBi6GWBmlayVsPa9mrDvCyU="
},
{
"mvn-path": "lambdaisland/deep-diff2/2.12.219/deep-diff2-2.12.219.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-rW/85js2hSWVc36e2BcTRmkahJHc2TjGIEfvForuToY="
},
{
"mvn-path": "lambdaisland/kaocha/1.91.1392/kaocha-1.91.1392.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-W7EV1MqxeIVqyTyt6lV9vpZrLRc+TWQKnmNfiPoieug="
},
{
"mvn-path": "lambdaisland/kaocha/1.91.1392/kaocha-1.91.1392.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-p6+0cuuFYlJU5YlhGIbnuHt1d6yOZXx/FhwAM6wCyzg="
},
{
"mvn-path": "lambdaisland/tools.namespace/0.3.256/tools.namespace-0.3.256.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-jt141ljkjv97etTTE995zZnqiZfoFnyt0g2hwmuOU8M="
},
{
"mvn-path": "lambdaisland/tools.namespace/0.3.256/tools.namespace-0.3.256.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-n+46BXjy57A8898EXgyplEyyqf/S5qocf140ZbglV64="
},
{ {
"mvn-path": "medley/medley/1.4.0/medley-1.4.0.jar", "mvn-path": "medley/medley/1.4.0/medley-1.4.0.jar",
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
@@ -225,6 +360,56 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-JhEgB4cMXujVcrvDw4n8a9bMZG1cUAdfbolYQMWGEMA=" "hash": "sha256-JhEgB4cMXujVcrvDw4n8a9bMZG1cUAdfbolYQMWGEMA="
}, },
{
"mvn-path": "meta-merge/meta-merge/1.0.0/meta-merge-1.0.0.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-1/7i4+PXBuDlRWLnKqNxIQjXAYahLLwJDhBoBYLrAsc="
},
{
"mvn-path": "meta-merge/meta-merge/1.0.0/meta-merge-1.0.0.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-sAogZY/OzCvRNBAx85T1LWjFP7SAxEVBNMyqwgTqWTE="
},
{
"mvn-path": "mvxcvi/arrangement/2.1.0/arrangement-2.1.0.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-83JROF0iDfiVHmjVJVq7UZetvL2PxrPT/KhyojOfOcg="
},
{
"mvn-path": "mvxcvi/arrangement/2.1.0/arrangement-2.1.0.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-fWiMhmYYFAo78Am00FcK7acJA0h7dlH7VNBHf5TT2Is="
},
{
"mvn-path": "mvxcvi/clj-cbor/1.1.1/clj-cbor-1.1.1.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-XqYtfq4Seg2W6Favuh2Ogm2TrZfFCgEFNvsekCgX4I8="
},
{
"mvn-path": "mvxcvi/clj-cbor/1.1.1/clj-cbor-1.1.1.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-SzmvI+F2QOnCPH5H6OKH124pbohIazXgPG3PhqH0VZA="
},
{
"mvn-path": "net/incongru/watchservice/barbary-watchservice/1.0/barbary-watchservice-1.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-VMbKvYIJPIUV9uFOQ9lL/n6fx5XRV4nzlDoUGNgmOrU="
},
{
"mvn-path": "net/incongru/watchservice/barbary-watchservice/1.0/barbary-watchservice-1.0.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-k7OxHaltUXiIDfjFBT8Yz8eByv8Nnd9LPGRyRKnRws8="
},
{
"mvn-path": "net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-kagUrE9A1g3ukdhC4aith0xiGXmEQD0OPDDTnlXPU7M="
},
{
"mvn-path": "net/java/dev/jna/jna/5.12.1/jna-5.12.1.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Zf8lhJuthZVUtQMXeS9Wia20UprkAx6aUkYxnLK4U1Y="
},
{ {
"mvn-path": "org/apache/apache/23/apache-23.pom", "mvn-path": "org/apache/apache/23/apache-23.pom",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -282,62 +467,62 @@
}, },
{ {
"mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.jar", "mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-fxJHLa7Y9rUXSYqqKrE6ViR1w+31FHjkWBzHYemJeaM=" "hash": "sha256-fxJHLa7Y9rUXSYqqKrE6ViR1w+31FHjkWBzHYemJeaM="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.pom", "mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-GJwAxDNAdJai+7DsyzeQjJSVXZHq0b5IFWdE7MGBbZQ=" "hash": "sha256-GJwAxDNAdJai+7DsyzeQjJSVXZHq0b5IFWdE7MGBbZQ="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.0/clojure-1.11.0.jar", "mvn-path": "org/clojure/clojure/1.11.0/clojure-1.11.0.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-PiH6daB+yd278bK1A1bPGAcQ0DmN6qT0TpHNYwRVWUc=" "hash": "sha256-PiH6daB+yd278bK1A1bPGAcQ0DmN6qT0TpHNYwRVWUc="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.0/clojure-1.11.0.pom", "mvn-path": "org/clojure/clojure/1.11.0/clojure-1.11.0.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-SQjMS0yeYsmoFJb5PLWsb2lBd8xkXc87jOXkkavOHro=" "hash": "sha256-SQjMS0yeYsmoFJb5PLWsb2lBd8xkXc87jOXkkavOHro="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.1/clojure-1.11.1.jar", "mvn-path": "org/clojure/clojure/1.11.1/clojure-1.11.1.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-I4G26UI6tGUVFFWUSQPROlYkPWAGuRlK/Bv0+HEMtN4=" "hash": "sha256-I4G26UI6tGUVFFWUSQPROlYkPWAGuRlK/Bv0+HEMtN4="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.1/clojure-1.11.1.pom", "mvn-path": "org/clojure/clojure/1.11.1/clojure-1.11.1.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-IMRaGr7b2L4grvk2BQrjGgjBZ0CzL4dAuIOM3pb/y4o=" "hash": "sha256-IMRaGr7b2L4grvk2BQrjGgjBZ0CzL4dAuIOM3pb/y4o="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.2/clojure-1.11.2.jar", "mvn-path": "org/clojure/clojure/1.11.2/clojure-1.11.2.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-iPqZkT1pIs+39kn1xGdQOHfLb8yMwW02948mSAhLqZc=" "hash": "sha256-iPqZkT1pIs+39kn1xGdQOHfLb8yMwW02948mSAhLqZc="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.2/clojure-1.11.2.pom", "mvn-path": "org/clojure/clojure/1.11.2/clojure-1.11.2.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-FzbP/xCV4dT+/raogrut9ttB7+MV8pbw/aMtt//EExE=" "hash": "sha256-FzbP/xCV4dT+/raogrut9ttB7+MV8pbw/aMtt//EExE="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.3/clojure-1.11.3.jar", "mvn-path": "org/clojure/clojure/1.11.3/clojure-1.11.3.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-nDBUCTKOK5boXdK160t1gQxnt2unCuTQ9t3pvPtVsbc=" "hash": "sha256-nDBUCTKOK5boXdK160t1gQxnt2unCuTQ9t3pvPtVsbc="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.3/clojure-1.11.3.pom", "mvn-path": "org/clojure/clojure/1.11.3/clojure-1.11.3.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-DA2+Ge4NKpxXMQzr3dNWRD8NFlFMQmBHsGLjpXwNuK0=" "hash": "sha256-DA2+Ge4NKpxXMQzr3dNWRD8NFlFMQmBHsGLjpXwNuK0="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.4/clojure-1.11.4.jar", "mvn-path": "org/clojure/clojure/1.11.4/clojure-1.11.4.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-/H/xtmENDjSUp1zBHvgYEL2kAqwVcBL+TjuJlYbPQTM=" "hash": "sha256-/H/xtmENDjSUp1zBHvgYEL2kAqwVcBL+TjuJlYbPQTM="
}, },
{ {
"mvn-path": "org/clojure/clojure/1.11.4/clojure-1.11.4.pom", "mvn-path": "org/clojure/clojure/1.11.4/clojure-1.11.4.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-a6YADmhI+Cw5y5tJqyqmo6Vi9MJNUrMeUZCuZJXwwwk=" "hash": "sha256-a6YADmhI+Cw5y5tJqyqmo6Vi9MJNUrMeUZCuZJXwwwk="
}, },
{ {
@@ -350,6 +535,46 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-KfRiqonLl2RXWEGKXwjUwagrc1yW569JgX0WqpuQgVA=" "hash": "sha256-KfRiqonLl2RXWEGKXwjUwagrc1yW569JgX0WqpuQgVA="
}, },
{
"mvn-path": "org/clojure/clojure/1.12.1/clojure-1.12.1.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-h+7qnjVdhsBFc4r0lNaD4J6RTLBGeuQNRqZrh6NsctQ="
},
{
"mvn-path": "org/clojure/clojure/1.12.1/clojure-1.12.1.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-JUvpyKuMzDArR9fFaj/KEUl+WcMFvxX6YFTD3/TrkZ0="
},
{
"mvn-path": "org/clojure/clojure/1.12.2/clojure-1.12.2.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-pYv4B+zv7K6iIri4tH4UNo7o4yy0VAs//v/4yglTSA0="
},
{
"mvn-path": "org/clojure/clojure/1.12.2/clojure-1.12.2.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-55suCRfnPnPCX7N5PzFV+PD4jYAvUMJf1Sl3l3rDQiA="
},
{
"mvn-path": "org/clojure/clojure/1.12.3/clojure-1.12.3.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-yyoaPbHCzXbvT6SlRdWmXxCxtIt/dnLwoQn1R28FcWY="
},
{
"mvn-path": "org/clojure/clojure/1.12.3/clojure-1.12.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-q2CmyyuMxXyG21ECte4p8hWsg8/20wEblV+fxb5dAZ0="
},
{
"mvn-path": "org/clojure/clojure/1.12.4/clojure-1.12.4.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-S4Hpum2jjEXZzFgCPGdAYrjJ8HFPM/8A3tIuapSdoXc="
},
{
"mvn-path": "org/clojure/clojure/1.12.4/clojure-1.12.4.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-xRh5Bi5B/58hr6DkCbGZ/+nyo8aucizf7F/Z26BeQXI="
},
{ {
"mvn-path": "org/clojure/core.match/1.1.0/core.match-1.1.0.jar", "mvn-path": "org/clojure/core.match/1.1.0/core.match-1.1.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -360,24 +585,34 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-NnHYN2UlIwq6Ah8fYmx54g86ELYrXfgXIiWJDsSv4EU=" "hash": "sha256-NnHYN2UlIwq6Ah8fYmx54g86ELYrXfgXIiWJDsSv4EU="
}, },
{
"mvn-path": "org/clojure/core.rrb-vector/0.2.0/core.rrb-vector-0.2.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-ftqNXGlaxVNp3NTHN4YUMhdXuBAoG//KMMss02PRZZQ="
},
{
"mvn-path": "org/clojure/core.rrb-vector/0.2.0/core.rrb-vector-0.2.0.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-t+0/8ZfxrdZOHvJS2zRY8wlhPcZXdejY4OkTlx4CRY4="
},
{ {
"mvn-path": "org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar", "mvn-path": "org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-/PRCveArBKhj8vzFjuaiowxM8Mlw99q4VjTwq3ERZrY=" "hash": "sha256-/PRCveArBKhj8vzFjuaiowxM8Mlw99q4VjTwq3ERZrY="
}, },
{ {
"mvn-path": "org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.pom", "mvn-path": "org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-AarxdIP/HHSCySoHKV1+e8bjszIt9EsptXONAg/wB0A=" "hash": "sha256-AarxdIP/HHSCySoHKV1+e8bjszIt9EsptXONAg/wB0A="
}, },
{ {
"mvn-path": "org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar", "mvn-path": "org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Bu6owHC75FwVhWfkQ0OWgbyMRukSNBT4G/oyukLWy8g=" "hash": "sha256-Bu6owHC75FwVhWfkQ0OWgbyMRukSNBT4G/oyukLWy8g="
}, },
{ {
"mvn-path": "org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.pom", "mvn-path": "org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-F3i70Ti9GFkLgFS+nZGdG+toCfhbduXGKFtn1Ad9MA4=" "hash": "sha256-F3i70Ti9GFkLgFS+nZGdG+toCfhbduXGKFtn1Ad9MA4="
}, },
{ {
@@ -390,6 +625,16 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-M0EOuKpz1S2Vez3G4KZfOZisBiPL2BPZDDPm5onEJCk=" "hash": "sha256-M0EOuKpz1S2Vez3G4KZfOZisBiPL2BPZDDPm5onEJCk="
}, },
{
"mvn-path": "org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-wU4OEDBKXlz9LMdC+976wfUpPuxgcML/6JA/tcf+fW8="
},
{
"mvn-path": "org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-C+AThRRX/CTENM5FU0ZD8iblwQgASGJT/Tc/LglUXig="
},
{ {
"mvn-path": "org/clojure/java.data/1.3.113/java.data-1.3.113.jar", "mvn-path": "org/clojure/java.data/1.3.113/java.data-1.3.113.jar",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -405,9 +650,14 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-RoC9g43MuowXwlgXE0fxb1uq5rXft4Grc4K8Y4X/gAY=" "hash": "sha256-RoC9g43MuowXwlgXE0fxb1uq5rXft4Grc4K8Y4X/gAY="
}, },
{
"mvn-path": "org/clojure/pom.contrib/0.2.2/pom.contrib-0.2.2.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-4OoifEnFw+MHVM0m/MV75+Telz/kOqXMZmdAHsXBAyM="
},
{ {
"mvn-path": "org/clojure/pom.contrib/0.3.0/pom.contrib-0.3.0.pom", "mvn-path": "org/clojure/pom.contrib/0.3.0/pom.contrib-0.3.0.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-fxgrOypUPgV0YL+T/8XpzvasUn3xoTdqfZki6+ee8Rk=" "hash": "sha256-fxgrOypUPgV0YL+T/8XpzvasUn3xoTdqfZki6+ee8Rk="
}, },
{ {
@@ -427,22 +677,22 @@
}, },
{ {
"mvn-path": "org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar", "mvn-path": "org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-z2iZ+YUpjGSxPqEplGrZAo3uja3w6rmuGORVAn04JJw=" "hash": "sha256-z2iZ+YUpjGSxPqEplGrZAo3uja3w6rmuGORVAn04JJw="
}, },
{ {
"mvn-path": "org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.pom", "mvn-path": "org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-WhHw4eizwFLmUcSYxpRbRNs1Nb8sGHGf3PZd8fiLE+Y=" "hash": "sha256-WhHw4eizwFLmUcSYxpRbRNs1Nb8sGHGf3PZd8fiLE+Y="
}, },
{ {
"mvn-path": "org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar", "mvn-path": "org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Z+yJjrVcZqlXpVJ53YXRN2u5lL2HZosrDeHrO5foquA=" "hash": "sha256-Z+yJjrVcZqlXpVJ53YXRN2u5lL2HZosrDeHrO5foquA="
}, },
{ {
"mvn-path": "org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.pom", "mvn-path": "org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.pom",
"mvn-repo": "https://repo.maven.apache.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-bY3hTDrIdXYMX/kJVi/5hzB3AxxquTnxyxOeFp/pB1g=" "hash": "sha256-bY3hTDrIdXYMX/kJVi/5hzB3AxxquTnxyxOeFp/pB1g="
}, },
{ {
@@ -465,6 +715,16 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-UZ45jnJMYvCsnWsZ15+P8QAdqYWD/eAb1wUrB+Ga1ow=" "hash": "sha256-UZ45jnJMYvCsnWsZ15+P8QAdqYWD/eAb1wUrB+Ga1ow="
}, },
{
"mvn-path": "org/clojure/tools.cli/1.1.230/tools.cli-1.1.230.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-kWYwtTmkP/RotN0BbGKFfitMtdpmhvEpdYfN1DyhAs0="
},
{
"mvn-path": "org/clojure/tools.cli/1.1.230/tools.cli-1.1.230.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-v7Yh5LAaW4vOEWpgcIQNzdWUnomceEaNgRtuiqqf0cc="
},
{ {
"mvn-path": "org/clojure/tools.logging/1.3.0/tools.logging-1.3.0.jar", "mvn-path": "org/clojure/tools.logging/1.3.0/tools.logging-1.3.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -485,6 +745,16 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-cGCU9H2ljugXofq5uAwxLs0nZHK85uHVRCOfFAcR2zE=" "hash": "sha256-cGCU9H2ljugXofq5uAwxLs0nZHK85uHVRCOfFAcR2zE="
}, },
{
"mvn-path": "org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-EdGzHyxlwzVbKSu5tEuPyv2lS0TaY+NKuXt5qKs7uOA="
},
{
"mvn-path": "org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-rvXugot8sUocWPRbn4oQ/zQMV2mSXqDvXDXR5J2SC+o="
},
{ {
"mvn-path": "org/junit/junit-bom/5.11.0/junit-bom-5.11.0.pom", "mvn-path": "org/junit/junit-bom/5.11.0/junit-bom-5.11.0.pom",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -530,11 +800,51 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-oLLU3iXdPWNptThQLeay5UJcKxyOM6GQKZgIS4o4EWs=" "hash": "sha256-oLLU3iXdPWNptThQLeay5UJcKxyOM6GQKZgIS4o4EWs="
}, },
{
"mvn-path": "org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-0+9XXj5JeWeNwBvx3M5RAhSTtNEft/G+itmCh3wWocA="
},
{
"mvn-path": "org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-+wRqnCKUN5KLsRwtJ8i113PriiXmDL0lPZhSEN7cJoQ="
},
{
"mvn-path": "org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-aZgMA4yhsTGSZWFZFhfZwl+r/Hspgor5FZfKhXDPNf4="
},
{
"mvn-path": "org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-NTkEp6bCgwTQ3KyA+tMMSM2Jj22wO5PwWtbJDdQtmK0="
},
{
"mvn-path": "org/slf4j/slf4j-parent/1.7.36/slf4j-parent-1.7.36.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-uziNN/vN083mTDzt4hg4aTIY3EUfBAQMXfNgp47X6BI="
},
{
"mvn-path": "org/slf4j/slf4j-parent/1.7.7/slf4j-parent-1.7.7.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Hf+uPOdo0FR+JhyWiYz12dGUv/1WAPWXyXUcxqc9M9Q="
},
{ {
"mvn-path": "org/sonatype/oss/oss-parent/7/oss-parent-7.pom", "mvn-path": "org/sonatype/oss/oss-parent/7/oss-parent-7.pom",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ=" "hash": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ="
}, },
{
"mvn-path": "org/tcrawley/dynapath/1.1.0/dynapath-1.1.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-n8eqO+Y4XaOtIqBlJvFaXTNdnonUDzm/L5oA4Lu9iug="
},
{
"mvn-path": "org/tcrawley/dynapath/1.1.0/dynapath-1.1.0.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-5OPOTeIWKm8U9QjB0Nv0s9tsrBk5E+kVeAhcGLesJho="
},
{ {
"mvn-path": "org/xerial/sqlite-jdbc/3.47.1.0/sqlite-jdbc-3.47.1.0.jar", "mvn-path": "org/xerial/sqlite-jdbc/3.47.1.0/sqlite-jdbc-3.47.1.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
@@ -545,6 +855,26 @@
"mvn-repo": "https://repo1.maven.org/maven2/", "mvn-repo": "https://repo1.maven.org/maven2/",
"hash": "sha256-Z3XeNvNR9MdFCL/+qtZAIceVhx/ZRIXsdsPhduUwU7g=" "hash": "sha256-Z3XeNvNR9MdFCL/+qtZAIceVhx/ZRIXsdsPhduUwU7g="
}, },
{
"mvn-path": "progrock/progrock/0.1.2/progrock-0.1.2.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-Aln+tbAkduswC31k5UPrVM5Kw9yuU5gxDxZCdo/VPyo="
},
{
"mvn-path": "progrock/progrock/0.1.2/progrock-0.1.2.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-6rULcjyeeEkPWDy5n7HUa8KA/xH9X4Ujub7XamTq8CM="
},
{
"mvn-path": "riddley/riddley/0.1.12/riddley-0.1.12.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-OY9h+kgluPhskWrlgMfhM7fEd9C3Kn07KY04EDJ0C64="
},
{
"mvn-path": "riddley/riddley/0.1.12/riddley-0.1.12.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-At+3ryDvgcJTZQVfYCjoscwpBdCyaLuJzEKM2nIwo2U="
},
{ {
"mvn-path": "ring/ring-anti-forgery/1.4.0/ring-anti-forgery-1.4.0.jar", "mvn-path": "ring/ring-anti-forgery/1.4.0/ring-anti-forgery-1.4.0.jar",
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
@@ -610,6 +940,16 @@
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-HHmMD/cPNu7HwRubeajXYOBDYK1y9x9F9KhRytq2AQw=" "hash": "sha256-HHmMD/cPNu7HwRubeajXYOBDYK1y9x9F9KhRytq2AQw="
}, },
{
"mvn-path": "slingshot/slingshot/0.12.2/slingshot-0.12.2.jar",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-porCK/LqPNVM4023D9aYRNYx71SfZFDCeMMOb3nfY/M="
},
{
"mvn-path": "slingshot/slingshot/0.12.2/slingshot-0.12.2.pom",
"mvn-repo": "https://repo.clojars.org/",
"hash": "sha256-SrxOK5ppxzvTc+gy0/AOWQZ4Q/+DUe/V7rsfOCTbnFE="
},
{ {
"mvn-path": "tigris/tigris/0.1.2/tigris-0.1.2.jar", "mvn-path": "tigris/tigris/0.1.2/tigris-0.1.2.jar",
"mvn-repo": "https://repo.clojars.org/", "mvn-repo": "https://repo.clojars.org/",

61
doerg/default.nix Normal file
View File

@@ -0,0 +1,61 @@
{ mkCljBin
, callPackage
, lib
, doerg-parser
, doerg-temml-worker
, ibm-plex-web
, fake-git
, our-tex ? callPackage ./our-tex.nix {}
, makeWrapper
}:
let
# mkCljBin sans fake-git. We don't need it, and I don't want it in
# my dev shell.
mkCljBin' = args: (mkCljBin args).overrideAttrs (final: prev: {
nativeBuildInputs =
builtins.filter
# A possibly-sketchy predicate, lol.
(x: x != fake-git)
prev.nativeBuildInputs;
});
plex = ibm-plex-web.override {
families = [ "math" "serif" "sans" "sans-kr" ];
};
bin-path = lib.makeBinPath [
doerg-parser
our-tex
doerg-temml-worker
];
in mkCljBin' {
name = "net.deertopia/doerg";
version = "0.1.0";
projectSrc = lib.cleanSource ./.;
lockfile = ../deps-lock.json;
main-ns = "net.deertopia.doerg.main";
nativeBuildInputs = [
plex
makeWrapper
];
buildInputs = [
doerg-parser
doerg-temml-worker
plex
our-tex
];
nativeCheckInputs = [
doerg-parser
doerg-temml-worker
plex
our-tex
];
doCheck = true;
checkPhase = ''
clojure -M:test
'';
postInstall = ''
wrapProgram $out/bin/doerg \
--prefix PATH : ${bin-path}
'';
}

View File

@@ -8,5 +8,9 @@
hiccup/hiccup {:mvn/version "2.0.0-RC4"} hiccup/hiccup {:mvn/version "2.0.0-RC4"}
com.rpl/specter {:mvn/version "1.1.6"} com.rpl/specter {:mvn/version "1.1.6"}
lambdaisland/deep-diff2 {:mvn/version "2.12.219"} lambdaisland/deep-diff2 {:mvn/version "2.12.219"}
mvxcvi/clj-cbor {:mvn/version "1.1.1"}} mvxcvi/clj-cbor {:mvn/version "1.1.1"}
:paths ["src" "resources" "test"]} ch.qos.logback/logback-classic {:mvn/version "1.1.3"}}
:paths ["src" "resources" "test"]
:aliases
{:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}}
:main-opts ["-m" "kaocha.runner"]}}}

0
doerg/doerg-parser/index.js Normal file → Executable file
View File

View File

@@ -1,11 +1,17 @@
{ {
"name": "doerg-parser", "name": "doerg-parser",
"version": "0.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "doerg-parser",
"version": "0.1.0",
"dependencies": { "dependencies": {
"uniorg-parse": "^3.2.0" "uniorg-parse": "^3.2.0"
},
"bin": {
"doerg-parser": "index.js"
} }
}, },
"node_modules/@types/unist": { "node_modules/@types/unist": {

View File

@@ -0,0 +1,12 @@
#+title: doerg-temml-worker
This is a tiny Node script that is used by doerg. For each CBOR-encoded value on stdin (a "command"), a response value is spit to stdout.
Currently, the following commands are supported:
- Any string: Return the Temml-rendered MathML code as a string (inline).
- An array with a single string element: Return the Temml-rendered MathML code as a string (display).
If something goes wrong, either of these commands may return an object of form
#+begin_src json
{"type": "error"
,"error": «error object»}
#+end_src

View File

@@ -3,17 +3,19 @@
, makeWrapper , makeWrapper
, ibm-plex , ibm-plex
, callPackage , callPackage
, our-tex ? callPackage ./our-tex.nix {}
}: }:
buildNpmPackage { buildNpmPackage {
pname = "doerg-tex"; pname = "doerg-temml-worker";
version = "0.1.0"; version = "0.1.0";
src = ./.; src =
builtins.filterSource
(name: _file-type: ! builtins.elem name [
"deserialise.clj" "deps.edn" "default.nix"
"README.org" "serialise.clj" "node_modules"
])
./.;
npmDeps = importNpmLock { npmRoot = ./.; }; npmDeps = importNpmLock { npmRoot = ./.; };
npmConfigHook = importNpmLock.npmConfigHook; npmConfigHook = importNpmLock.npmConfigHook;
dontNpmBuild = true; dontNpmBuild = true;
buildInputs = [
our-tex
];
} }

View File

@@ -3,4 +3,4 @@
com.rpl/specter {:mvn/version "1.1.6"} com.rpl/specter {:mvn/version "1.1.6"}
mvxcvi/clj-cbor {:mvn/version "1.1.1"} mvxcvi/clj-cbor {:mvn/version "1.1.1"}
babashka/process {:mvn/version "0.6.25"}} babashka/process {:mvn/version "0.6.25"}}
:paths ["." "classes"]} :paths ["."]}

View File

@@ -1,4 +1,6 @@
(ns deserialise (ns deserialise
"A toy script for conveniently interfacing with doerg-temml-worker
during development."
(:require [clj-cbor.core :as cbor] (:require [clj-cbor.core :as cbor]
[clojure.string :as str])) [clojure.string :as str]))

View File

@@ -1,11 +1,11 @@
{ {
"name": "doerg-tex", "name": "doerg-temml-worker",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "doerg-tex", "name": "doerg-temml-worker",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"cbor-x": "^1.6.0", "cbor-x": "^1.6.0",
@@ -13,7 +13,7 @@
"temml": "^0.13.1" "temml": "^0.13.1"
}, },
"bin": { "bin": {
"doerg-tex": "index.js" "doerg-temml-worker": "index.js"
} }
}, },
"node_modules/@cbor-extract/cbor-extract-darwin-arm64": { "node_modules/@cbor-extract/cbor-extract-darwin-arm64": {

View File

@@ -1,6 +1,6 @@
{"dependencies":{"temml":"^0.13.1" {"dependencies":{"temml":"^0.13.1"
,"command-line-args":"^6.0.1" ,"command-line-args":"^6.0.1"
,"cbor-x":"^1.6.0"} ,"cbor-x":"^1.6.0"}
,"name":"doerg-tex" ,"name":"doerg-temml-worker"
,"version":"0.1.0" ,"version":"0.1.0"
,"bin":{"doerg-tex":"index.js"}} ,"bin":{"doerg-temml-worker":"index.js"}}

View File

@@ -1,4 +1,6 @@
(ns serialise (ns serialise
"A toy script for conveniently interfacing with doerg-temml-worker
during development."
(:require [clj-cbor.core :as cbor] (:require [clj-cbor.core :as cbor]
[clojure.string :as str])) [clojure.string :as str]))
@@ -8,12 +10,4 @@
(defn c [x] (defn c [x]
(->> x cbor/encode (map #(format "%02x" %)) (str/join " "))) (->> x cbor/encode (map #(format "%02x" %)) (str/join " ")))
#_
(w "\\naturalto")
(w "\\ifxetex blah \\fi") (w "\\ifxetex blah \\fi")
#_#_#_
(w "c = \\sqrt{a^2 + y^2}")
(w "c = \\sqrt{a^ + y^2")
(w "\\alpha^\\beta")

View File

@@ -1 +0,0 @@
#+title: doerg-tex

View File

@@ -39,5 +39,6 @@ texlive.combine {
collection-fontsrecommended # Essential fonts. collection-fontsrecommended # Essential fonts.
etoolbox # For Org-mode exports. etoolbox # For Org-mode exports.
caption caption
standalone
; ;
} }

View File

@@ -1,34 +0,0 @@
{ mkCljBin
, callPackage
, doerg-parser
, ibm-plex-web
, fake-git
}:
let
# mkCljBin sans fake-git.
mkCljBin' = args: (mkCljBin args).overrideAttrs (final: prev: {
nativeBuildInputs =
builtins.filter
# A possibly-sketchy predicate, lol.
(x: x != fake-git)
prev.nativeBuildInputs;
});
plex = ibm-plex-web.override {
families = [ "math" "serif" "sans" "sans-kr" ];
};
in mkCljBin' {
name = "net.deertopia/doerg";
version = "0.1.0";
projectSrc = ./.;
lockfile = ../deps-lock.json;
main-ns = "net.deertopia.doerg.main";
nativeBuildInputs = [
plex
];
buildInputs = [
doerg-parser
plex
];
}

View File

@@ -1,11 +1,56 @@
\documentclass{article} \documentclass[tikz,dvisvgm]{standalone}
\usepackage{amsmath}
\usepackage[active,tightpage,auctex,dvips]{preview} \usepackage[active,tightpage,auctex,dvips]{preview}
\usepackage{fontspec} \usepackage{amsmath}
\usepackage{amssymb}
\usepackage{ifxetex} \usepackage{ifxetex}
\usepackage{syd-plex} \usepackage{syd-plex}
\usepackage{quiver}
\usepackage{tikz}
\usepackage{amscd}
\newcommand{\catname}[1]{\textbf{#1}}
\newcommand{\C}[1]{\catname{#1}}
% Specific categories
\newcommand{\Set}{\catname{Set}}
\newcommand{\Cat}{\catname{Cat}}
\newcommand{\CAT}{\catname{CAT}}
\newcommand{\Grp}{\catname{Grp}}
% Common objects and functions
\newcommand{\Ob}{\operatorname{Ob}}
\newcommand{\op}{\text{op}}
\newcommand{\opof}[1]{{#1}^{\text{op}}}
% \id{x} is the identity morphism on x.
\newcommand{\id}[1]{1_{#1}}
% \Id{C} is the identity functor on C.
\newcommand{\Id}[1]{1_{#1}}
\newcommand{\Mor}{\operatorname{Mor}}
\newcommand{\homset}[3]{{{#1} \left[ {#2} \to {#3} \right]}}
% Constructions of categories.
\newcommand{\FunctorCategory}[2]{\left[#1, #2\right]}
\newcommand{\Funct}[2]{\FunctorCategory{#1}{#2}} % Deprecated.
\newcommand{\ArrowCategory}[1]{{#1}^\to}
% Semantic aliases
\newcommand{\monicto}{\rightarrowtail}
\newcommand{\epicto}{\twoheadrightarrow}
\newcommand{\naturalto}{\Rightarrow}
\newcommand{\isoto}{\cong}
\newcommand{\equivto}{\simeq}
\newcommand{\naturaltrans}[2]{#1 \naturalto #2} % Deprecated.
\newcommand{\horizontalcompose}{\ast}
% Optics
\newcommand{\opticname}[1]{\textbf{#1}}
\newcommand{\optic}[3]{\opticname{#1}^\prime\;#2\;#3}
\newcommand{\Optic}[5]{\opticname{#1}\;#2\;#3\;#4\;#5}
\begin{document} \begin{document}
\setlength\abovedisplayskip{0pt} \setlength\abovedisplayskip{0pt} % Remove padding before equation environments.
%% \color[rgb]{0.000,0.000,0.004}\special{dvisvgm:currentcolor on}\setcounter{equation}{0}%
% {{contents}} % {{contents}}
\end{document} \end{document}

View File

@@ -546,3 +546,13 @@ figure.fullwidth figcaption {
.latex-fragment .latex-fragment
{ fill: currentColor { fill: currentColor
} }
.latex-fragment.display-math
{ display: block
; width: 55%
/* Center it — do we want to do that? */
; align-items: center
; justify-content: center
; display: flex
; max-width: 55%
}

View File

@@ -4,16 +4,40 @@
[spec-dict.main :refer [dict]])) [spec-dict.main :refer [dict]]))
(s/def ::config (s/def ::config
(s/keys :req [::ibm-plex-web])) (s/keys :req [::ibm-plex-web
::latex
::dvisvgm
::doerg-temml-worker
::doerg-parser]))
(s/def ::file
#(or (instance? java.io.File %)
(string? %)))
(s/def ::executable #(or (fs/executable? %)
(and (fs/relative? %)
(fs/which %))))
(def default (def default
{::ibm-plex-web {::ibm-plex-web
(fs/file (fs/file (some #(let [x (fs/path % "ibm-plex-web")]
(or (System/getenv "IBM_PLEX_WEB") (and (fs/exists? x) x))
(some #(let [x (fs/path % "ibm-plex-web")] (fs/split-paths (System/getenv "XDG_DATA_DIRS"))))
(and (fs/exists? x) x)) ::latex "xelatex"
(fs/split-paths (System/getenv "XDG_DATA_DIRS")))))}) ::dvisvgm "dvisvgm"
;; TODO: Can we automatically set this to "./doerg-temml-worker/index.js" in
;; a development environment?
::doerg-temml-worker "doerg-temml-worker"
::doerg-parser "doerg-parser"})
(def ^:dynamic *cfg* default) (def ^:dynamic *cfg* default)
(s/def ::ibm-plex-web string?) (s/def ::ibm-plex-web ::file)
(s/def ::latex ::executable)
(s/def ::dvisvgm ::executable)
(s/def ::doerg-temml-worker ::executable)
(s/def ::doerg-parser ::executable)

View File

@@ -15,8 +15,6 @@
(:refer-clojure :exclude [read-string])) (:refer-clojure :exclude [read-string]))
(defonce ^:private uniorg-script-path-atom (atom nil))
(def ^:dynamic *uniorg-timeout-duration* (def ^:dynamic *uniorg-timeout-duration*
"Number of milliseconds to wait before killing the external Uniorg "Number of milliseconds to wait before killing the external Uniorg
process." process."
@@ -31,7 +29,7 @@
:or {in *in*}}] :or {in *in*}}]
(let [r (-> (p/process (let [r (-> (p/process
{:in in :out :string} {:in in :out :string}
"doerg-parser") (::cfg/doerg-parser cfg/*cfg*))
(common/deref-with-timeout *uniorg-timeout-duration*))] (common/deref-with-timeout *uniorg-timeout-duration*))]
(if (zero? (:exit r)) (if (zero? (:exit r))
(-> r :out (json/parse-string (comp keyword camel->kebab)))))) (-> r :out (json/parse-string (comp keyword camel->kebab))))))
@@ -81,6 +79,13 @@
(when-some [footnotes-headline (first (:children element))] (when-some [footnotes-headline (first (:children element))]
(= "Footnotes" (:raw-value footnotes-headline))))) (= "Footnotes" (:raw-value footnotes-headline)))))
(defn display-math?
"Return truthy if `element` should be considered display math."
[element]
(or (of-type? element "latex-environment")
(and (of-type? element "latex-fragment")
(-> element :contents (str/starts-with? "\\[")))))
;;; Spec ;;; Spec
@@ -180,8 +185,8 @@
parser, return a map with the following keys parser, return a map with the following keys
• :top-level-nodes The nodes that /should/ be at the top-level. • :top-level-nodes The nodes that /should/ be at the top-level.
• :first-section-nodes The nodes that should be wrapped in a new • :first-section-nodes The nodes that should be wrapped in a new
section node section node.
• :rest Everything else!" • :rest Everything else."
[nodes] [nodes]
(let [[of-top-level remaining-nodes] (let [[of-top-level remaining-nodes]
(->> nodes (split-with #(of-type? % "property-drawer" "keyword"))) (->> nodes (split-with #(of-type? % "property-drawer" "keyword")))

View File

@@ -9,9 +9,9 @@
[net.deertopia.doerg.html :as doerg-html] [net.deertopia.doerg.html :as doerg-html]
[hiccup2.core :as hiccup] [hiccup2.core :as hiccup]
[clojure.pprint] [clojure.pprint]
#_ ;; #_
[net.deertopia.doerg.tex :as tex] [net.deertopia.doerg.tex :as tex]
[net.deertopia.doerg.tex.native :as tex-native] ;; [net.deertopia.doerg.tex.native :as tex-native]
[net.deertopia.doerg.tex.temml :as tex-temml] [net.deertopia.doerg.tex.temml :as tex-temml]
[clojure.zip :as z] [clojure.zip :as z]
[babashka.fs :as fs])) [babashka.fs :as fs]))
@@ -72,6 +72,12 @@
[:article [:article
rendered]]]))) rendered]]])))
(defn to-html
"Read `f` with `slurp` as an Org document and return a string of
rendered HTML."
[f]
(str (hiccup/html {} (-> f slurp element/read-string org-document))))
;;; Further dispatching on `org-element` ;;; Further dispatching on `org-element`
@@ -137,71 +143,38 @@
#(element/of-keyword-type? % "LATEX_HEADER") #(element/of-keyword-type? % "LATEX_HEADER")
(sp/view :value)]))) (sp/view :value)])))
(defn- read-and-patch-generated-svg [{:keys [file height depth]}] (defn- timeout-snippet-promises [snippet-promises fut]
;; dvisvgm writes standalone SVG files, to which we need to make a ;; Time out after twenty seconds. With all the LaTeX and IPC, there
;; few changes to use them inline within our HTML. ;; are so many opportunities for things to go wrong </3.
;; • XML header: Bad syntax when embedded in an HTML doc. Remove (let [ms (* 20 1000)
;; it. fut-res (deref fut ms ::timed-out)]
;; • Width and height: We override these with our own values (if (= fut-res ::timed-out)
;; computed by `net.deertopia.doerg.tex` to ensure correct (do (l/warnf "Giving up on rendering TeX snippets after %.3f seconds."
;; positioning relative to the surrounding text. More (/ ms 1000))
;; accurately, we remove the height and width attributes from (future-cancel fut)
;; the SVG tag, and set the new values for height and (doseq [[_snippet p] snippet-promises]
;; vertical-align in the style attribute (deliver p ::timed-out)))
;; • Viewbox: Must be removed entirely for correct positioning. fut-res)))
(-> (slurp file)
(str/replace-first "<?xml version='1.0' encoding='UTF-8'?>" "")
(str/replace-first #" height=['\"][^\"']+[\"']" "")
(str/replace-first #" width=['\"][^\"']+[\"']" "")
(str/replace-first
#"viewBox=['\"][^\"']+[\"']"
(fn [s]
(format "%s style=\"%s\""
s
(format "height:%.4fem;vertical-align:%.4fem;display:inline-block"
height (- depth)))))))
(defn- render-tex-snippets [doc] (defn render-tex-snippets
(let [promises (atom []) "Traverse doc, adorning each LaTeX node with a promise resolving to,
optimistically, Hiccup-rendered SVG or MathML code."
[doc]
(let [snippet-promises (atom [])
r (->> doc (sp/transform r (->> doc (sp/transform
[element/postorder-walker [element/postorder-walker
#(element/of-type? #(element/of-type?
% "latex-fragment" "latex-environment")] % "latex-fragment" "latex-environment")]
(fn [node] (fn [node]
(let [p (promise)] (let [p (promise)]
(swap! promises #(conj % {:promise p :node node})) (swap! snippet-promises #(conj % [(:value node) p]))
(assoc node ::rendered p))))) (assoc node ::rendered p)))))
f (fn [] sp @snippet-promises
(fs/with-temp-dir [svg-dir {:prefix "doerg-svg"}] fut (-> #(tex/render-snippets sp)
(let [rendered-snippets bound-fn* future-call)]
(delay (->> @promises (timeout-snippet-promises sp fut)
(map #(-> % :node :value))
(apply tex-native/render svg-dir)))]
(doseq [{:keys [promise node]} @promises]
(try (let [{:keys [value]} node
temml (tex-temml/render value)]
(if (tex-temml/erroneous-output? temml)
(let [tex (get @rendered-snippets value)]
(if (:errors tex)
(deliver promise (hiccup/raw temml))
(->> tex
read-and-patch-generated-svg
hiccup/raw
(deliver promise))))
(deliver promise (hiccup/raw temml))))
(catch Exception e
(prn e)
(flush)
(throw e))))
(when (fs/exists? "/tmp/doerg-svgs")
(fs/delete-tree "/tmp/doerg-svgs"))
(fs/copy-tree svg-dir "/tmp/doerg-svgs"))))]
(future-call (bound-fn* f))
r)) r))
(comment
(render-tex-snippets doc))
(defn- render-pprint (defn- render-pprint
@@ -345,12 +318,14 @@
(str "@" key)) (str "@" key))
(defmethod org-element "latex-fragment" [{:keys [contents value] :as e}] (defmethod org-element "latex-fragment" [{:keys [contents value] :as e}]
[:span.latex-fragment [:span {:class (if (element/display-math? e)
(-> e ::rendered (deref #_#_ 2000 "«timed out»"))]) "latex-fragment display-math"
"latex-fragment")}
(-> e ::rendered deref)])
(defmethod org-element "latex-environment" [{:keys [value] :as e}] (defmethod org-element "latex-environment" [{:keys [value] :as e}]
[:span.latex-fragment [:span.latex-fragment.display-math
(-> e ::rendered (deref #_#_ 2000 "«timed out»"))]) (-> e ::rendered deref)])
(defmethod org-element "example-block" [{:keys [value]}] (defmethod org-element "example-block" [{:keys [value]}]
[:pre value]) [:pre value])

View File

@@ -14,16 +14,26 @@
"/home/msyds/org/20250919114912-homepage.org" "/home/msyds/org/20250919114912-homepage.org"
#_ #_
"/home/msyds/org/20251111182118-path_induction.org" "/home/msyds/org/20251111182118-path_induction.org"
#_ ;; #_
"/home/msyds/org/20250512144715-natural_transformation_category_theory.org" "/home/msyds/org/20250512144715-natural_transformation_category_theory.org"
#_ #_
"/home/msyds/org/20251021155921-path_action.org" "/home/msyds/org/20251021155921-path_action.org"
"test/net/deertopia/doerg/tex-test.org") #_
"test/net/deertopia/doerg/render_test/fallbacks.org"
#_
"/home/msyds/org/20250910115311-men_who_would_make_stunning_dykes.org")
(defn- force-create-sym-link [path target] (defn- force-create-sym-link [path target]
(fs/delete-if-exists path) (fs/delete-if-exists path)
(fs/create-sym-link path target)) (fs/create-sym-link path target))
(defn reconfigure-doerg! []
(alter-var-root
#'cfg/*cfg*
#(assoc %
::cfg/doerg-temml-worker "./doerg-temml-worker/index.js"
::cfg/doerg-parser "./doerg-parser/index.js")))
(defn render-html [& {:keys [src dest] (defn render-html [& {:keys [src dest]
:or {src some-org-file :or {src some-org-file
dest "/tmp/doerg-test"}}] dest "/tmp/doerg-test"}}]
@@ -37,8 +47,7 @@
(force-create-sym-link (fs/file dest "Temml-Plex.css") (force-create-sym-link (fs/file dest "Temml-Plex.css")
(io/resource "net/deertopia/doerg/Temml-Plex.css")) (io/resource "net/deertopia/doerg/Temml-Plex.css"))
(fs/delete-if-exists (fs/file dest "index.html")) (fs/delete-if-exists (fs/file dest "index.html"))
(->> (h/html (-> src slurp element/read-string render/org-document)) (->> src render/to-html str (spit (fs/file dest "index.html"))))
str (spit (fs/file dest "index.html"))))
(defn render-edn [& {:keys [src dest] (defn render-edn [& {:keys [src dest]
:or {src some-org-file :or {src some-org-file

View File

@@ -1,4 +1,71 @@
(ns net.deertopia.doerg.tex (ns net.deertopia.doerg.tex
(:require [net.deertopia.doerg.tex.native :as native] (:require [net.deertopia.doerg.tex.native :as native]
[net.deertopia.doerg.tex.temml :as temml] [net.deertopia.doerg.tex.temml :as temml]
[babashka.fs :as fs])) [babashka.fs :as fs]
[clojure.string :as str]
[hiccup2.core :as hiccup]
[clojure.tools.logging :as l]
[clojure.tools.logging.readable :as lr]))
(defn- read-and-patch-generated-svg [{:keys [file height depth]}]
;; dvisvgm writes standalone SVG files, to which we need to make a
;; few changes to use them inline within our HTML.
;; • XML header: Bad syntax when embedded in an HTML doc. Remove
;; it.
;; • Width and height: We override these with our own values
;; computed by `net.deertopia.doerg.tex` to ensure correct
;; positioning relative to the surrounding text. More
;; accurately, we remove the height and width attributes from
;; the SVG tag, and set the new values for height and
;; vertical-align in the style attribute
;; • Viewbox: Must be removed entirely for correct positioning.
(-> (slurp file)
(str/replace-first #"<\?xml version='1.0' encoding='UTF-8'\?>\n?" "")
(str/replace-first #" height=['\"][^\"']+[\"']" "")
(str/replace-first #" width=['\"][^\"']+[\"']" "")
(str/replace-first
#"viewBox=['\"][^\"']+[\"']"
(fn [s]
(format "%s style=\"%s\""
s
(format "height:%.4fem;vertical-align:%.4fem;display:inline-block"
height (- depth)))))
;; Stupid hack. --currentcolor on dvisvgm should be enough, but
;; it doesn't get e.g. TikZ arrows.
(str/replace #"stroke=['\"]#000['\"]" "stroke=\"currentColor\"")))
(def ^:dynamic *save-snippets?* false)
(defn render-snippets [snippet-promises]
(with-redefs [fs/delete-tree
(fn
([path]
(l/warnf "refusing to delete %s" path))
([path opts]
(lr/warnf "refusing to delete %s with opts %s"
path opts)))]
(fs/with-temp-dir [svg-dir {:prefix "doerg-svg-"}]
(let [rendered-snippets
(delay (->> snippet-promises
(map first)
(apply native/render svg-dir)))]
(doseq [[snippet p] snippet-promises]
(try (let [temml (temml/render snippet)]
(->> (if (temml/erroneous-output? temml)
(let [tex (get @rendered-snippets snippet)]
(if (:errors tex)
temml
(read-and-patch-generated-svg tex)))
temml)
hiccup/raw (deliver p)))
(catch Exception e
(l/error e "Error in TeX thread")
(throw e))))))))
(comment
(let [snippets (for [x ["\\(\\ifxetex blah \\fi\\)"
"\\(\\sqrt{x^2 + y^2}\\)"]]
[x (promise)])]
(temml/binding-worker
(render-snippets snippets)
(map #(-> % second deref) snippets))))

View File

@@ -6,7 +6,8 @@
[clojure.java.io :as io] [clojure.java.io :as io]
[clojure.string :as str] [clojure.string :as str]
[clojure.tools.logging :as l] [clojure.tools.logging :as l]
[babashka.fs :as fs]) [babashka.fs :as fs]
[net.deertopia.doerg.config :as cfg])
(:import (java.io ByteArrayOutputStream))) (:import (java.io ByteArrayOutputStream)))
(def ^:private scale-divisor 66873.46948423679) (def ^:private scale-divisor 66873.46948423679)
@@ -80,20 +81,21 @@
errors)))))) errors))))))
acc)))) acc))))
(defn- invoke-latex [& {:keys [file output-dir latex] (defn- invoke-latex [& {:keys [file output-dir]}]
:or {latex "xelatex"}}] (let [latex (::cfg/latex cfg/*cfg*)]
(invoke (invoke
{:dir output-dir} {:dir output-dir}
latex "-no-pdf" "-interaction" "nonstopmode" latex "-no-pdf" "-interaction" "nonstopmode"
"-output-directory" output-dir file)) "-output-directory" output-dir file)))
(defn- invoke-dvisvgm [& {:keys [file output-dir]}] (defn- invoke-dvisvgm [& {:keys [file output-dir]}]
(invoke (let [dvisvgm (::cfg/dvisvgm cfg/*cfg*)]
{:dir output-dir} (invoke
"dvisvgm" "--page=1-" "--optimize" "--clipjoin" {:dir output-dir}
"--relative" "--no-fonts" "-v3" dvisvgm "--page=1-" "--optimize" "--clipjoin"
"--message=processing page {?pageno}: output written to {?svgpath}" "--relative" "--no-fonts" "-v3" "--currentcolor"
"--bbox=preview" "-o" "%9p.svg" file)) "--message=processing page {?pageno}: output written to {?svgpath}"
"--bbox=preview" "-o" "%9p.svg" file)))
(defn- snippet-file-names (defn- snippet-file-names
"Return a map of TeX snippets (as strings, including the math "Return a map of TeX snippets (as strings, including the math

View File

@@ -1,6 +1,7 @@
(ns net.deertopia.doerg.tex.temml (ns net.deertopia.doerg.tex.temml
(:require [babashka.process :as p] (:require [babashka.process :as p]
[net.deertopia.doerg.common :as common] [net.deertopia.doerg.common :as common]
[net.deertopia.doerg.config :as cfg]
[clj-cbor.core :as cbor] [clj-cbor.core :as cbor]
[clojure.java.io :as io] [clojure.java.io :as io]
[clojure.string :as str] [clojure.string :as str]
@@ -16,13 +17,13 @@
(def ^:dynamic *worker*) (def ^:dynamic *worker*)
(defn worker [& {:keys [preamble]}] (defn worker [& {:keys [preamble]}]
(p/process (let [doerg-temml-worker (::cfg/doerg-temml-worker cfg/*cfg*)]
{:shutdown p/destroy-tree (p/process
:err (l/log-stream :info "temml/err")} {:shutdown p/destroy-tree
#_"doerg-tex" :err (l/log-stream :info "temml/err")}
"./doerg-tex/index.js" doerg-temml-worker
"--preamble" "--preamble"
"resources/net/deertopia/doerg/prelude.tex")) "resources/net/deertopia/doerg/prelude.tex")))
(defn close-worker [tw] (defn close-worker [tw]
(.close (:in tw))) (.close (:in tw)))
@@ -54,13 +55,18 @@
(command-worker [s])) (command-worker [s]))
(defn render [s] (defn render [s]
(if-let [[_ inner] (re-matches #"(?s)\\[(.*)\\]" s)] (let [s (str/trim s)]
(render-display inner) (if-let [[_ inner] (re-matches #"(?s)\\\[(.*)\\]" s)]
(if (re-matches #"(?s)\\begin\{.+?}(.*?)\\end\{.+?}" s) (render-display inner)
(render-display s) (if (re-matches #"(?s)\\begin\{.+?}(.*?)\\end\{.+?}" s)
(if-let [[_ inner] (re-matches #"(?s)\\\((.*)\\\)" s)] (render-display s)
(render-inline inner) (if-let [[_ inner] (re-matches #"(?s)\\\((.*)\\\)" s)]
(throw (ex-info "weird" {:snippet s})))))) (render-inline inner)
(throw (IllegalArgumentException.
(ex-info
(str "`net.deertopia.doerg.tex.temml` argument should"
" be enclosed in math delimiters.")
{:arg s}))))))))
;; hackky.... ;; hackky....
(defn erroneous-output? [s] (defn erroneous-output? [s]

View File

@@ -0,0 +1,60 @@
(ns net.deertopia.doerg.render-test
(:require [net.deertopia.doerg.render :as sut]
[net.deertopia.doerg.element :as element]
[net.deertopia.doerg.tex.temml :as temml]
[net.deertopia.doerg.tex.native :as native]
[com.rpl.specter :as sp]
[clojure.edn :as edn]
[clojure.test :as t]
[clojure.java.io :as io]
[clojure.string :as str]))
;; Stupid and hacky.
(defn mathml? [s]
(str/starts-with? s "<math"))
;; Also stupid and hacky. }:)
(defn svg? [s]
(some? (re-matches #"(?s)(<!--.*?-->\n)<svg.*" s)))
(defn read-resource [s]
(let [p (-> (format "net/deertopia/doerg/render_test/%s" s)
io/resource slurp)]
(cond (str/ends-with? s ".edn") (edn/read-string p)
(str/ends-with? s ".org") (element/read-string p))))
(t/deftest latex-fallbacks
(t/testing "LaTeX fallback behaviour"
(let [doc (temml/binding-worker
(-> "fallbacks.org" read-resource sut/render-tex-snippets))
snippets (->> doc
(sp/select
[element/postorder-walker
#(element/of-type?
% "latex-fragment" "latex-environment")
(sp/view #(-> % ::sut/rendered deref str))]))
expectations (-> "fallbacks.edn" read-resource)]
(doall (map (fn [s e]
(let [mathml (mathml? s)
svg (svg? s)]
(assert
(not= mathml svg)
"`mathml?` and `svg?` should be mutually-exclusive.")
(case e
:mathml (t/is mathml)
:svg (t/is svg))))
snippets expectations)))))
(t/deftest latex-laziness
(t/testing "LaTeX laziness"
(let [ex (Exception. "you're supposed to be lazy!")
bad (fn [& _] (throw ex))
doc (read-resource "latexless.org")
r (try (with-redefs-fn {#'native/render bad
#'temml/render bad}
#(sut/render-tex-snippets doc))
(catch Exception e
(if (= e ex)
false
(throw e))))]
(t/is r))))

View File

@@ -0,0 +1,7 @@
[:mathml
:mathml
:mathml
:mathml
:svg
:mathml
:svg]

View File

@@ -1,5 +1,4 @@
#+title: aghhh #+title: aghhh
#+latex_header: \usepackage{ifxetex}
- blah blah prose prose prose \(c = \sqrt{x^2 + y^2}\), alal. - blah blah prose prose prose \(c = \sqrt{x^2 + y^2}\), alal.
- this thing is \(x\) - this thing is \(x\)

View File

@@ -0,0 +1,3 @@
#+title: 이 파일은 LaTeX 코드가 포함되지 않습니다.
🦌!

1
doerg/tests.edn Normal file
View File

@@ -0,0 +1 @@
#kaocha/v1 {}

View File

@@ -32,7 +32,7 @@
_pkgs = each-system ({ pkgs, ... }: pkgs); _pkgs = each-system ({ pkgs, ... }: pkgs);
packages = each-system ({ pkgs, ... }: { packages = each-system ({ pkgs, ... }: {
inherit (pkgs) publisher doerg doerg-parser doerg-tex; inherit (pkgs) publisher doerg doerg-parser doerg-temml-worker;
default = pkgs.publisher; default = pkgs.publisher;
}); });
@@ -41,14 +41,14 @@
vendored = final.callPackage ./vendor {}; vendored = final.callPackage ./vendor {};
in { in {
inherit (vendored) ibm-plex-web; inherit (vendored) ibm-plex-web;
publisher = final.callPackage ./publisher/package.nix {}; publisher = final.callPackage ./publisher {};
doerg = final.callPackage ./doerg/package.nix {}; doerg = final.callPackage ./doerg {};
doerg-parser = final.callPackage ./doerg/doerg-parser {}; doerg-parser = final.callPackage ./doerg/doerg-parser {};
doerg-tex = final.callPackage ./doerg/doerg-tex {}; doerg-temml-worker = final.callPackage ./doerg/doerg-temml-worker {};
}; };
checks = each-system ({ pkgs, system, ... }: { checks = each-system ({ pkgs, system, ... }: {
packages = build-all =
pkgs.linkFarmFromDrvs pkgs.linkFarmFromDrvs
"all" "all"
(pkgs.lib.attrValues self.packages.${system}); (pkgs.lib.attrValues self.packages.${system});
@@ -59,15 +59,12 @@
inputsFrom = [ inputsFrom = [
pkgs.doerg pkgs.doerg
pkgs.doerg-parser pkgs.doerg-parser
pkgs.doerg-tex pkgs.doerg-temml-worker
]; ];
packages = with pkgs; [ packages = with pkgs; [
clojure-lsp clojure-lsp
doerg-parser doerg-parser
doerg-tex doerg-temml-worker
# wahhh ibm-plex-web is a dependency of doerg... why must
# i specify it hereeee.
# ibm-plex-web
zprint zprint
clojure clojure
babashka babashka