Merge branch 'master' of github.com:fogus/marginalia
This commit is contained in:
commit
f584077119
3 changed files with 314 additions and 201 deletions
|
@ -2077,7 +2077,101 @@ SyntaxHighlighter.brushes.Clojure.prototype = new SyntaxHighlighter.Highlighter(
|
|||
SyntaxHighlighter.brushes.Clojure.aliases = ['clojure', 'Clojure', 'clj'];
|
||||
|
||||
// vim: ts=2 sw=2 noet
|
||||
</script><script src="./../resources/app.js" type="text/javascript"></script><style type="text/css">/**
|
||||
</script><script type="text/javascript">
|
||||
// hackity-hack
|
||||
|
||||
$(document).ready(function() {
|
||||
var ft = $("#floating-toc")
|
||||
var ul = ft.find('ul')
|
||||
var lis = ft.find('li')
|
||||
|
||||
ul.css('maring', '0px')
|
||||
|
||||
var liHeight = $(lis.get(0)).height()
|
||||
|
||||
ft.css('height', (liHeight) + 'px')
|
||||
|
||||
|
||||
showNs = function(ns) {
|
||||
//this is killing performance, lookup table.
|
||||
//var el = $("[id='floating-toc_" + ns + "']")
|
||||
//var index = lis.index(el)
|
||||
|
||||
var index = 0
|
||||
|
||||
for(i in nsPositions.nss) {
|
||||
if(ns == nsPositions.nss[i]) index = i
|
||||
}
|
||||
|
||||
console.log(index)
|
||||
|
||||
if(index == lastNsIndex) return;
|
||||
|
||||
lastNsIndex = index
|
||||
|
||||
|
||||
ul.animate({marginTop: (-1 * liHeight * index) + 'px'},
|
||||
300)
|
||||
// ul.css('margin-top', (-1 * liHeight * index) + 'px')
|
||||
|
||||
}
|
||||
|
||||
var calcNsPositions = function() {
|
||||
var nss = []
|
||||
var anchors = []
|
||||
var positions = []
|
||||
$.each(lis, function(i, el) {
|
||||
var ns = $(el).attr('id').split('_')[1]
|
||||
nss.push(ns)
|
||||
var a = $("a[name='"+ns+"']")
|
||||
anchors.push(a)
|
||||
positions.push(a.offset().top)
|
||||
console.log(a.offset().top)
|
||||
});
|
||||
|
||||
return {nss: nss, positions: positions}
|
||||
}
|
||||
|
||||
var nsPositions = calcNsPositions()
|
||||
|
||||
console.log(nsPositions)
|
||||
|
||||
var lastNsIndex = -1
|
||||
|
||||
var $window = $(window)
|
||||
|
||||
var currentSection = function(nsp) {
|
||||
|
||||
var ps = nsp.positions
|
||||
var nss = nsp.nss
|
||||
var scroll = $window.scrollTop() + 300
|
||||
var nsIndex = -1
|
||||
for(var i in ps) {
|
||||
var p = ps[i]
|
||||
if(p >= scroll) {
|
||||
nsIndex = i-1
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(nsIndex == -1 && scroll >= ps[0]) {
|
||||
nsIndex = ps.length-1
|
||||
}
|
||||
|
||||
if(nsIndex == -1) nsIndex = 0
|
||||
|
||||
return nss[nsIndex]
|
||||
}
|
||||
|
||||
$(window).scroll(function(e) {
|
||||
showNs(currentSection(nsPositions))
|
||||
})
|
||||
|
||||
ul.css('margin-top', '0px')
|
||||
|
||||
})
|
||||
</script><style type="text/css">/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/SyntaxHighlighter
|
||||
*
|
||||
|
@ -2431,7 +2525,7 @@ SyntaxHighlighter.brushes.Clojure.aliases = ['clojure', 'Clojure', 'clj'];
|
|||
font-style: italic !important;
|
||||
color: #2a00ff !important;
|
||||
}
|
||||
</style><style type="text/css">html{margin:0;padding:0;}h1{margin:0;padding:0;}h2{margin:0;padding:0;}h3{margin:0;padding:0;}h4{margin:0;padding:0;}body{margin:0;padding:0;font-family:'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;;font-size:16px;color:#252519;}.toc-link{font-size:12px;margin-left:10px;color:#252519;text-decoration:none;}.toc-link:hover{color:#5050A6;}.docs-header{border-bottom:dotted #aaa 1px;padding-bottom:10px;margin-bottom:25px;}.anchor{text-decoration:none;color:#252519;}.anchor:hover{color:#5050A6;}.toc h1{font-size:34px;margin:0;}h1{font-size:20px;margin-top:0;}h1.project-name{font-size:34px;display:inline;}h2.project-version{font-size:18px;margin-top:0;display:inline;margin-left:10px;}table{border-spacing:0;border-bottom:solid #ddd 1px;;margin-bottom:10px;}code{display:inline;}p{margin-top:8px;}tr{margin:0px;padding:0px;}td.docs{width:45%;vertical-align:top;margin:0px;padding-left:55px;padding-right:20px;border:none;}td.codes{border:none;margin:0px;padding-left:20px;width:55%;border-left:solid #ddd 1px;font-size:10pt;vertical-align:top;overflow:hidden;background-color:#F5F5FF;}td.spacer{padding-bottom:40px;}.toc h1{font-size:24px;}.toc{border-bottom:solid #bbb 1px;margin-bottom:40px;}.toc ul{margin-left:20px;padding-left:0px;padding-top:0;margin-top:0;}.toc li{list-style-type:none;padding-left:0;}.footer{text-align:center;}#floating-toc{position:fixed;top:10px;right:20px;height:20px;overflow:hidden;}#floating-toc li{list-style-type:none;margin:0;padding:0;}.dependencies{}.dependencies table{font-size:16px;width:99.99%;border:none;margin-left:20px;}.dependencies td{padding-right:20px;;white-space:nowrap;}.dependencies .dotted{width:99%;}.dependencies .dotted hr{margin-bottom:-6px;noshade:noshade;border-top:none;color:transparent;border-left:none;border-bottom:dotted #bbb 1px;border-right:none;background-color:transparent;height:0;}.dependencies .dep-version{text-align:right;}.header p{margin-left:20px;}</style><title>Marginalia Output</title></head><body><table><tr><td class="docs"><div class="header"><h1 class="project-name">marginalia</h1><h2 class="project-version">0.0.1</h2><br /><p>A port of <a href="http://jashkenas.github.com/docco/">Docco</a> to Clojure.</p>
|
||||
</style><style type="text/css">html{margin:0;padding:0;}h1{margin:0;padding:0;}h2{margin:0;padding:0;}h3{margin:0;padding:0;}h4{margin:0;padding:0;}</style><style type="text/css">h1.project-name{font-size:34px;display:inline;}h2.project-version{font-size:18px;margin-top:0;display:inline;margin-left:10px;}.toc-link{font-size:12px;margin-left:10px;color:#252519;text-decoration:none;}.toc-link:hover{color:#5050A6;}.toc h1{font-size:34px;margin:0;}.docs-header{border-bottom:dotted #aaa 1px;padding-bottom:10px;margin-bottom:25px;}.toc h1{font-size:24px;}.toc{border-bottom:solid #bbb 1px;margin-bottom:40px;}.toc ul{margin-left:20px;padding-left:0px;padding-top:0;margin-top:0;}.toc li{list-style-type:none;padding-left:0;}.dependencies{}.dependencies table{font-size:16px;width:99.99%;border:none;margin-left:20px;}.dependencies td{padding-right:20px;;white-space:nowrap;}.dependencies .dotted{width:99%;}.dependencies .dotted hr{margin-bottom:-6px;noshade:noshade;border-top:none;color:transparent;border-left:none;border-bottom:dotted #bbb 1px;border-right:none;background-color:transparent;height:0;}.dependencies .dep-version{text-align:right;}.header p{margin-left:20px;}</style><style type="text/css">#floating-toc{position:fixed;top:10px;right:20px;height:20px;overflow:hidden;text-align:right;}#floating-toc li{list-style-type:none;margin:0;padding:0;}</style><style type="text/css">body{margin:0;padding:0;font-family:'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;;font-size:16px;color:#252519;}h1{font-size:20px;margin-top:0;}.anchor{text-decoration:none;color:#252519;}.anchor:hover{color:#5050A6;}table{border-spacing:0;border-bottom:solid #ddd 1px;;margin-bottom:10px;}code{display:inline;}p{margin-top:8px;}tr{margin:0px;padding:0px;}td.docs{width:45%;vertical-align:top;margin:0px;padding-left:55px;padding-right:20px;border:none;}td.codes{border:none;margin:0px;padding-left:20px;width:55%;border-left:solid #ddd 1px;font-size:10pt;vertical-align:top;overflow:hidden;background-color:#F5F5FF;}td.spacer{padding-bottom:40px;}.footer{text-align:center;}</style><title>Marginalia Output</title></head><body><table><tr><td class="docs"><div class="header"><h1 class="project-name">marginalia</h1><h2 class="project-version">0.1.0</h2><br /><p>lightweight literate programming for clojure -- inspired by <a href="http://jashkenas.github.com/docco/">docco</a></p>
|
||||
</div><div class="dependencies"><h3>dependencies</h3><table><tr><td class="dep-name">org.clojure/clojure</td><td class="dotted"><hr /></td><td class="dep-version">1.2.0</td></tr><tr><td class="dep-name">org.clojars.nakkaya/markdownj</td><td class="dotted"><hr /></td><td class="dep-version">1.0.2b4</td></tr><tr><td class="dep-name">hiccup</td><td class="dotted"><hr /></td><td class="dep-version">0.3.0</td></tr></table></div><div class="dependencies"><h3>dev dependencies</h3><table><tr><td class="dep-name">lein-clojars</td><td class="dotted"><hr /></td><td class="dep-version">0.5.0-SNAPSHOT</td></tr><tr><td class="dep-name">jline</td><td class="dotted"><hr /></td><td class="dep-version">0.9.94</td></tr><tr><td class="dep-name">swank-clojure</td><td class="dotted"><hr /></td><td class="dep-version">1.2.1</td></tr></table></div></td><td class="codes" style="text-align: center; vertical-align: middle;color: #666"><br /><br /><br />(this space intentionally left blank)</td></tr><tr><td class="docs"><div class="toc"><a name="toc"><h3>namespaces</h3></a><ul><li><a href="#marginalia.core">marginalia.core</a></li><li><a href="#marginalia.dev-helper">marginalia.dev-helper</a></li><li><a href="#marginalia.html">marginalia.html</a></li></ul></div></td><td class="codes"> </td></tr><tr><td class="docs"><div class="docs-header"><a class="anchor" href="#marginalia.core" name="marginalia.core"><h1 class="project-name">marginalia.core</h1><a class="toc-link" href="#toc">toc</a></a></div></td><td class="codes" /></tr><tr><td class="docs"><p><strong>Core</strong> provides all of the functionality around parsing clojure source files
|
||||
into an easily consumable format.</p>
|
||||
</td><td class="codes"><pre class="brush: clojure">(ns marginalia.core
|
||||
|
@ -2819,7 +2913,108 @@ outlined above.</p>
|
|||
(map group-to-html (:groups doc))
|
||||
[:tr
|
||||
[:td {:class "spacer docs"} "&nbsp;"]
|
||||
[:td {:class "codes"}]]))</pre></td></tr><tr><td class="docs"><p>Notice that we're inlining the css & javascript for <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a> (<code>inline-js</code>
|
||||
[:td {:class "codes"}]]))</pre></td></tr><tr><td class="docs">
|
||||
</td><td class="codes"><pre class="brush: clojure">
|
||||
(def reset-css
|
||||
(css [:html {:margin 0 :padding 0}]
|
||||
[:h1 {:margin 0 :padding 0}]
|
||||
[:h2 {:margin 0 :padding 0}]
|
||||
[:h3 {:margin 0 :padding 0}]
|
||||
[:h4 {:margin 0 :padding 0}]))</pre></td></tr><tr><td class="docs">
|
||||
</td><td class="codes"><pre class="brush: clojure">
|
||||
(def header-css
|
||||
(css [:h1.project-name {:font-size "34px"
|
||||
:display "inline"}]
|
||||
[:h2.project-version {:font-size "18px"
|
||||
:margin-top 0
|
||||
:display "inline"
|
||||
:margin-left "10px"}]
|
||||
[:.toc-link {:font-size "12px"
|
||||
:margin-left "10px"
|
||||
:color "#252519"
|
||||
:text-decoration "none"}]
|
||||
[:.toc-link:hover {:color "#5050A6"}]
|
||||
[:.toc :h1 {:font-size "34px"
|
||||
:margin 0}]
|
||||
[:.docs-header {:border-bottom "dotted #aaa 1px"
|
||||
:padding-bottom "10px"
|
||||
:margin-bottom "25px"}]
|
||||
[:.toc :h1 {:font-size "24px"}]
|
||||
[:.toc {:border-bottom "solid #bbb 1px"
|
||||
:margin-bottom "40px"}]
|
||||
[:.toc :ul {:margin-left "20px"
|
||||
:padding-left "0px"
|
||||
:padding-top 0
|
||||
:margin-top 0}]
|
||||
[:.toc :li {:list-style-type "none"
|
||||
:padding-left 0}]
|
||||
[:.dependencies {}]
|
||||
[:.dependencies :table {:font-size "16px"
|
||||
:width "99.99%"
|
||||
:border "none"
|
||||
:margin-left "20px"}]
|
||||
[:.dependencies :td {:padding-right "20px;"
|
||||
:white-space "nowrap"}]
|
||||
[:.dependencies :.dotted {:width "99%"}]
|
||||
[:.dependencies :.dotted :hr {:height 0
|
||||
:noshade "noshade"
|
||||
:color "transparent"
|
||||
:background-color "transparent"
|
||||
:border-bottom "dotted #bbb 1px"
|
||||
:border-top "none"
|
||||
:border-left "none"
|
||||
:border-right "none"
|
||||
:margin-bottom "-6px"}]
|
||||
[:.dependencies :.dep-version {:text-align "right"}]
|
||||
[:.header :p {:margin-left "20px"}]))</pre></td></tr><tr><td class="docs">
|
||||
</td><td class="codes"><pre class="brush: clojure">
|
||||
(def floating-toc-css
|
||||
(css [:#floating-toc {:position "fixed"
|
||||
:top "10px"
|
||||
:right "20px"
|
||||
:height "20px"
|
||||
:overflow "hidden"
|
||||
:text-align "right"}]
|
||||
[:#floating-toc :li {:list-style-type "none"
|
||||
:margin 0
|
||||
:padding 0}]))</pre></td></tr><tr><td class="docs">
|
||||
</td><td class="codes"><pre class="brush: clojure">
|
||||
(def general-css
|
||||
(css
|
||||
[:body {:margin 0
|
||||
:padding 0
|
||||
:font-family "'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;"
|
||||
:font-size "16px"
|
||||
:color "#252519"}]
|
||||
[:h1 {:font-size "20px"
|
||||
:margin-top 0}]
|
||||
[:.anchor {:text-decoration "none"
|
||||
:color "#252519"}]
|
||||
[:.anchor:hover {:color "#5050A6"}]
|
||||
[:table {:border-spacing 0
|
||||
:border-bottom "solid #ddd 1px;"
|
||||
:margin-bottom "10px"}]
|
||||
[:code {:display "inline"}]
|
||||
[:p {:margin-top "8px"}]
|
||||
[:tr {:margin "0px"
|
||||
:padding "0px"}]
|
||||
[:td.docs {:width "45%"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "55px"
|
||||
:padding-right "20px"
|
||||
:border "none"}]
|
||||
[:td.codes {:width "55%"
|
||||
:background-color "#F5F5FF"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "20px"
|
||||
:border "none"
|
||||
:overflow "hidden"
|
||||
:font-size "10pt"
|
||||
:border-left "solid #ddd 1px"}]
|
||||
[:td.spacer {:padding-bottom "40px"}]
|
||||
[:.footer {:text-align "center"}]))</pre></td></tr><tr><td class="docs"><p>Notice that we're inlining the css & javascript for <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a> (<code>inline-js</code>
|
||||
& <code>inline-css</code>) to be able to package the output as a single file (uberdoc if you will). It goes without
|
||||
saying that all this is WIP and will prabably change in the future.</p>
|
||||
</td><td class="codes"><pre class="brush: clojure">
|
||||
|
@ -2832,103 +3027,14 @@ saying that all this is WIP and will prabably change in the future.</p>
|
|||
(inline-js "xregexp-min.js")
|
||||
(inline-js "shCore.js")
|
||||
(inline-js "shBrushClojure.js")
|
||||
#_ (inline-js "app.js")
|
||||
[:script {:type "text/javascript" :src "./../resources/app.js"}]
|
||||
(inline-js "app.js")
|
||||
#_[:script {:type "text/javascript" :src "./../resources/app.js"}]
|
||||
(inline-css "shCore.css")
|
||||
(inline-css "shThemeEclipse.css")
|
||||
(css
|
||||
[:html {:margin 0 :padding 0}]
|
||||
[:h1 {:margin 0 :padding 0}]
|
||||
[:h2 {:margin 0 :padding 0}]
|
||||
[:h3 {:margin 0 :padding 0}]
|
||||
[:h4 {:margin 0 :padding 0}]
|
||||
|
||||
[:body {:margin 0
|
||||
:padding 0
|
||||
:font-family "'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;"
|
||||
:font-size "16px"
|
||||
:color "#252519"}]
|
||||
[:.toc-link {:font-size "12px"
|
||||
:margin-left "10px"
|
||||
:color "#252519"
|
||||
:text-decoration "none"}]
|
||||
[:.toc-link:hover {:color "#5050A6"}]
|
||||
[:.docs-header {:border-bottom "dotted #aaa 1px"
|
||||
:padding-bottom "10px"
|
||||
:margin-bottom "25px"}]
|
||||
[:.anchor {:text-decoration "none"
|
||||
:color "#252519"}]
|
||||
[:.anchor:hover {:color "#5050A6"}]
|
||||
[:.toc :h1 {:font-size "34px"
|
||||
:margin 0}]
|
||||
[:h1 {:font-size "20px"
|
||||
:margin-top 0}]
|
||||
[:h1.project-name {:font-size "34px"
|
||||
:display "inline"}]
|
||||
[:h2.project-version {:font-size "18px"
|
||||
:margin-top 0
|
||||
:display "inline"
|
||||
:margin-left "10px"}]
|
||||
[:table {:border-spacing 0
|
||||
:border-bottom "solid #ddd 1px;"
|
||||
:margin-bottom "10px"}]
|
||||
[:code {:display "inline"}]
|
||||
[:p {:margin-top "8px"}]
|
||||
[:tr {:margin "0px"
|
||||
:padding "0px"}]
|
||||
[:td.docs {:width "45%"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "55px"
|
||||
:padding-right "20px"
|
||||
:border "none"}]
|
||||
[:td.codes {:width "55%"
|
||||
:background-color "#F5F5FF"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "20px"
|
||||
:border "none"
|
||||
:overflow "hidden"
|
||||
:font-size "10pt"
|
||||
:border-left "solid #ddd 1px"}]
|
||||
[:td.spacer {:padding-bottom "40px"}]
|
||||
[:.toc :h1 {:font-size "24px"}]
|
||||
[:.toc {:border-bottom "solid #bbb 1px"
|
||||
:margin-bottom "40px"}]
|
||||
[:.toc :ul {:margin-left "20px"
|
||||
:padding-left "0px"
|
||||
:padding-top 0
|
||||
:margin-top 0}]
|
||||
[:.toc :li {:list-style-type "none"
|
||||
:padding-left 0}]
|
||||
[:.footer {:text-align "center"}]
|
||||
[:#floating-toc {:position "fixed"
|
||||
:top "10px"
|
||||
:right "20px"
|
||||
:height "20px"
|
||||
:overflow "hidden"}]
|
||||
[:#floating-toc :li {:list-style-type "none"
|
||||
:margin 0
|
||||
:padding 0}]
|
||||
[:.dependencies {}]
|
||||
[:.dependencies :table {:font-size "16px"
|
||||
:width "99.99%"
|
||||
:border "none"
|
||||
:margin-left "20px"}]
|
||||
[:.dependencies :td {:padding-right "20px;"
|
||||
:white-space "nowrap"}]
|
||||
[:.dependencies :.dotted {:width "99%"}]
|
||||
[:.dependencies :.dotted :hr {:height 0
|
||||
:noshade "noshade"
|
||||
:color "transparent"
|
||||
:background-color "transparent"
|
||||
:border-bottom "dotted #bbb 1px"
|
||||
:border-top "none"
|
||||
:border-left "none"
|
||||
:border-right "none"
|
||||
:margin-bottom "-6px"}]
|
||||
[:.dependencies :.dep-version {:text-align "right"}]
|
||||
[:.header :p {:margin-left "20px"}])
|
||||
reset-css
|
||||
header-css
|
||||
floating-toc-css
|
||||
general-css
|
||||
[:title "Marginalia Output"]]
|
||||
[:body
|
||||
[:table
|
||||
|
@ -2946,9 +3052,6 @@ saying that all this is WIP and will prabably change in the future.</p>
|
|||
[:script {:type "text/javascript"}
|
||||
"SyntaxHighlighter.defaults['gutter'] = false;
|
||||
SyntaxHighlighter.all()"]]]))
|
||||
|
||||
|
||||
|
||||
</pre></td></tr><tr><td class="docs"><p>Syntax highlighting is done a bit differently than docco. Instead of embedding
|
||||
the higlighting metadata on the parse / html gen phase, we use <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a>
|
||||
to do it in javascript.</p>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
(:use [marginalia.html :only (uberdoc-html)]
|
||||
[clojure.contrib.find-namespaces :only (read-file-ns-decl)]))
|
||||
|
||||
|
||||
(def *test* "./src/cljojo/core.clj")
|
||||
(def *docs* "docs")
|
||||
(def *comment* #"^\s*;;\s?")
|
||||
|
@ -141,7 +142,7 @@
|
|||
(recur more
|
||||
cnum
|
||||
(inc dnum)
|
||||
(conj sections {:docs-text (str (str/replace line *comment* "")) :line (+ cnum (dec dnum))}))
|
||||
(conj sections {:docs-text (str (str/replace line *comment* "")) :line (+ cnum dnum)}))
|
||||
(recur more
|
||||
(inc cnum)
|
||||
0
|
||||
|
@ -207,7 +208,7 @@
|
|||
(println "Done generating your docs, please see ./docs/marg.html")
|
||||
(println))))
|
||||
|
||||
(-main (find-clojure-file-paths "./src"))
|
||||
#_(-main (find-clojure-file-paths "./src"))
|
||||
|
||||
|
||||
;; # Example Usage
|
||||
|
|
|
@ -177,6 +177,107 @@
|
|||
[:td {:class "spacer docs"} " "]
|
||||
[:td {:class "codes"}]]))
|
||||
|
||||
(def reset-css
|
||||
(css [:html {:margin 0 :padding 0}]
|
||||
[:h1 {:margin 0 :padding 0}]
|
||||
[:h2 {:margin 0 :padding 0}]
|
||||
[:h3 {:margin 0 :padding 0}]
|
||||
[:h4 {:margin 0 :padding 0}]))
|
||||
|
||||
(def header-css
|
||||
(css [:h1.project-name {:font-size "34px"
|
||||
:display "inline"}]
|
||||
[:h2.project-version {:font-size "18px"
|
||||
:margin-top 0
|
||||
:display "inline"
|
||||
:margin-left "10px"}]
|
||||
[:.toc-link {:font-size "12px"
|
||||
:margin-left "10px"
|
||||
:color "#252519"
|
||||
:text-decoration "none"}]
|
||||
[:.toc-link:hover {:color "#5050A6"}]
|
||||
[:.toc :h1 {:font-size "34px"
|
||||
:margin 0}]
|
||||
[:.docs-header {:border-bottom "dotted #aaa 1px"
|
||||
:padding-bottom "10px"
|
||||
:margin-bottom "25px"}]
|
||||
[:.toc :h1 {:font-size "24px"}]
|
||||
[:.toc {:border-bottom "solid #bbb 1px"
|
||||
:margin-bottom "40px"}]
|
||||
[:.toc :ul {:margin-left "20px"
|
||||
:padding-left "0px"
|
||||
:padding-top 0
|
||||
:margin-top 0}]
|
||||
[:.toc :li {:list-style-type "none"
|
||||
:padding-left 0}]
|
||||
[:.dependencies {}]
|
||||
[:.dependencies :table {:font-size "16px"
|
||||
:width "99.99%"
|
||||
:border "none"
|
||||
:margin-left "20px"}]
|
||||
[:.dependencies :td {:padding-right "20px;"
|
||||
:white-space "nowrap"}]
|
||||
[:.dependencies :.dotted {:width "99%"}]
|
||||
[:.dependencies :.dotted :hr {:height 0
|
||||
:noshade "noshade"
|
||||
:color "transparent"
|
||||
:background-color "transparent"
|
||||
:border-bottom "dotted #bbb 1px"
|
||||
:border-top "none"
|
||||
:border-left "none"
|
||||
:border-right "none"
|
||||
:margin-bottom "-6px"}]
|
||||
[:.dependencies :.dep-version {:text-align "right"}]
|
||||
[:.header :p {:margin-left "20px"}]))
|
||||
|
||||
(def floating-toc-css
|
||||
(css [:#floating-toc {:position "fixed"
|
||||
:top "10px"
|
||||
:right "20px"
|
||||
:height "20px"
|
||||
:overflow "hidden"
|
||||
:text-align "right"}]
|
||||
[:#floating-toc :li {:list-style-type "none"
|
||||
:margin 0
|
||||
:padding 0}]))
|
||||
|
||||
(def general-css
|
||||
(css
|
||||
[:body {:margin 0
|
||||
:padding 0
|
||||
:font-family "'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;"
|
||||
:font-size "16px"
|
||||
:color "#252519"}]
|
||||
[:h1 {:font-size "20px"
|
||||
:margin-top 0}]
|
||||
[:.anchor {:text-decoration "none"
|
||||
:color "#252519"}]
|
||||
[:.anchor:hover {:color "#5050A6"}]
|
||||
[:table {:border-spacing 0
|
||||
:border-bottom "solid #ddd 1px;"
|
||||
:margin-bottom "10px"}]
|
||||
[:code {:display "inline"}]
|
||||
[:p {:margin-top "8px"}]
|
||||
[:tr {:margin "0px"
|
||||
:padding "0px"}]
|
||||
[:td.docs {:width "45%"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "55px"
|
||||
:padding-right "20px"
|
||||
:border "none"}]
|
||||
[:td.codes {:width "55%"
|
||||
:background-color "#F5F5FF"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "20px"
|
||||
:border "none"
|
||||
:overflow "hidden"
|
||||
:font-size "10pt"
|
||||
:border-left "solid #ddd 1px"}]
|
||||
[:td.spacer {:padding-bottom "40px"}]
|
||||
[:.footer {:text-align "center"}]))
|
||||
|
||||
(defn page-template [header toc floating-toc content]
|
||||
"Notice that we're inlining the css & javascript for [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/) (`inline-js`
|
||||
& `inline-css`) to be able to package the output as a single file (uberdoc if you will). It goes without
|
||||
|
@ -189,105 +290,16 @@
|
|||
(inline-js "xregexp-min.js")
|
||||
(inline-js "shCore.js")
|
||||
(inline-js "shBrushClojure.js")
|
||||
#_ (inline-js "app.js")
|
||||
[:script {:type "text/javascript" :src "./../resources/app.js"}]
|
||||
(inline-js "app.js")
|
||||
#_[:script {:type "text/javascript" :src "./../resources/app.js"}]
|
||||
(inline-css "shCore.css")
|
||||
(css
|
||||
[:.syntaxhighlighter {:overflow "hidden !important"}])
|
||||
(inline-css "shThemeEclipse.css")
|
||||
(css
|
||||
[:html {:margin 0 :padding 0}]
|
||||
[:h1 {:margin 0 :padding 0}]
|
||||
[:h2 {:margin 0 :padding 0}]
|
||||
[:h3 {:margin 0 :padding 0}]
|
||||
[:h4 {:margin 0 :padding 0}]
|
||||
|
||||
[:body {:margin 0
|
||||
:padding 0
|
||||
:font-family "'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;"
|
||||
:font-size "16px"
|
||||
:color "#252519"}]
|
||||
[:.toc-link {:font-size "12px"
|
||||
:margin-left "10px"
|
||||
:color "#252519"
|
||||
:text-decoration "none"}]
|
||||
[:.toc-link:hover {:color "#5050A6"}]
|
||||
[:.docs-header {:border-bottom "dotted #aaa 1px"
|
||||
:padding-bottom "10px"
|
||||
:margin-bottom "25px"}]
|
||||
[:.anchor {:text-decoration "none"
|
||||
:color "#252519"}]
|
||||
[:.anchor:hover {:color "#5050A6"}]
|
||||
[:.toc :h1 {:font-size "34px"
|
||||
:margin 0}]
|
||||
[:h1 {:font-size "20px"
|
||||
:margin-top 0}]
|
||||
[:h1.project-name {:font-size "34px"
|
||||
:display "inline"}]
|
||||
[:h2.project-version {:font-size "18px"
|
||||
:margin-top 0
|
||||
:display "inline"
|
||||
:margin-left "10px"}]
|
||||
[:table {:border-spacing 0
|
||||
:border-bottom "solid #ddd 1px;"
|
||||
:margin-bottom "10px"}]
|
||||
[:code {:display "inline"}]
|
||||
[:p {:margin-top "8px"}]
|
||||
[:tr {:margin "0px"
|
||||
:padding "0px"}]
|
||||
[:td.docs {:width "45%"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "55px"
|
||||
:padding-right "20px"
|
||||
:border "none"}]
|
||||
[:td.codes {:width "55%"
|
||||
:background-color "#F5F5FF"
|
||||
:vertical-align "top"
|
||||
:margin "0px"
|
||||
:padding-left "20px"
|
||||
:border "none"
|
||||
:overflow "hidden"
|
||||
:font-size "10pt"
|
||||
:border-left "solid #ddd 1px"}]
|
||||
[:td.spacer {:padding-bottom "40px"}]
|
||||
[:.toc :h1 {:font-size "24px"}]
|
||||
[:.toc {:border-bottom "solid #bbb 1px"
|
||||
:margin-bottom "40px"}]
|
||||
[:.toc :ul {:margin-left "20px"
|
||||
:padding-left "0px"
|
||||
:padding-top 0
|
||||
:margin-top 0}]
|
||||
[:.toc :li {:list-style-type "none"
|
||||
:padding-left 0}]
|
||||
[:.footer {:text-align "center"}]
|
||||
[:#floating-toc {:position "fixed"
|
||||
:top "10px"
|
||||
:right "20px"
|
||||
:height "20px"
|
||||
:overflow "hidden"}]
|
||||
[:#floating-toc :li {:list-style-type "none"
|
||||
:margin 0
|
||||
:padding 0}]
|
||||
[:.dependencies {}]
|
||||
[:.dependencies :table {:font-size "16px"
|
||||
:width "99.99%"
|
||||
:border "none"
|
||||
:margin-left "20px"}]
|
||||
[:.dependencies :td {:padding-right "20px;"
|
||||
:white-space "nowrap"}]
|
||||
[:.dependencies :.dotted {:width "99%"}]
|
||||
[:.dependencies :.dotted :hr {:height 0
|
||||
:noshade "noshade"
|
||||
:color "transparent"
|
||||
:background-color "transparent"
|
||||
:border-bottom "dotted #bbb 1px"
|
||||
:border-top "none"
|
||||
:border-left "none"
|
||||
:border-right "none"
|
||||
:margin-bottom "-6px"}]
|
||||
[:.dependencies :.dep-version {:text-align "right"}]
|
||||
[:.header :p {:margin-left "20px"}])
|
||||
reset-css
|
||||
header-css
|
||||
floating-toc-css
|
||||
general-css
|
||||
[:title "Marginalia Output"]]
|
||||
[:body
|
||||
[:table
|
||||
|
@ -307,9 +319,6 @@
|
|||
SyntaxHighlighter.all()"]]]))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; Syntax highlighting is done a bit differently than docco. Instead of embedding
|
||||
;; the higlighting metadata on the parse / html gen phase, we use [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/)
|
||||
;; to do it in javascript.
|
||||
|
|
Loading…
Reference in a new issue