Skip to content

Commit

Permalink
prep for release (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
sritchie authored Dec 2, 2022
1 parent 5d8e79b commit 429a5e8
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 99 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Changelog

## unreleased
## [unreleased]

- More soon.
## 0.1.0

- Added final `Mathfield component`

- Published fleshed-out documentation notebook at https://mentat-collective.github.io/mathlive.cljs

- Upgraded `mathlive` to `0.86.0` and `compute-engine` to `0.12.2`

## 0.0.1

First release!
- First release!
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; ## Variables

(def lib 'org.mentat/mathlive.cljs)
(def version "0.0.1")
(def version "0.1.0")

(defn- ->version
([] version)
Expand Down
3 changes: 2 additions & 1 deletion dev/mathlive/clerk_ui.cljc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns mathlive.clerk-ui
(:require #?(:cljs [mathlive.core])
(:require #?(:cljs ["@cortex-js/compute-engine"])
#?(:cljs [mathlive.core])
#?(:clj [nextjournal.clerk :as clerk])
#?(:cljs [nextjournal.clerk.sci-viewer :as sv])
#?(:cljs [sci.core :as sci]))
Expand Down
67 changes: 65 additions & 2 deletions dev/mathlive/notebook.clj
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ math-field:focus-within {
:on-change on-change}]
[:h4 "Text Area"]
[:textarea
{:style {:width "100%" :border "0.5px solid"}
{:style
{:width "100%"
:border "1px solid"
:border-radius "4px"
:font-size "20px"
:padding "8px"}
:value @!tex
:on-change on-change}]]))

Expand Down Expand Up @@ -294,6 +299,50 @@ math-field:focus-within {
assoc
"cake" "\\Gamma"))}])

;; ### Styling
;;
;; From MathLive's [guide on customization](https://cortexjs.io/mathlive/guides/customizing/):
;;
;; > The appearance and behavior of the mathfield is highly customizable.
;;
;; The `Mathfield` instances in this notebook have all been customized with the following styles:
;;
;;```css
;; math-field {
;; font-size: 24px;
;; border-radius: 4px;
;; border: 1px solid;
;; padding: 8px;
;; }
;; math-field:focus-within {
;; outline: none;
;; border: 1px solid blue;
;; }
;;```
;;
;; ### Fonts and Sounds
;;
;; By default, `Mathfield` instances attempt to load fonts and sounds from
;; `/dist/fonts` and `/dist-sounds`, respectively, of the route serving the
;; `Mathfield`.
;;
;; You can customize fonts with a `"fonts-directory"` attribute or
;; `fontsDirectory` option. See the [fonts
;; guide](https://cortexjs.io/mathlive/guides/customizing/#fonts) for more
;; details.
;;
;; To customize the sounds location, use the `"sounds-directory"` attribute or
;; `soundsDirectory` option.
;;
;; For more details on both of these options, see
;; the [`CoreOptions`](https://cortexjs.io/docs/mathlive/#(CoreOptions%3Atype))
;; documentation.
;;
;; If you want to set these without serving them yourself, `mathlive.cljs`
;; provides and `mathlive.core/cdn-fonts` and `mathlive.core/cdn-sounds` vars
;; that point to the CDN distribution of the currently loaded version of
;; `mathlive`.

;; ## MathJSON
;;
;; The default value format for a `Mathfield` is `"latex"`, but the component
Expand All @@ -306,7 +355,21 @@ math-field:focus-within {
;; tooling to extract MathJSON from a `Mathfield` parsed into Clojure data
;; structures.
;;
;; This example pulls both LaTeX and MathJSON from a `Mathfield`.
;; To use any of the MathJSON features you'll need to require the
;; `@cortex-js/compute-engine` dependency somewhere in your codebase:
;;
;; ```clj
;; (ns my-app
;; (:require [mathlive.core :as ml]
;; [reagent.core :as reagent]
;; ;; included for side effects
;; ["@cortex-js/compute-engine"]))
;; ```
;;
;; ### Extracting MathJSON
;;
;; The following example example pulls both LaTeX and MathJSON from a
;; `Mathfield`.
;;
;; First, create a `reagent/atom` to store the values:

Expand Down
4 changes: 2 additions & 2 deletions dev/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
(clerk/show! "dev/mathlive/notebook.clj"))

(defn github-pages! [_]
;; TODO this now defaults to a project page. Do we want to change this?
(swap! config/!resource->url merge {"/js/viewer.js" "/mathlive.cljs/js/main.js"})
(swap! config/!resource->url merge
{"/js/viewer.js" "/mathlive.cljs/js/main.js"})
(clerk/build!
{:index "dev/mathlive/notebook.clj"
:bundle? false
Expand Down
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "mathlive.cljs",
"version": "0.0.1",
"version": "0.1.0",
"dependencies": {
"@cortex-js/compute-engine": "^0.12.1",
"@mentatcollective/mathlive": "0.85.2"
"@cortex-js/compute-engine": "^0.12.2",
"mathlive": "^0.86.0"
},
"devDependencies": {
"@babel/core": "^7.17.9",
Expand Down
4 changes: 2 additions & 2 deletions src/deps.cljs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:npm-deps
{"@cortex-js/compute-engine" "^0.12.1",
"@mentatcollective/mathlive" "0.85.2"}}
{"@cortex-js/compute-engine" "^0.12.2",
"mathlive" "^0.86.0"}}
Loading

0 comments on commit 429a5e8

Please sign in to comment.