Skip to content

Commit 5dc9604

Browse files
authored
Remove goog.object references, support SCI evaluation (#15)
1 parent f6e1001 commit 5dc9604

File tree

11 files changed

+263
-239
lines changed

11 files changed

+263
-239
lines changed

.dir-locals.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
. ((cider-default-cljs-repl . node)))
33
(clojure-mode
44
. ((cider-preferred-build-tool . clojure-cli)
5-
(cider-clojure-cli-aliases . ":dev:clerk"))))
5+
(cider-clojure-cli-aliases . ":nextjournal/clerk"))))

.github/workflows/gh-pages.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,28 @@ jobs:
1010
steps:
1111
- uses: actions/cache@v3
1212
with:
13-
path: ~/.m2
14-
key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }}
15-
restore-keys: ${{ runner.os }}-m2
13+
path: |
14+
.cpcache
15+
.shadow-cljs
16+
~/.m2
17+
key: "1"
1618

1719
- name: Checkout
1820
uses: actions/checkout@v3
1921

2022
- name: Install clojure tools
21-
uses: DeLaGuardo/setup-clojure@4.0
23+
uses: DeLaGuardo/setup-clojure@master
2224
with:
2325
cli: latest
26+
bb: latest
2427
github-token: ${{ secrets.GITHUB_TOKEN }}
2528

26-
- name: Install babashka
27-
uses: just-sultanov/setup-babashka@v2
28-
with:
29-
version: '0.8.156'
30-
3129
- name: Build static site
3230
run: bb build-static
3331

3432
- name: Deploy
3533
uses: peaceiris/actions-gh-pages@v3
34+
if: ${{ github.ref == 'refs/heads/main' }}
3635
with:
3736
github_token: ${{ secrets.GITHUB_TOKEN }}
3837
publish_dir: ./public/build

.github/workflows/kondo.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v2
1414

15-
- name: Install babashka
16-
uses: just-sultanov/setup-babashka@v2
15+
- name: Install Babashka
16+
uses: DeLaGuardo/setup-clojure@10.2
1717
with:
18-
version: '0.8.156'
18+
bb: latest
1919

2020
- name: Cache kondo directory
2121
uses: actions/cache@v2
@@ -24,5 +24,8 @@ jobs:
2424
key: ${{ runner.os }}-kondo
2525
restore-keys: ${{ runner.os }}-kondo
2626

27-
- name: Run clj-kondo
27+
- name: Lint dependencies
28+
run: bb lint-deps
29+
30+
- name: Lint project files
2831
run: bb lint --config '{:output {:pattern "::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"}}'

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## [unreleased]
44

5+
## [0.2.1]
6+
7+
- #15:
8+
9+
- removes the `goog.object` to make the library compatible with SCI
10+
evaluation, needed by Portal.
11+
12+
- adds various build upgrades, (Clerk, Kondo etc)
13+
514
## [0.2.0]
615

716
The interactive docs page is now published to https://mathlive.mentat.org.

bb.edn

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{:deps {org.babashka/http-server {:mvn/version "0.1.11"}
2-
org.babashka/cli {:mvn/version "0.2.23"}}
3-
:pods {clj-kondo/clj-kondo {:version "2023.01.20"}}
2+
org.babashka/cli {:mvn/version "0.2.23"}
3+
io.github.clj-kondo/clj-kondo-bb
4+
{:git/tag "v2023.01.20" :git/sha "adfc7df"}}
45
:tasks
5-
{:requires ([babashka.cli :as cli]
6-
[pod.borkdude.clj-kondo :as clj-kondo])
6+
{:requires ([babashka.cli :as cli])
77
:init
88
(do (def cli-opts
99
(cli/parse-opts *command-line-args* {:coerce {:port :int}}))
@@ -51,7 +51,16 @@
5151
{:doc "Release the library to Clojars."
5252
:task (shell "clojure -T:build publish")}
5353

54+
lint-deps
55+
{:requires ([clj-kondo.core :as kondo])
56+
:doc "Lint dependencies."
57+
:task (kondo/run!
58+
{:lint [(with-out-str
59+
(babashka.tasks/clojure
60+
"-Spath -A:nextjournal/clerk"))]
61+
:dependencies true})}
62+
5463
lint
5564
{:doc "Lint the src and dev directories with clj-kondo."
56-
:task (clj-kondo/print!
57-
(clj-kondo/run! {:lint ["src" "dev"]}))}}}
65+
:task (exec 'clj-kondo.core/exec)
66+
:exec-args {:lint ["src" "dev"]}}}}

build.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
;; ## Variables
1818

1919
(def lib 'org.mentat/mathlive.cljs)
20-
(def version "0.2.0")
20+
(def version "0.2.1")
2121
(def pom-deps
2222
{'org.babashka/sci
2323
{:mvn/version "0.6.37"

deps.edn

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{:paths ["src" "resources"]
2-
:deps {reagent/reagent {:mvn/version "1.1.1"}}
2+
:deps {reagent/reagent {:mvn/version "1.2.0"}}
33

44
:aliases
55
{:nextjournal/clerk
66
{:extra-paths ["dev"]
77
:extra-deps
88
{org.clojure/clojure {:mvn/version "1.11.1"}
99
org.clojure/clojurescript {:mvn/version "1.11.60"}
10-
org.mentat/clerk-utils {:mvn/version "0.4.1"}
10+
org.mentat/clerk-utils {:mvn/version "0.6.0"}
1111

1212
io.github.nextjournal/clerk
13-
{:git/sha "fad499407d979916d21b33cc7e46e73f7a485e37"}
13+
{:git/sha "1f6c5331418aaf9c5a4335fc2e6e95f07dc3af6b"}
1414
io.github.nextjournal/clerk.render
1515
{:git/url "https://github.com/nextjournal/clerk"
16-
:git/sha "fad499407d979916d21b33cc7e46e73f7a485e37"
16+
:git/sha "1f6c5331418aaf9c5a4335fc2e6e95f07dc3af6b"
1717
:deps/root "render"}}
1818
:exec-fn user/build!}
1919

2020
:build
21-
{:deps {io.github.clojure/tools.build {:git/tag "v0.8.2" :git/sha "ba1a2bf"}
21+
{:deps {io.github.clojure/tools.build {:git/tag "v0.9.4" :git/sha "76b78fe"}
2222
slipset/deps-deploy {:mvn/version "0.2.0"}}
2323
:ns-default build}}}

dev/mathlive/notebook.clj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
^#:nextjournal.clerk
2-
{:toc true
3-
:no-cache true
4-
:visibility :hide-ns}
1+
^{:nextjournal.clerk/visibility {:code :hide}}
52
(ns mathlive.notebook
3+
#:nextjournal.clerk{:toc true :no-cache true}
64
(:require [mentat.clerk-utils.docs :as docs]
75
[mentat.clerk-utils.show :refer [show-sci]]
86
[nextjournal.clerk :as clerk]))
97

8+
{::clerk/width :wide}
9+
1010
^{::clerk/visibility {:code :hide :result :hide}}
1111
(clerk/eval-cljs
1212
;; These aliases only apply inside this namespace.
13-
'(require '[mathlive.core :as ml])
14-
'(require '[reagent.core :as reagent]))
13+
'(do (require '[mathlive.core :as ml])
14+
(require '[reagent.core :as reagent])))
1515

1616
;; # MathLive.cljs
1717
;;
@@ -79,6 +79,7 @@
7979
;; These are some styles.
8080
[:style "
8181
math-field {
82+
width: 100%;
8283
font-size: 24px;
8384
border-radius: 4px;
8485
border: 1px solid;
@@ -324,10 +325,12 @@ math-field:focus-within {
324325
;;
325326
;; > The appearance and behavior of the mathfield is highly customizable.
326327
;;
327-
;; The `Mathfield` instances in this notebook have all been customized with the following styles:
328+
;; The `Mathfield` instances in this notebook have all been customized with the
329+
;; following styles:
328330
;;
329331
;;```css
330332
;; math-field {
333+
;; width: 100%;
331334
;; font-size: 24px;
332335
;; border-radius: 4px;
333336
;; border: 1px solid;

0 commit comments

Comments
 (0)