Skip to content

Commit

Permalink
Only release cljs files
Browse files Browse the repository at this point in the history
  • Loading branch information
mynomoto committed Apr 23, 2017
1 parent f7f6067 commit 58a9d80
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
target
.nrepl-*
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#Hoplon Highlight
# Hoplon Highlight
A wrapper to use highlight-js on Hoplon projects

#Latest version
# Latest version
[](dependency)
```clojure
[hoplon/highlight "8.4.0-0"] ;; latest release
```
[](/dependency)

#Usage
# Usage
```clojure
(ns application.core
(:require [hoplon.highlight :as hl]))
Expand Down
5 changes: 3 additions & 2 deletions boot.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
BOOT_CLOJURE_VERSION=1.9.0-alpha5
BOOT_VERSION=2.6.0
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0-alpha15
BOOT_VERSION=2.7.1
BOOT_EMIT_TARGET=no
45 changes: 27 additions & 18 deletions build.boot
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
(set-env!
:resource-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.9.0-alpha5" :scope "provided"]
:dependencies '[[org.clojure/clojure "1.9.0-alpha15" :scope "provided"]
[org.clojure/clojurescript "1.9.521" :scope "provided"]

[org.clojure/clojurescript "1.9.36" :scope "provided"]
[adzerk/boot-cljs "1.7.228-1" :scope "provided"]
[adzerk/boot-cljs "1.7.228-1" :scope "test"]

[adzerk/bootlaces "0.1.13" :scope "test"]

[hoplon "6.0.0-alpha16" :scope "provided"]
[hoplon/boot-hoplon "0.1.13" :scope "provided"]
[hoplon "6.0.0-alpha17" :scope "provided"]

[cljsjs/highlight "8.4-0"]])

(require
'[adzerk.bootlaces :refer :all]
'[hoplon.boot-hoplon :refer [hoplon]])

(def +version+ "8.4.0-0")

(task-options!
pom {:project 'hoplon/highlight
:version +version+
pom {:project 'hoplon/highlight
:version "8.4.0-0"
:description "Hoplon wrapper for highlight.js"
:url "https://highlightjs.org/"
:scm {:url "https://github.com/hoplon/highlight"}
:license {"EPL" "http://opensource.org/licenses/eclipse-1.0.php"}}
hoplon {:manifest true})
:url "https://highlightjs.org/"
:scm {:url "https://github.com/hoplon/highlight"}
:license {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}}
push {:repo "deploy-clojars"})

(deftask local-install []
"Build and install the project locally."
(comp
(pom)
(jar)
(install)))

(deftask release []
(merge-env!
:repositories [["deploy-clojars" {:url "https://clojars.org/repo"
:username (System/getenv "CLOJARS_USER")
:password (System/getenv "CLOJARS_PASS")}]])
(comp
(local-install)
(sift :include [#".*\.jar"])
(push)))
20 changes: 20 additions & 0 deletions src/hoplon/highlight.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(ns hoplon.highlight
(:require
[cljsjs.highlight]
[hoplon.core :as h]
[javelin.core :as j]))

(h/defelem highlight
"Element for highlighting code. Class is passed to the code element for
choosing the language."
[{:keys [class]} kids]
(j/with-let [c (h/pre (apply (h/code :class class) kids))]
(h/with-init!
(.highlightBlock js/hljs c))))

(defn highlight-pre-code
"Side-efectful. Highlights all code elements inside pre elements. Those needs
to be in the DOM when this fuction is called."
[]
(.each (js/jQuery "pre code")
(fn [i block] (.highlightBlock js/hljs block))))
13 changes: 0 additions & 13 deletions src/hoplon/highlight.cljs.hl

This file was deleted.

0 comments on commit 58a9d80

Please sign in to comment.