Skip to content

Commit

Permalink
Remove goog.object references, support SCI evaluation (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
sritchie authored Jun 9, 2023
1 parent f6e1001 commit 5dc9604
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 239 deletions.
2 changes: 1 addition & 1 deletion .dir-locals.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. ((cider-default-cljs-repl . node)))
(clojure-mode
. ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . ":dev:clerk"))))
(cider-clojure-cli-aliases . ":nextjournal/clerk"))))
17 changes: 8 additions & 9 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,28 @@ jobs:
steps:
- uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }}
restore-keys: ${{ runner.os }}-m2
path: |
.cpcache
.shadow-cljs
~/.m2
key: "1"

- name: Checkout
uses: actions/checkout@v3

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@4.0
uses: DeLaGuardo/setup-clojure@master
with:
cli: latest
bb: latest
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install babashka
uses: just-sultanov/setup-babashka@v2
with:
version: '0.8.156'

- name: Build static site
run: bb build-static

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public/build
11 changes: 7 additions & 4 deletions .github/workflows/kondo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Install babashka
uses: just-sultanov/setup-babashka@v2
- name: Install Babashka
uses: DeLaGuardo/setup-clojure@10.2
with:
version: '0.8.156'
bb: latest

- name: Cache kondo directory
uses: actions/cache@v2
Expand All @@ -24,5 +24,8 @@ jobs:
key: ${{ runner.os }}-kondo
restore-keys: ${{ runner.os }}-kondo

- name: Run clj-kondo
- name: Lint dependencies
run: bb lint-deps

- name: Lint project files
run: bb lint --config '{:output {:pattern "::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"}}'
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## [unreleased]

## [0.2.1]

- #15:

- removes the `goog.object` to make the library compatible with SCI
evaluation, needed by Portal.

- adds various build upgrades, (Clerk, Kondo etc)

## [0.2.0]

The interactive docs page is now published to https://mathlive.mentat.org.
Expand Down
21 changes: 15 additions & 6 deletions bb.edn
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{:deps {org.babashka/http-server {:mvn/version "0.1.11"}
org.babashka/cli {:mvn/version "0.2.23"}}
:pods {clj-kondo/clj-kondo {:version "2023.01.20"}}
org.babashka/cli {:mvn/version "0.2.23"}
io.github.clj-kondo/clj-kondo-bb
{:git/tag "v2023.01.20" :git/sha "adfc7df"}}
:tasks
{:requires ([babashka.cli :as cli]
[pod.borkdude.clj-kondo :as clj-kondo])
{:requires ([babashka.cli :as cli])
:init
(do (def cli-opts
(cli/parse-opts *command-line-args* {:coerce {:port :int}}))
Expand Down Expand Up @@ -51,7 +51,16 @@
{:doc "Release the library to Clojars."
:task (shell "clojure -T:build publish")}

lint-deps
{:requires ([clj-kondo.core :as kondo])
:doc "Lint dependencies."
:task (kondo/run!
{:lint [(with-out-str
(babashka.tasks/clojure
"-Spath -A:nextjournal/clerk"))]
:dependencies true})}

lint
{:doc "Lint the src and dev directories with clj-kondo."
:task (clj-kondo/print!
(clj-kondo/run! {:lint ["src" "dev"]}))}}}
:task (exec 'clj-kondo.core/exec)
:exec-args {:lint ["src" "dev"]}}}}
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;; ## Variables

(def lib 'org.mentat/mathlive.cljs)
(def version "0.2.0")
(def version "0.2.1")
(def pom-deps
{'org.babashka/sci
{:mvn/version "0.6.37"
Expand Down
10 changes: 5 additions & 5 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{:paths ["src" "resources"]
:deps {reagent/reagent {:mvn/version "1.1.1"}}
:deps {reagent/reagent {:mvn/version "1.2.0"}}

:aliases
{:nextjournal/clerk
{:extra-paths ["dev"]
:extra-deps
{org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/clojurescript {:mvn/version "1.11.60"}
org.mentat/clerk-utils {:mvn/version "0.4.1"}
org.mentat/clerk-utils {:mvn/version "0.6.0"}

io.github.nextjournal/clerk
{:git/sha "fad499407d979916d21b33cc7e46e73f7a485e37"}
{:git/sha "1f6c5331418aaf9c5a4335fc2e6e95f07dc3af6b"}
io.github.nextjournal/clerk.render
{:git/url "https://github.com/nextjournal/clerk"
:git/sha "fad499407d979916d21b33cc7e46e73f7a485e37"
:git/sha "1f6c5331418aaf9c5a4335fc2e6e95f07dc3af6b"
:deps/root "render"}}
:exec-fn user/build!}

:build
{:deps {io.github.clojure/tools.build {:git/tag "v0.8.2" :git/sha "ba1a2bf"}
{:deps {io.github.clojure/tools.build {:git/tag "v0.9.4" :git/sha "76b78fe"}
slipset/deps-deploy {:mvn/version "0.2.0"}}
:ns-default build}}}
17 changes: 10 additions & 7 deletions dev/mathlive/notebook.clj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
^#:nextjournal.clerk
{:toc true
:no-cache true
:visibility :hide-ns}
^{:nextjournal.clerk/visibility {:code :hide}}
(ns mathlive.notebook
#:nextjournal.clerk{:toc true :no-cache true}
(:require [mentat.clerk-utils.docs :as docs]
[mentat.clerk-utils.show :refer [show-sci]]
[nextjournal.clerk :as clerk]))

{::clerk/width :wide}

^{::clerk/visibility {:code :hide :result :hide}}
(clerk/eval-cljs
;; These aliases only apply inside this namespace.
'(require '[mathlive.core :as ml])
'(require '[reagent.core :as reagent]))
'(do (require '[mathlive.core :as ml])
(require '[reagent.core :as reagent])))

;; # MathLive.cljs
;;
Expand Down Expand Up @@ -79,6 +79,7 @@
;; These are some styles.
[:style "
math-field {
width: 100%;
font-size: 24px;
border-radius: 4px;
border: 1px solid;
Expand Down Expand Up @@ -324,10 +325,12 @@ math-field:focus-within {
;;
;; > The appearance and behavior of the mathfield is highly customizable.
;;
;; The `Mathfield` instances in this notebook have all been customized with the following styles:
;; The `Mathfield` instances in this notebook have all been customized with the
;; following styles:
;;
;;```css
;; math-field {
;; width: 100%;
;; font-size: 24px;
;; border-radius: 4px;
;; border: 1px solid;
Expand Down
Loading

0 comments on commit 5dc9604

Please sign in to comment.