summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md35
1 files changed, 33 insertions, 2 deletions
diff --git a/README.md b/README.md
index a00007c..7d6a5c5 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,12 @@
A Clojure library that parses [microformats](http://microformats.org/). Under the hood, it's a thin wrapper of a [Extism](https://extism.org/) plugin written in Go (source of which is also in this repository), and the plugin itself is a wrapper of Will Norris' [microformats parser](https://github.com/willnorris/microformats). *Yes, that's a lot of wrappers! I have a good excuse for that.*
+---
+
## How It Works
1. `go/main.go` defines `parse()` function, which wraps [microformats.Parse()](https://pkg.go.dev/willnorris.com/go/microformats#Parse) and makes it callable after compiled to WebAssembly.
-2. `src/mf2clj/core.clj` loads compile `mf2go.wasm` from `resources/` and calls `parse`.
+2. `src/mf2clj/core.clj` loads compiled `mf2go.wasm` from `resources/` and calls `parse`.
3. User/client calls `mf2clj.core/parse` with no knowledge of the wrappers and WebAssembly.
The code is so simple that you're probably better off copy-pasting it to your codebase directly.
@@ -60,7 +62,7 @@ Seriously, that's all of it.
microformats is a very *niche* standard that's only popular*-ish* in the [IndieWeb](https://indieweb.org/) community. Clojure is more niche even within this small community. It makes no sense to develop and maintain a *native* Clojure parser.
-Currently, the closest thing available is [this library](https://codeberg.org/alinnow/microformats) by [Alin](https://codeberg.org/alinnow), whose last commit was in 2014. The next best thing would be a Java library since Clojure can call Java code with no problem, but [mf2j](https://github.com/karadaisy/mf2j) hasn't been updated since 2026. Both libraries is **incomplete**.
+Currently, the closest thing available is [this library](https://codeberg.org/alinnow/microformats) by [Alin](https://codeberg.org/alinnow), whose last commit was in 2014. The next best thing would be a Java library since Clojure can call Java code with no problem, but [mf2j](https://github.com/karadaisy/mf2j) hasn't been updated since 2016. Both libraries are **incomplete**.
I see no reason why a new Clojure/Java parser wouldn't be abandoned either.
@@ -70,3 +72,32 @@ Programming languages aren't really a barrier any more. Many languages can compi
I suppose I could use [Rust](https://crates.io/crates/microformats/0.2.0), but it doesn't really make a difference.
+---
+
+## Usage
+
+> [!note]
+> *I'm still working on publishing to Clojars.*
+
+```clojure
+(require '[mf2clj.core :as mf2clj])
+(mf2clj/parse html-string)
+```
+
+## Development
+
+```sh
+# compile Go to WebAssembly (WASIP1)
+make build-wasm
+
+# compile Clojure wrapper to .jar
+make build-jar # or lein uberjar
+
+# compile both
+make build
+```
+
+## License
+
+mf2clj is free software licensed under the GNU Affero General Public License.
+