Compare commits

..

30 Commits

Author SHA1 Message Date
55d04707b7 wip: refactor: split tex modules 2026-02-26 14:53:29 -07:00
ea3b77619a fix: render-temml 2026-02-26 14:43:11 -07:00
cf225f6bc5 fix: temml css 2026-02-26 14:33:44 -07:00
2776144f04 refactor: split up render-temml 2026-02-26 13:40:50 -07:00
71163b9bb5 AAAAAA xelatex 2026-02-26 13:07:07 -07:00
7d12f7d90e 2026-02-26 13:04:31 -07:00
d5ccadb326 2026-02-26 12:07:07 -07:00
ee86f0d643 2026-02-26 11:15:05 -07:00
e67f62e5b0 2026-02-26 11:07:12 -07:00
b765f71b55 2026-02-26 10:40:06 -07:00
47b201fd03 2026-02-26 10:31:17 -07:00
8ec78c040a 2026-02-26 09:04:49 -07:00
d15f9988c2 2026-02-26 00:32:11 -07:00
b3ca176ee2 2026-02-26 00:12:28 -07:00
efd4c4cdbc 2026-02-25 17:07:48 -07:00
f6da1187ad 2026-02-25 17:06:33 -07:00
bd3e6016ed 2026-02-25 16:45:58 -07:00
02bbe0a8b8 2026-02-25 09:55:32 -07:00
dc31f02b30 2026-02-25 09:48:33 -07:00
fd8354f398 2026-02-25 09:24:51 -07:00
af493a1291 2026-02-25 09:16:54 -07:00
955db64027 2026-02-24 17:52:49 -07:00
ad8ae8f743 2026-02-24 17:50:42 -07:00
a52bc97ed3 2026-02-24 15:05:22 -07:00
470dec9183 2026-02-24 10:50:03 -07:00
790ce7e01f 2026-02-24 10:43:43 -07:00
aa8b89fe84 2026-02-24 09:43:47 -07:00
638b12c9eb 2026-02-24 09:11:28 -07:00
9ac8577478 2026-02-23 16:25:17 -07:00
b5a5721eed wip: xelatex 2026-02-22 19:01:16 -07:00
33 changed files with 217 additions and 827 deletions

View File

@@ -1,11 +0,0 @@
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,16 +10,6 @@
}
],
"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-repo": "https://repo.clojars.org/",
@@ -50,31 +40,6 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo.clojars.org/",
@@ -160,26 +125,6 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -240,36 +185,6 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo.clojars.org/",
@@ -300,56 +215,6 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo.clojars.org/",
@@ -360,56 +225,6 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -467,62 +282,62 @@
},
{
"mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-fxJHLa7Y9rUXSYqqKrE6ViR1w+31FHjkWBzHYemJeaM="
},
{
"mvn-path": "org/clojure/clojure/1.10.3/clojure-1.10.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-GJwAxDNAdJai+7DsyzeQjJSVXZHq0b5IFWdE7MGBbZQ="
},
{
"mvn-path": "org/clojure/clojure/1.11.0/clojure-1.11.0.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-PiH6daB+yd278bK1A1bPGAcQ0DmN6qT0TpHNYwRVWUc="
},
{
"mvn-path": "org/clojure/clojure/1.11.0/clojure-1.11.0.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-SQjMS0yeYsmoFJb5PLWsb2lBd8xkXc87jOXkkavOHro="
},
{
"mvn-path": "org/clojure/clojure/1.11.1/clojure-1.11.1.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-I4G26UI6tGUVFFWUSQPROlYkPWAGuRlK/Bv0+HEMtN4="
},
{
"mvn-path": "org/clojure/clojure/1.11.1/clojure-1.11.1.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-IMRaGr7b2L4grvk2BQrjGgjBZ0CzL4dAuIOM3pb/y4o="
},
{
"mvn-path": "org/clojure/clojure/1.11.2/clojure-1.11.2.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-iPqZkT1pIs+39kn1xGdQOHfLb8yMwW02948mSAhLqZc="
},
{
"mvn-path": "org/clojure/clojure/1.11.2/clojure-1.11.2.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-FzbP/xCV4dT+/raogrut9ttB7+MV8pbw/aMtt//EExE="
},
{
"mvn-path": "org/clojure/clojure/1.11.3/clojure-1.11.3.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-nDBUCTKOK5boXdK160t1gQxnt2unCuTQ9t3pvPtVsbc="
},
{
"mvn-path": "org/clojure/clojure/1.11.3/clojure-1.11.3.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-DA2+Ge4NKpxXMQzr3dNWRD8NFlFMQmBHsGLjpXwNuK0="
},
{
"mvn-path": "org/clojure/clojure/1.11.4/clojure-1.11.4.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-/H/xtmENDjSUp1zBHvgYEL2kAqwVcBL+TjuJlYbPQTM="
},
{
"mvn-path": "org/clojure/clojure/1.11.4/clojure-1.11.4.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-a6YADmhI+Cw5y5tJqyqmo6Vi9MJNUrMeUZCuZJXwwwk="
},
{
@@ -535,46 +350,6 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -585,34 +360,24 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-/PRCveArBKhj8vzFjuaiowxM8Mlw99q4VjTwq3ERZrY="
},
{
"mvn-path": "org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-AarxdIP/HHSCySoHKV1+e8bjszIt9EsptXONAg/wB0A="
},
{
"mvn-path": "org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-Bu6owHC75FwVhWfkQ0OWgbyMRukSNBT4G/oyukLWy8g="
},
{
"mvn-path": "org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-F3i70Ti9GFkLgFS+nZGdG+toCfhbduXGKFtn1Ad9MA4="
},
{
@@ -625,16 +390,6 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -650,14 +405,9 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-fxgrOypUPgV0YL+T/8XpzvasUn3xoTdqfZki6+ee8Rk="
},
{
@@ -677,22 +427,22 @@
},
{
"mvn-path": "org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-z2iZ+YUpjGSxPqEplGrZAo3uja3w6rmuGORVAn04JJw="
},
{
"mvn-path": "org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-WhHw4eizwFLmUcSYxpRbRNs1Nb8sGHGf3PZd8fiLE+Y="
},
{
"mvn-path": "org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-Z+yJjrVcZqlXpVJ53YXRN2u5lL2HZosrDeHrO5foquA="
},
{
"mvn-path": "org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.pom",
"mvn-repo": "https://repo1.maven.org/maven2/",
"mvn-repo": "https://repo.maven.apache.org/maven2/",
"hash": "sha256-bY3hTDrIdXYMX/kJVi/5hzB3AxxquTnxyxOeFp/pB1g="
},
{
@@ -715,16 +465,6 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -745,16 +485,6 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -800,51 +530,11 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo1.maven.org/maven2/",
@@ -855,26 +545,6 @@
"mvn-repo": "https://repo1.maven.org/maven2/",
"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-repo": "https://repo.clojars.org/",
@@ -940,16 +610,6 @@
"mvn-repo": "https://repo.clojars.org/",
"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-repo": "https://repo.clojars.org/",

View File

@@ -1,61 +0,0 @@
{ 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,9 +8,5 @@
hiccup/hiccup {:mvn/version "2.0.0-RC4"}
com.rpl/specter {:mvn/version "1.1.6"}
lambdaisland/deep-diff2 {:mvn/version "2.12.219"}
mvxcvi/clj-cbor {:mvn/version "1.1.1"}
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"]}}}
mvxcvi/clj-cbor {:mvn/version "1.1.1"}}
:paths ["src" "resources" "test"]}

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

View File

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

View File

@@ -1,12 +0,0 @@
#+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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

34
doerg/package.nix Normal file
View File

@@ -0,0 +1,34 @@
{ 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,56 +1,11 @@
\documentclass[tikz,dvisvgm]{standalone}
\usepackage[active,tightpage,auctex,dvips]{preview}
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[active,tightpage,auctex,dvips]{preview}
\usepackage{fontspec}
\usepackage{ifxetex}
\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}
\setlength\abovedisplayskip{0pt} % Remove padding before equation environments.
%% \color[rgb]{0.000,0.000,0.004}\special{dvisvgm:currentcolor on}\setcounter{equation}{0}%
\setlength\abovedisplayskip{0pt}
% {{contents}}
\end{document}

View File

@@ -546,13 +546,3 @@ figure.fullwidth figcaption {
.latex-fragment
{ 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,40 +4,16 @@
[spec-dict.main :refer [dict]]))
(s/def ::config
(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 %))))
(s/keys :req [::ibm-plex-web]))
(def default
{::ibm-plex-web
(fs/file (some #(let [x (fs/path % "ibm-plex-web")]
(and (fs/exists? x) x))
(fs/split-paths (System/getenv "XDG_DATA_DIRS"))))
::latex "xelatex"
::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"})
(fs/file
(or (System/getenv "IBM_PLEX_WEB")
(some #(let [x (fs/path % "ibm-plex-web")]
(and (fs/exists? x) x))
(fs/split-paths (System/getenv "XDG_DATA_DIRS")))))})
(def ^:dynamic *cfg* default)
(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)
(s/def ::ibm-plex-web string?)

View File

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

View File

@@ -9,10 +9,10 @@
[net.deertopia.doerg.html :as doerg-html]
[hiccup2.core :as hiccup]
[clojure.pprint]
;; #_
#_
[net.deertopia.doerg.tex :as tex]
;; [net.deertopia.doerg.tex.native :as tex-native]
[net.deertopia.doerg.tex.temml :as tex-temml]
[net.deertopia.doerg.tex.native :as tex]
[net.deertopia.doerg.tex.temml :as tex]
[clojure.zip :as z]
[babashka.fs :as fs]))
@@ -61,7 +61,7 @@
(defn org-document
"Recursively render an Org-mode document to Hiccup."
[doc]
(tex-temml/binding-worker
(tex/binding-temml-worker
(let [rendered (-> doc gather-footnotes render-tex-snippets
org-element-recursive)]
[:html
@@ -72,12 +72,6 @@
[:article
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`
@@ -143,38 +137,71 @@
#(element/of-keyword-type? % "LATEX_HEADER")
(sp/view :value)])))
(defn- timeout-snippet-promises [snippet-promises fut]
;; Time out after twenty seconds. With all the LaTeX and IPC, there
;; are so many opportunities for things to go wrong </3.
(let [ms (* 20 1000)
fut-res (deref fut ms ::timed-out)]
(if (= fut-res ::timed-out)
(do (l/warnf "Giving up on rendering TeX snippets after %.3f seconds."
(/ ms 1000))
(future-cancel fut)
(doseq [[_snippet p] snippet-promises]
(deliver p ::timed-out)))
fut-res)))
(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'?>" "")
(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
"Traverse doc, adorning each LaTeX node with a promise resolving to,
optimistically, Hiccup-rendered SVG or MathML code."
[doc]
(let [snippet-promises (atom [])
(defn- render-tex-snippets [doc]
(let [promises (atom [])
r (->> doc (sp/transform
[element/postorder-walker
#(element/of-type?
% "latex-fragment" "latex-environment")]
(fn [node]
(let [p (promise)]
(swap! snippet-promises #(conj % [(:value node) p]))
(swap! promises #(conj % {:promise p :node node}))
(assoc node ::rendered p)))))
sp @snippet-promises
fut (-> #(tex/render-snippets sp)
bound-fn* future-call)]
(timeout-snippet-promises sp fut)
f (fn []
(fs/with-temp-dir [svg-dir {:prefix "doerg-svg"}]
(let [rendered-snippets
(delay (->> @promises
(map #(-> % :node :value))
(apply tex/render-xelatex svg-dir)))]
(doseq [{:keys [promise node]} @promises]
(try (let [{:keys [value]} node
temml (tex/render-temml value)]
(if (tex/erroneous-temml-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))
(comment
(render-tex-snippets doc))
(defn- render-pprint
@@ -318,14 +345,12 @@
(str "@" key))
(defmethod org-element "latex-fragment" [{:keys [contents value] :as e}]
[:span {:class (if (element/display-math? e)
"latex-fragment display-math"
"latex-fragment")}
(-> e ::rendered deref)])
[:span.latex-fragment
(-> e ::rendered (deref #_#_ 2000 "«timed out»"))])
(defmethod org-element "latex-environment" [{:keys [value] :as e}]
[:span.latex-fragment.display-math
(-> e ::rendered deref)])
[:span.latex-fragment
(-> e ::rendered (deref #_#_ 2000 "«timed out»"))])
(defmethod org-element "example-block" [{:keys [value]}]
[:pre value])

View File

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

View File

@@ -1,71 +1,4 @@
(ns net.deertopia.doerg.tex
(:require [net.deertopia.doerg.tex.native :as native]
[net.deertopia.doerg.tex.temml :as temml]
[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))))
[babashka.fs :as fs]))

View File

@@ -6,8 +6,7 @@
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.logging :as l]
[babashka.fs :as fs]
[net.deertopia.doerg.config :as cfg])
[babashka.fs :as fs])
(:import (java.io ByteArrayOutputStream)))
(def ^:private scale-divisor 66873.46948423679)
@@ -44,8 +43,8 @@
(-> r
(assoc ::out out))))
(defn- parse-tightpage [latex-out]
(->> (re-find tightpage-regexp latex-out)
(defn- parse-tightpage [xelatex-out]
(->> (re-find tightpage-regexp xelatex-out)
(drop 1)
(map parse-long)))
@@ -60,7 +59,7 @@
scale-divisor
font-size)}))
(defn- parse-latex-output [out]
(defn- parse-output [out]
(let [tightpage-info (parse-tightpage out)
m-start (re-matcher preview-start-regexp out)
m-end (re-matcher preview-end-regexp out)]
@@ -81,21 +80,19 @@
errors))))))
acc))))
(defn- invoke-latex [& {:keys [file output-dir]}]
(let [latex (::cfg/latex cfg/*cfg*)]
(invoke
{:dir output-dir}
latex "-no-pdf" "-interaction" "nonstopmode"
"-output-directory" output-dir file)))
(defn- invoke-xelatex [& {:keys [file output-dir]}]
(invoke
{:dir output-dir}
"xelatex" "-no-pdf" "-interaction" "nonstopmode"
"-output-directory" output-dir file))
(defn- invoke-dvisvgm [& {:keys [file output-dir]}]
(let [dvisvgm (::cfg/dvisvgm cfg/*cfg*)]
(invoke
{:dir output-dir}
dvisvgm "--page=1-" "--optimize" "--clipjoin"
"--relative" "--no-fonts" "-v3" "--currentcolor"
"--message=processing page {?pageno}: output written to {?svgpath}"
"--bbox=preview" "-o" "%9p.svg" file)))
(invoke
{:dir output-dir}
"dvisvgm" "--page=1-" "--optimize" "--clipjoin"
"--relative" "--no-fonts" "-v3"
"--message=processing page {?pageno}: output written to {?svgpath}"
"--bbox=preview" "-o" "%9p.svg" file))
(defn- snippet-file-names
"Return a map of TeX snippets (as strings, including the math
@@ -115,26 +112,25 @@
slurp
(str/replace-first "% {{contents}}" contents))))
(defn render
"Render a collection of `snippets` to SVGs in `output-dir` using a
LaTeX engine (XeLaTeX at the moment) and dvisvgm. Returns a map
whose keys are `snippets` and whose values are maps containing
geometry info, a string of errors output by LaTeX, and the path to
the generated SVG file. Math delimiters are *not* implicitly added
to each snippet."
(defn render-xelatex
"Render a collection of `snippets` to SVGs in `output-dir` using
XeLaTeX and dvisvgm. Returns a map whose keys are `snippets` and
whose values are maps containing geometry info, a string of errors
output by XeLaTeX, and the path to the generated SVG file. Math
delimiters are *not* implicitly added to each snippet."
[output-dir & snippets]
(fs/with-temp-dir [dir {:prefix "doerg-latex"}]
(fs/with-temp-dir [dir {:prefix "doerg-xelatex"}]
(let [preview-tex (fs/file dir "preview.tex")
preview-xdv (fs/file dir "preview.xdv")
distinct-snippets (distinct snippets)]
(fs/create-dirs output-dir)
(->> (instantiate-preview-template distinct-snippets)
(spit preview-tex))
(let [dimensions (-> (invoke-latex :output-dir dir :file preview-tex)
::out parse-latex-output)
(let [dimensions (-> (invoke-xelatex :output-dir dir :file preview-tex)
::out parse-xelatex-output)
_ (invoke-dvisvgm :output-dir output-dir :file preview-xdv)]
;; Adorn each snippet with dimensions and errors parsed from
;; LaTeX's output, and the paths to SVG files generated by
;; XeLaTeX's output, and the paths to SVG files generated by
;; dvisvgm.
(assert (= (count distinct-snippets) (count dimensions)))
(->> (map (fn [ix snippet dimensions]
@@ -149,8 +145,8 @@
(into {}))))))
(comment
(render "/tmp/doerg-tex-svgs"
"\\(c = \\sqrt{x^2 + y^2}\\)"
"\\(x\\)" "\\(y\\)" "\\(x\\)"
"\\(\\undefinedcommandlol\\)"))
(render-xelatex "/tmp/doerg-tex-svgs"
"\\(c = \\sqrt{x^2 + y^2}\\)"
"\\(x\\)" "\\(y\\)" "\\(x\\)"
"\\(\\undefinedcommandlol\\)"))

View File

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

View File

@@ -1,60 +0,0 @@
(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

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

View File

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

View File

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

View File

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

View File

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