fix bugs in page

This commit is contained in:
didier amyot committed 2018-01-27 11:50:00 -05:00
1 parent 6ed638a1cc
commit e654fdfea6
387 files changed
+13618 -88879

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
(ns website.core
(:require [reagent.core :as reagent :refer [atom]]
[secretary.core :as secretary :include-macros true]
[accountant.core :as accountant]
[website.tobbar :refer [topbar]]
[website.home :refer [home-page]]))
;; -------------------------
;; Routes
(defonce page (atom #'home-page))
(defn current-page []
[:div
[topbar]
[:div.columns
[:div.column.is-offset-1.is-10
[:br]
[@page]]]])
(secretary/defroute "/" []
(reset! page #'home-page))
;; -------------------------
;; Initialize app
(defn mount-root []
(reagent/render [current-page] (.getElementById js/document "app")))
(defn init! []
(accountant/configure-navigation!
{:nav-handler
(fn [path]
(secretary/dispatch! path))
:path-exists?
(fn [path]
(secretary/locate-route path))})
(accountant/dispatch-current!)
(mount-root))
+46
View File
@@ -0,0 +1,46 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.core');
goog.require('cljs.core');
goog.require('cljs.core.constants');
goog.require('reagent.core');
goog.require('secretary.core');
goog.require('accountant.core');
goog.require('website.tobbar');
goog.require('website.home');
if(typeof website.core.page !== 'undefined'){
} else {
website.core.page = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(new cljs.core.Var(function(){return website.home.home_page;},cljs.core.cst$sym$website$home_SLASH_home_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$website$home,cljs.core.cst$sym$home_DASH_page,"src/cljs/website/home.cljs",16,1,10,10,cljs.core.list(cljs.core.PersistentVector.EMPTY),null,(cljs.core.truth_(website.home.home_page)?website.home.home_page.cljs$lang$test:null)])));
}
website.core.current_page = (function website$core$current_page(){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [website.tobbar.topbar], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$columns,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$column$is_DASH_offset_DASH_1$is_DASH_10,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$br], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.deref(website.core.page)], null)], null)], null)], null);
});
var action__15020__auto___15174 = (function (params__15021__auto__){
if(cljs.core.map_QMARK_(params__15021__auto__)){
var map__15169 = params__15021__auto__;
var map__15169__$1 = ((((!((map__15169 == null)))?((((map__15169.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__15169.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.cljs$core$IFn$_invoke$arity$2(cljs.core.hash_map,map__15169):map__15169);
return cljs.core.reset_BANG_(website.core.page,new cljs.core.Var(function(){return website.home.home_page;},cljs.core.cst$sym$website$home_SLASH_home_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$website$home,cljs.core.cst$sym$home_DASH_page,"src/cljs/website/home.cljs",16,1,10,10,cljs.core.list(cljs.core.PersistentVector.EMPTY),null,(cljs.core.truth_(website.home.home_page)?website.home.home_page.cljs$lang$test:null)])));
} else {
if(cljs.core.vector_QMARK_(params__15021__auto__)){
var vec__15171 = params__15021__auto__;
return cljs.core.reset_BANG_(website.core.page,new cljs.core.Var(function(){return website.home.home_page;},cljs.core.cst$sym$website$home_SLASH_home_DASH_page,cljs.core.PersistentHashMap.fromArrays([cljs.core.cst$kw$ns,cljs.core.cst$kw$name,cljs.core.cst$kw$file,cljs.core.cst$kw$end_DASH_column,cljs.core.cst$kw$column,cljs.core.cst$kw$line,cljs.core.cst$kw$end_DASH_line,cljs.core.cst$kw$arglists,cljs.core.cst$kw$doc,cljs.core.cst$kw$test],[cljs.core.cst$sym$website$home,cljs.core.cst$sym$home_DASH_page,"src/cljs/website/home.cljs",16,1,10,10,cljs.core.list(cljs.core.PersistentVector.EMPTY),null,(cljs.core.truth_(website.home.home_page)?website.home.home_page.cljs$lang$test:null)])));
} else {
return null;
}
}
});
secretary.core.add_route_BANG_("/",action__15020__auto___15174);
website.core.mount_root = (function website$core$mount_root(){
return reagent.core.render.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [website.core.current_page], null),document.getElementById("app"));
});
website.core.init_BANG_ = (function website$core$init_BANG_(){
accountant.core.configure_navigation_BANG_(new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$nav_DASH_handler,(function (path){
return secretary.core.dispatch_BANG_(path);
}),cljs.core.cst$kw$path_DASH_exists_QMARK_,(function (path){
return secretary.core.locate_route(path);
})], null));
accountant.core.dispatch_current_BANG_();
return website.core.mount_root();
});
+27
View File
@@ -0,0 +1,27 @@
(ns website.home
(:require [website.logo :refer [logo]]
[website.notebook :refer [notebook]]))
(defn important [w]
[:span.has-text-weight-semibold w])
(defn home-page []
[:div.columns
[:div.column
[:article.message
[:div.message-body
[:p.subtitle (important "Clojupyter") " brings " (important "clojure") " to the " (important "jupyter notebook") "."]
[:article.content
[:p "Enjoy the full Clojure repl experience with…"]
[:ul
[:li "Full jupyter notebook support"]
[:li "Charting"]
[:li [notebook "geom.ipynb" "Latex, Markdown, HTML and Hiccup"]]
[:li "parinfer"]
[:li "Leiningen integration"]]]]]]
[:div.column.is-flex-tablet.has-text-centered {:style {:justify-content "center" :flex-direction "column"}}
[:span.title {:style {:width "100%"}}
[logo 133]]]])
+12
View File
@@ -0,0 +1,12 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.home');
goog.require('cljs.core');
goog.require('cljs.core.constants');
goog.require('website.logo');
goog.require('website.notebook');
website.home.important = (function website$home$important(w){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span$has_DASH_text_DASH_weight_DASH_semibold,w], null);
});
website.home.home_page = (function website$home$home_page(){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$columns,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$column,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$article$message,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$message_DASH_body,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p$subtitle,website.home.important("Clojupyter")," brings ",website.home.important("clojure")," to the ",website.home.important("jupyter notebook"),"."], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$article$content,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$p,"Enjoy the full Clojure repl experience with\u2026"], null),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$ul,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li,"Full jupyter notebook support"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li,"Charting"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [website.notebook.notebook,"geom.ipynb","Latex, Markdown, HTML and Hiccup"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li,"parinfer"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$li,"Leiningen integration"], null)], null)], null)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$column$is_DASH_flex_DASH_tablet$has_DASH_text_DASH_centered,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$style,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$justify_DASH_content,"center",cljs.core.cst$kw$flex_DASH_direction,"column"], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span$title,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$style,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$width,"100%"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [website.logo.logo,(133)], null)], null)], null)], null);
});
+4
View File
@@ -0,0 +1,4 @@
(ns website.logo)
(defn logo [size]
[:img {:src "images/clojupyter-logo.svg" :height size :width (* 3 size) :alt "clojure logo"}])
+7
View File
@@ -0,0 +1,7 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.logo');
goog.require('cljs.core');
goog.require('cljs.core.constants');
website.logo.logo = (function website$logo$logo(size){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$img,new cljs.core.PersistentArrayMap(null, 4, [cljs.core.cst$kw$src,"images/clojupyter-logo.svg",cljs.core.cst$kw$height,size,cljs.core.cst$kw$width,((3) * size),cljs.core.cst$kw$alt,"clojure logo"], null)], null);
});
+7
View File
@@ -0,0 +1,7 @@
(ns website.notebook)
(def root "http://nbviewer.jupyter.org/github/didiercrunch/graphly/blob/master/")
(defn notebook [name msg]
(let [url-safe-name (js/encodeURIComponent name)]
[:a {:href (str root url-safe-name)} msg]))
+9
View File
@@ -0,0 +1,9 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.notebook');
goog.require('cljs.core');
goog.require('cljs.core.constants');
website.notebook.root = "http://nbviewer.jupyter.org/github/didiercrunch/graphly/blob/master/";
website.notebook.notebook = (function website$notebook$notebook(name,msg){
var url_safe_name = encodeURIComponent(name);
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$a,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$href,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(website.notebook.root),cljs.core.str.cljs$core$IFn$_invoke$arity$1(url_safe_name)].join('')], null),msg], null);
});
+7
View File
@@ -0,0 +1,7 @@
(ns website.prod
(:require [website.core :as core]))
;;ignore println statements in prod
(set! *print-fn* (fn [& _]))
(core/init!)
+27
View File
@@ -0,0 +1,27 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.prod');
goog.require('cljs.core');
goog.require('cljs.core.constants');
goog.require('website.core');
cljs.core._STAR_print_fn_STAR_ = (function() {
var G__15177__delegate = function (_){
return null;
};
var G__15177 = function (var_args){
var _ = null;
if (arguments.length > 0) {
var G__15178__i = 0, G__15178__a = new Array(arguments.length - 0);
while (G__15178__i < G__15178__a.length) {G__15178__a[G__15178__i] = arguments[G__15178__i + 0]; ++G__15178__i;}
_ = new cljs.core.IndexedSeq(G__15178__a,0,null);
}
return G__15177__delegate.call(this,_);};
G__15177.cljs$lang$maxFixedArity = 0;
G__15177.cljs$lang$applyTo = (function (arglist__15179){
var _ = cljs.core.seq(arglist__15179);
return G__15177__delegate(_);
});
G__15177.cljs$core$IFn$_invoke$arity$variadic = G__15177__delegate;
return G__15177;
})()
;
website.core.init_BANG_();
+19
View File
@@ -0,0 +1,19 @@
(ns website.tobbar
(:require [website.logo :refer [logo]]))
(def github-link
[:a.title.is-5 {:href "https://github.com/clojupyter"}
[:i.fab.fa-github]])
(defn topbar []
[:div
[:nav.navbar.is-primary.is-transparent {:role "navigation" :aria-label "main navigation"}
[:div.navbar-brand
[:a.navbar-item
[logo 30]
[:span.title {:style {:margin-left "0.5em"}} "clojupyter"]]]
[:div.navbar-end
[:a.navbar-item
[:span github-link]]]]])
+9
View File
@@ -0,0 +1,9 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.tobbar');
goog.require('cljs.core');
goog.require('cljs.core.constants');
goog.require('website.logo');
website.tobbar.github_link = new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$a$title$is_DASH_5,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$href,"https://github.com/clojupyter"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$i$fab$fa_DASH_github], null)], null);
website.tobbar.topbar = (function website$tobbar$topbar(){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$nav$navbar$is_DASH_primary$is_DASH_transparent,new cljs.core.PersistentArrayMap(null, 2, [cljs.core.cst$kw$role,"navigation",cljs.core.cst$kw$aria_DASH_label,"main navigation"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$navbar_DASH_brand,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$a$navbar_DASH_item,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [website.logo.logo,(30)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span$title,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$style,new cljs.core.PersistentArrayMap(null, 1, [cljs.core.cst$kw$margin_DASH_left,"0.5em"], null)], null),"clojupyter"], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$div$navbar_DASH_end,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$a$navbar_DASH_item,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.cst$kw$span,website.tobbar.github_link], null)], null)], null)], null)], null);
});
+6
View File
@@ -0,0 +1,6 @@
(ns website.util)
(defn foo-cljc [x]
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
+10
View File
@@ -0,0 +1,10 @@
// Compiled by ClojureScript 1.9.946 {:static-fns true, :optimize-constants true}
goog.provide('website.util');
goog.require('cljs.core');
goog.require('cljs.core.constants');
website.util.foo_cljc = (function website$util$foo_cljc(x){
new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [x], null);
return cljs.core.println.cljs$core$IFn$_invoke$arity$variadic(cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([x,"Hello, World!"], 0));
});