Whichever method you use to start goldly, you should reach it at http://localhost:8000/
.
running systems
and then snippet registry
The snippets are primitive, but demonstrate certain features of goldly:
The easiest way to run the notebook locally is leveraging the clojure
cli
clojure -Sdeps '{:deps {org.pinkgorilla/goldly-bundel {:mvn/version "RELEASE"}}}' -m bundel.run
This lets you see many snippets that you might like.
You need to include the goldly-bundel artefact, which ships a pre-built javascript bundle and already includes many ui-renderers.
You can:
for tools.deps
Add this alias to your deps.edn:
:goldly
{:extra-deps {org.pinkgorilla/goldly-bundel {:mvn/version "RELEASE"}}
:exec-fn goldly-bundel/run
:exec-args {:config {:goldly {:systems [systems.snippet-registry ; if you want snippet browser started
systems.snippet-scratchpad
demo.hello-user
]}}}}
then run it with clojure -X:goldly
.
The source to the demo.hello-user system is in src/demo
An example of project that uses goldly this way is: trateg
for leiningen
In project.clj add the goldly-bundel dependency: [org.pinkgorilla/goldly "0.2.78"]
then add a goldly alias:
{:alias
"goldly"
["run" "-m" "goldly-bundel.run" "goldly-user.edn"]}
Add a goldly-user.edn file:
{:goldly {:systems [systems.snippet-registry ; if you want snippet browser started
systems.snippet-scratchpad
demo.hello-user]}}
run with: lein goldly
You need to add the goldly artefact to build javascript bundle from scratch. This takes more time (npm dependencies have to be downloaded, javascript bundle needs to be compiled), but it allows you to add custom ui renderers to your goldly app.
This configures goldly with your set of ui-renderers.
You have to include the goldly and ui-renderer dependencies, and then add the namespace of the ui-renderer to goldly/extensions. This allows goldly to add the ui extensions to the javascript bundle.
This example adds gorilla-ui to goldly:
for tools.deps Add this alias to your deps.edn:
:goldly
{:extra-deps {org.pinkgorilla/goldly {:mvn/version "RELEASE"}
org.pinkgorilla/gorilla-ui {:mvn/version "RELEASE"}}
:exec-fn goldly-server.app/goldly-server-run!
:exec-args {:profile "watch"
:config {:goldly {:extensions [[pinkgorilla.ui.goldly]
]}}}}
for leiningen
See demo-goldly-bundel for the complete project. Add the alias to project.clj
{:alias
"goldly"
["with-profile" "+goldly" "run" "-m" "goldly-server.app" "watch" "goldly-gorillaui.edn"]}
Add a goldly-gorillaui.edn:
{:goldly {:extensions [[pinkgorilla.ui.goldly]]}}
This option is mainly there for development of goldly. For regular use, the long compile-times are not really sensible.
Clone this repo, then:
run goldly with bundel ui-extensions: clojure -X:goldly
run goldly without ui-extensions clojure -X:goldly-core
The source code of the registry systems is in src/systems
.
The snippets are in resources/snippets/
Compile and run:
clojure -X:goldly :profile '"release"'
clojure -X:goldly :profile '"jetty"'
To test the bundel creation:
clojure -X:bundel-config
cd bundel
./bundel-compile.sh
clojure -X:run
You can get and set the scratchpad data via http api.
Please execute ./script/scratchpad-get.sh
or ./script/scratchpad-set.sh
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close