Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhicks committed Nov 2, 2016
1 parent deaffa4 commit e1bdfbd
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/resources/public/example/js/**
!/resources/public/example/js/showcase.js
/resources/public/tutorial/js/**
figwheel_server.log
pom.xml
*jar
Expand Down
18 changes: 16 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
:plugins [[lein-figwheel "0.5.8"]
[lein-cljsbuild "1.1.4" :exclusions [[org.clojure/clojure]]]]

:source-paths ["src" "example_src"]
:source-paths ["src" "example_src" "tutorial_src"]

:clean-targets ^{:protect false} ["resources/public/js/compiled"
"resources/public/example/js"
"resources/public/tutorial/js"
"target"]

:cljsbuild {:builds
Expand All @@ -37,7 +38,20 @@
:compiler {:output-to "resources/public/example/js/showcase.js"
:main example.showcase
:optimizations :simple
:pretty-print false}}]}
:pretty-print false}}

;; temporary: to be moved to separate repo
{:id "tutorial-dev"
:source-paths ["src" "tutorial_src"]

:figwheel {:open-urls ["http://localhost:3449/tutorial.html"]}

:compiler {:main onyx-tutorial.core
:asset-path "tutorial/js/out"
:output-to "resources/public/tutorial/js/tutorial.js"
:output-dir "resources/public/tutorial/js/out"
:source-map-timestamp true
:preloads [devtools.preload]}}]}

:figwheel {:css-dirs ["resources/public/css"]}

Expand Down
8 changes: 0 additions & 8 deletions resources/public/example/js/showcase.js

This file was deleted.

15 changes: 15 additions & 0 deletions resources/public/tutorial.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/codemirror.css">
<link rel="stylesheet" href="css/tutorial.css">
</head>
<body>
<h1>Onyx tutorial</h1>
<div id="app"></div>
<script src="dist/js/cytoscape.js" type="text/javascript"></script>
<script src="tutorial/js/tutorial.js" type="text/javascript"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions src/onyx_blueprint/ui/text.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
(defmethod extensions/component-ui :text/header [props]
(text (om/computed props {:element dom/h2})))

(defmethod extensions/component-ui :text/sub-header [props]
(text (om/computed props {:element dom/h4})))

(defmethod extensions/component-ui :text/body [props]
(text (om/computed props {:element dom/p})))

14 changes: 14 additions & 0 deletions tutorial_src/onyx_tutorial/core.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(ns onyx-tutorial.core
(:require [goog.dom :as gdom]
[onyx-blueprint.api :as api]
[onyx-tutorial.workflow-basics :as workflow-basics]))


(def components
(concat
workflow-basics/components))

(def sections
[workflow-basics/section])

(api/render-tutorial! components sections (gdom/getElement "app"))
29 changes: 29 additions & 0 deletions tutorial_src/onyx_tutorial/workflow-basics.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(ns onyx-tutorial.workflow-basics)

(defn text
([id txt] (text :text/body id text))
([type id txt]
{:component/id id
:component/type type
:content/text txt}))

(def components
[{:component/id ::title
:component/type :text/header
:content/text "Workflows"}

(text ::intro "In Onyx, we represent data control flow using workflows.")

(text ::denoting "Denote a workflow using a vector of vectors.")

(text ::structure-inner "For each inner vector, the first element is a source, and the second element is a destination.")

(text ::structure "The roots of the graph must be input tasks, and the leaves must be output tasks.")
])

(def section
{:section/id :workflow-basics
:section/layout [[::title]
[::intro]]})


0 comments on commit e1bdfbd

Please sign in to comment.