Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

practicalli-johnny/landing-page

Repository files navigation

SciCloj landing-page

DEPRECATED: an example web page to elicit requirements from the community, which didnt really arise

The main landing page for the SciCloj Clojure data science community, the starting page for discovering the SciCloj community activities and learning about relevant projects.

Bulma.io CSS library and Font Awesome icons are included in the project to assist with the visual design of the landing page. Bulma styles can be applied to Clojure hiccup-style syntax, [:h2 {:class "title has-text-centered"} "A Centered title"]. See the practicalli/landing-page app for more examples

Basic Design

resources/public/index.html loads the ClojureScript application at the <div id="app"></div> location. Using the <script src="cljs-out/dev-main.js" type="text/javascript"> declaration that points to the file generated by building the ClojureScript application.

The main page of the ClojureScript application is defined in the scicloj.landing-page/page function, as configured in the (defn mount [element] (rdom/render [page] element)) system function.

Development

Project created with clj-new and Clojure CLI tools

clojure -X:project/new :template figwheel-main :name scicloj/landing-page :args '["--reagent"]'

To get an interactive development environment run:

clojure -M:figwheel:build

This will auto compile and send all changes to the browser without the need to reload. After the compilation process is complete, you will get a Browser Connected REPL. An easy way to try it is:

(js/alert "Am I connected?")

and you should see an alert in the browser window.

Using an editor and terminal REPL

Start a REPL in the terminal with support for nREPL and CIDER middleware (Cider, Calva, Conjure)

clojure -M:figwheel:middleware/cider-cljs

Open the project in the editor and with deps.edn or a .cljs file open from the project, select the connect command in the editor.

Select Clojure CLI tools

Select figwheel-main

Select dev build

Using an Editor to Jack-in

Cider and Calva should start the project correctly, as long as the :figwheel alias is added to the jack-in command.

In Cider, use C-u (SPC-u in Spacemacs) followed by the cider-jack-in-cljs command to edit the Leiningen or Clojure CLI command and add :figwheel to the existing alias on the command line shown in the mini-buffer

In Calva, select the :figwheel checkbox for aliases

Test project

Run project tests using the command:

clojure -M:figwheel:test

Build project

To clean all compiled files:

rm -rf target/public

Create a build in the /docs directory and

rm -rf target/public
clojure -M:figwheel:live

Commit the changed /docs/js/scicloj-landing-page.js file to the Git repository and push to GitHub. After a few minutes the new version of the landing page will be available at https://scicloj.github.io/scicloj/landing-page-application

License

Copyright © 2018 SciCloj

Distributed under the Creative Commons Attribution Share-Alike 4.0 International

About

A proposed new landing page for the SciCloj community

Resources

Code of conduct

Stars

Watchers

Forks