Skip to content

Commit

Permalink
Basic support for the stylesheet attribute
Browse files Browse the repository at this point in the history
Fixes #25.
  • Loading branch information
nawroth committed Nov 28, 2015
1 parent ce95d46 commit 4280a3a
Show file tree
Hide file tree
Showing 25 changed files with 8,364 additions and 5 deletions.
7 changes: 7 additions & 0 deletions gists/includes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= Includes

include::images.adoc[]

include::prettify.adoc[]


Binary file added images/github/blockquote-arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/github/li-chevron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/golo/body-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/golo/pre-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/maker/body-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/riak/body-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/riak/footer-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/riak/info-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/riak/pre-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/riak/sidebar-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic|Noto+Serif:400,400italic,700,700italic|Droid+Sans+Mono:400">

<link rel="stylesheet" href="style/asciidoctor.css">

<style>
#content {
margin: 1em auto;
Expand Down
23 changes: 20 additions & 3 deletions js/docgist.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function DocGist($) {
'env-docgist': '',
'toc': 'macro',
'example-caption!': '@',
'version-label!': '@'
'version-label!': '@',
'stylesdir': 'style@',
'stylesheet': 'asciidoctor.css@'
};

var $content = undefined;
Expand Down Expand Up @@ -109,6 +111,20 @@ function DocGist($) {
var attributes = doc.attributes;
var attributeOverrides = {};

if (existsInObjectOrHash('stylesheet', attributes, urlAttributes)) {
var stylesheet = getValueFromObjectOrHash('stylesheet', attributes, urlAttributes);
if (existsInObjectOrHash('stylesdir', attributes, urlAttributes)) {
var stylesdir = getValueFromObjectOrHash('stylesdir', attributes, urlAttributes);
if (stylesdir) {
if (stylesdir.slice(-1) !== '/') {
stylesdir += '/';
}
stylesheet = stylesdir + stylesheet;
}
}
addLinkElement(stylesheet);
}

if (existsInObjectOrHash('no-header-footer', attributes, urlAttributes)) {
$('body>div.navbar').css('display', 'none');
}
Expand Down Expand Up @@ -414,8 +430,9 @@ function DocGist($) {
var element = document.createElement('link');
element.rel = 'stylesheet';
element.href = url;
var first = document.getElementsByTagName('link')[0];
first.parentNode.insertBefore(element, first);
var linkElements = document.getElementsByTagName('link');
var last = linkElements[linkElements.length - 1];
last.parentNode.insertBefore(element, last.nextSibling);
}

function highlightUsingPrettify() {
Expand Down
692 changes: 692 additions & 0 deletions style/colony.css

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions style/foundation-lime.css

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions style/foundation-potion.css

Large diffs are not rendered by default.

678 changes: 678 additions & 0 deletions style/foundation.css

Large diffs are not rendered by default.

699 changes: 699 additions & 0 deletions style/github.css

Large diffs are not rendered by default.

696 changes: 696 additions & 0 deletions style/golo.css

Large diffs are not rendered by default.

720 changes: 720 additions & 0 deletions style/iconic.css

Large diffs are not rendered by default.

696 changes: 696 additions & 0 deletions style/maker.css

Large diffs are not rendered by default.

697 changes: 697 additions & 0 deletions style/readthedocs.css

Large diffs are not rendered by default.

717 changes: 717 additions & 0 deletions style/riak.css

Large diffs are not rendered by default.

692 changes: 692 additions & 0 deletions style/rocket-panda.css

Large diffs are not rendered by default.

680 changes: 680 additions & 0 deletions style/rubygems.css

Large diffs are not rendered by default.

0 comments on commit 4280a3a

Please sign in to comment.