Commit aeba2ad5 authored by Robert Ricci's avatar Robert Ricci

First cut of highlighting code samples

Defines a new style that you *must* include in the @title() element of a
page that causes the right javascript and CSS to get loaded

Uses a version of highlight.js that has been slightly hacked to:

1) Look for .code-sample instead of "pre code" to find code to highlight
2) Auto-initialize itself at the end

Bug: Need to figure out how to *add on to* not override the default
parent c5a52a63
......@@ -2,7 +2,7 @@
@(require racket/date)
@(require "defs.rkt")
@title[#:version apt-version
@title[#:version apt-version #:style main-style
#:date (date->string (current-date))]{The CloudLab Manual}
......@@ -3,6 +3,7 @@
(require scribble/core)
(require scribble/decode)
(require scribble/manual)
(require scribble/private/defaults)
(require scribble/html-properties)
(require scribble/latex-properties)
(require racket/class)
......@@ -14,6 +15,11 @@
(provide (all-defined-out))
(define main-style
(make-style "main"
(list (js-style-addition "highlight.pack.js")
(make-css-addition "highlight-default.css"))))
; Check to see if we are building Apt or CloudLab documentation
(define tb-mode
(if (vector-member "clab" (current-command-line-arguments))
......@@ -2,7 +2,7 @@
@(require "defs.rkt")
@title[#:tag "geni-lib" #:version apt-version]{Describing a profile with python and @tt{geni-lib}}
@title[#:tag "geni-lib" #:style main-style #:version apt-version]{Describing a profile with python and @tt{geni-lib}}
@tt{geni-lib} is a tool that allows users to generate @seclink["rspecs"]{RSpec} files from Python
code. @(tb) offers the ability to use @tt{geni-lib}
Original style from (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #f0f0f0;
-webkit-text-size-adjust: none;
.hljs-tag .hljs-title,
.nginx .hljs-title {
color: black;
.hljs-tag .hljs-value,
.hljs-rule .hljs-value,
.haml .hljs-symbol,
.ruby .hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.django .hljs-variable,
.smalltalk .hljs-class,
.bash .hljs-variable,
.pf .hljs-variable,
.apache .hljs-tag,
.apache .hljs-cbracket,
.tex .hljs-command,
.tex .hljs-special,
.erlang_repl .hljs-function_or_atom,
.asciidoc .hljs-header,
.markdown .hljs-header,
.coffeescript .hljs-attribute,
.tp .hljs-variable {
color: #800;
.diff .hljs-header,
.asciidoc .hljs-blockquote,
.markdown .hljs-blockquote {
color: #888;
.smalltalk .hljs-symbol,
.smalltalk .hljs-char,
.go .hljs-constant,
.lasso .hljs-variable,
.makefile .hljs-variable,
.asciidoc .hljs-bullet,
.markdown .hljs-bullet,
.asciidoc .hljs-link_url,
.markdown .hljs-link_url {
color: #080;
.ruby .hljs-string,
.hljs-filter .hljs-argument,
.haml .hljs-bullet,
.apache .hljs-sqbracket,
.nginx .hljs-built_in,
.tex .hljs-formula,
.erlang_repl .hljs-reserved,
.asciidoc .hljs-link_label,
.markdown .hljs-link_label,
.vhdl .hljs-attribute,
.clojure .hljs-attribute,
.asciidoc .hljs-attribute,
.lasso .hljs-attribute,
.coffeescript .hljs-property,
.hljs-phony {
color: #88f;
.css .hljs-tag,
.smalltalk .hljs-class,
.bash .hljs-variable,
.pf .hljs-variable,
.apache .hljs-tag,
.tex .hljs-command,
.asciidoc .hljs-strong,
.markdown .hljs-strong,
.tp .hljs-data,
.tp .hljs-io {
font-weight: bold;
.asciidoc .hljs-emphasis,
.markdown .hljs-emphasis,
.tp .hljs-units {
font-style: italic;
.nginx .hljs-built_in {
font-weight: normal;
.coffeescript .javascript,
.javascript .xml,
.lasso .markup,
.tex .hljs-formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .hljs-cdata {
opacity: 0.5;
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment