doc additions/cleanups [skip ci] (#1388)
This commit is contained in:
parent
863c6051bd
commit
9241c81238
3 changed files with 26 additions and 2 deletions
|
|
@ -401,7 +401,7 @@ handling of SIGINT and SIGPIPE. This can be done by setting
|
||||||
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
||||||
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
|
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
|
||||||
- [Babashka CLI](https://blog.michielborkent.nl/babashka-cli.html): turn Clojure functions into CLIs!
|
- [Babashka CLI](https://blog.michielborkent.nl/babashka-cli.html): turn Clojure functions into CLIs!
|
||||||
- [Breakneck Babashka on K8s](Breakneck Babashka on K8s) by Heow Goodman
|
- [Breakneck Babashka on K8s](https://www.linkedin.com/pulse/breakneck-babashka-k8s-heow-goodman/) by Heow Goodman
|
||||||
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/)
|
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/)
|
||||||
- [Detecting inconsistent aliases in a clojure codebase](https://www.youtube.com/watch?v=bf8KLKkCH2g) by Oxalorg
|
- [Detecting inconsistent aliases in a clojure codebase](https://www.youtube.com/watch?v=bf8KLKkCH2g) by Oxalorg
|
||||||
- [I, too, Wrote Myself a Static Site Generator](https://dawranliou.com/blog/i-too-wrote-myself-a-static-site-generator/) by Daw-Ran Liou
|
- [I, too, Wrote Myself a Static Site Generator](https://dawranliou.com/blog/i-too-wrote-myself-a-static-site-generator/) by Daw-Ran Liou
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
- [Simple logger](#simple-logger)
|
- [Simple logger](#simple-logger)
|
||||||
- [Using GZip streams (memo utility)](#using-gzip-streams-to-make-a-note-utility)
|
- [Using GZip streams (memo utility)](#using-gzip-streams-to-make-a-note-utility)
|
||||||
- [Pretty-printing mySQL results](#pretty-printing-mysql-results)
|
- [Pretty-printing mySQL results](#pretty-printing-mysql-results)
|
||||||
|
- [Single page application with Babashka + htmx](#single-page-application-with-babashka--htmx)
|
||||||
|
- [Wikipedia translation](#wikipedia-translation)
|
||||||
|
|
||||||
|
|
||||||
Here's a gallery of useful examples. Do you have a useful example? PR welcome!
|
Here's a gallery of useful examples. Do you have a useful example? PR welcome!
|
||||||
|
|
@ -390,7 +392,7 @@ Example usage:
|
||||||
$ examples/http-server.clj
|
$ examples/http-server.clj
|
||||||
```
|
```
|
||||||
|
|
||||||
See [file-server.clj](file-server.clj).
|
See [http-server.clj](http-server.clj).
|
||||||
|
|
||||||
## Torrent viewer
|
## Torrent viewer
|
||||||
|
|
||||||
|
|
@ -555,3 +557,14 @@ Example of a todo list SPA using Babashka and htmx
|
||||||
See [htmx_todoapp.clj](htmx_todoapp.clj)
|
See [htmx_todoapp.clj](htmx_todoapp.clj)
|
||||||
|
|
||||||
Contributed by [@prestancedesign](https://github.com/prestancedesign).
|
Contributed by [@prestancedesign](https://github.com/prestancedesign).
|
||||||
|
|
||||||
|
## Wikipedia translation
|
||||||
|
|
||||||
|
[wiki-translate.clj](wiki-translate.clj) uses Wikipedia to translate words from English to Dutch (other languages are available).
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
$ bb wiki-translate.clj window
|
||||||
|
"Venster (muur) – Dutch"
|
||||||
|
```
|
||||||
|
|
||||||
|
Shared by Janne Himanka on Clojurians Slack
|
||||||
|
|
|
||||||
11
examples/wiki-translate.clj
Normal file
11
examples/wiki-translate.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bb
|
||||||
|
;; by Janne Himanka shared on Clojurians Slack
|
||||||
|
(require '[babashka.curl :as curl])
|
||||||
|
|
||||||
|
(let [url (str "https://en.wikipedia.org/wiki/" (first *command-line-args*))
|
||||||
|
page (:body (curl/get url))]
|
||||||
|
(cond
|
||||||
|
(re-find #"Disambiguation" page)
|
||||||
|
(doseq [item (map last (re-seq #"<li><a href...wiki/([^\"]+)" page))]
|
||||||
|
(println item))
|
||||||
|
:else (last (re-find #"nl.wikipedia.org/.+?title..([^\"]+)" page))))
|
||||||
Loading…
Reference in a new issue