diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c8a8e84..73687768 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,47 +29,6 @@ jobs: yarn squint compile node dist/nextjournal/clojure_mode_tests.mjs - squint: - name: Static App / Squint Build - runs-on: ubuntu-latest - steps: - - name: π Checkout - uses: actions/checkout@v2 - - - name: π Google Auth - uses: google-github-actions/auth@v0 - with: - credentials_json: ${{ secrets.GCLOUD_SERVICE_KEY }} - - - name: π§ Setup Google Cloud SDK - uses: google-github-actions/setup-gcloud@v0.3.0 - - - name: π§ Install java - uses: actions/setup-java@v1 - with: - java-version: '11.0.7' - - - name: π§ Install clojure - uses: DeLaGuardo/setup-clojure@master - with: - bb: 'latest' - - - name: π Build Squint static CDN Demo - run: bb squint:demo:build - - - name: π Copy static build to bucket under SHA - run: gsutil cp -r public gs://nextjournal-snapshots/clojure-mode/squint-build/${{ github.sha }} - - - name: β Add link to Clojure Mode Squint Demo - uses: Sibz/github-status-action@v1 - with: - authToken: ${{secrets.GITHUB_TOKEN}} - context: 'CI / Static App / Squint' - description: 'Ready' - state: 'success' - sha: ${{github.event.pull_request.head.sha || github.sha}} - target_url: https://snapshots.nextjournal.com/clojure-mode/squint-build/${{ github.sha }}/squint-cdn-demo - snapshot: name: Static App / Build runs-on: ubuntu-latest @@ -127,6 +86,16 @@ jobs: sha: ${{github.event.pull_request.head.sha || github.sha}} target_url: https://snapshots.nextjournal.com/clojure-mode/build/${{ github.sha }} + - name: β Add link to Clojure Mode Demo + uses: Sibz/github-status-action@v1 + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: 'CI / Static App / Squint Build' + description: 'Ready' + state: 'success' + sha: ${{github.event.pull_request.head.sha || github.sha}} + target_url: https://snapshots.nextjournal.com/clojure-mode/build/${{ github.sha }}/squint/dist/ + - name: β Add link to LiveDoc Demo uses: Sibz/github-status-action@v1 with: diff --git a/demo/notebooks/livedoc.md b/demo/notebooks/livedoc.md index 587e0c99..8b568e84 100644 --- a/demo/notebooks/livedoc.md +++ b/demo/notebooks/livedoc.md @@ -20,8 +20,36 @@ Here's some of Clerk's API in action :projection {:type "albersUsa"} :encoding {:color {:field "rate" :type "quantitative"}}}) ``` +## Usage + +Use livedoc `editor` function as a reagent component in your cljs application + + [nextjournal.clojure-mode.livedoc/editor opts] + +this puts together an instance of CodeMirror with markdown and clojure mixed language support with a set of extensions configurable via an `opts` map with keys: -Compose results layout with `v/row` and `v/col` +* `:doc` (required) a markdown string + +* `:render` a function taking a reagent state atom, returning hiccup. Such state holds a map with: + * `:text` the block's text + * `:type` with values `:code` or `:markdown` + * `:selected?` + +* `:eval-fn!` will be called on selected block states when evaluation is triggered + +* `:tooltip` customises tooltip view + +* `:extensions` extra CodeMirror extensions to be added along livedoc ones + +* `:focus?` should editor acquire focus when loaded + +## Keybindings + +* `ESC`: toggles edit-one / edit-all / preview & select block +* `ALT`: pressed while in edit mode toggles a tooltip with eval-at-cursor results +* Arrow keys move selection up/down +* `CMD + Enter` : Evaluate selected cell or leave edit mode +* `CMD + Shift + Enter`: Evaluates all cells ```clojure (def pie @@ -83,37 +111,6 @@ The following example is taken from this [Observable notebook](https://observabl (v/plotly {:data [{:y (shuffle (range -100 100))}]}) ``` -## Usage - -Use livedoc `editor` function as a reagent component in your cljs application - - [nextjournal.clojure-mode.livedoc/editor opts] - -this puts together an instance of CodeMirror with markdown and clojure mixed language support with a set of extensions configurable via an `opts` map with keys: - -* `:doc` (required) a markdown string - -* `:render` a function taking a reagent state atom, returning hiccup. Such state holds a map with: - * `:text` the block's text - * `:type` with values `:code` or `:markdown` - * `:selected?` - -* `:eval-fn!` will be called on selected block states when evaluation is triggered - -* `:tooltip` customises tooltip view - -* `:extensions` extra CodeMirror extensions to be added along livedoc ones - -* `:focus?` should editor acquire focus when loaded - -## Keybindings - -* `ESC`: toggles edit-one / edit-all / preview & select block -* `ALT`: pressed while in edit mode toggles a tooltip with eval-at-cursor results -* Arrow keys move selection up/down -* `CMD + Enter` : Evaluate selected cell or leave edit mode -* `CMD + Shift + Enter`: Evaluates all cells - ```clojure (defonce state (atom 0)) ``` diff --git a/public/index.html b/public/index.html index bafb199f..b45e109a 100644 --- a/public/index.html +++ b/public/index.html @@ -5,13 +5,10 @@