Skip to content

Commit 0927291

Browse files
committed
1 parent fb88b30 commit 0927291

25 files changed

+5073
-0
lines changed

assets/font.css

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/main.css

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.

assets/main.js

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
$(function() {
2+
3+
$('pre:has(code.language-sequence),pre:has(code.language-flow)').each(function(e, i) {
4+
if ($(this).has('code.language-sequence').length) {
5+
var text = $(this).find('code').text();
6+
var sc = $('<div class="diagram"/>').text(text);
7+
$(this).replaceWith(sc);
8+
$(sc).sequenceDiagram({
9+
theme: 'simple'
10+
})
11+
} else {
12+
var text = $(this).find('code').text();
13+
var diagram = flowchart.parse(text);
14+
var fc = $('<div class="flowchart"/>');
15+
$(this).replaceWith(fc)
16+
diagram.drawSVG($(fc).get(0), {
17+
'x': 0,
18+
'y': 0,
19+
'line-length': 50,
20+
'text-margin': 10,
21+
'font-color': 'black',
22+
'line-color': '#555555',
23+
'element-color': '#333333',
24+
'fill': 'white',
25+
'arrow-end': 'block',
26+
// style symbol types
27+
'symbols': {
28+
'start': {
29+
'font-color': 'red',
30+
'element-color': 'green',
31+
'fill': 'yellow'
32+
},
33+
'end': {
34+
'class': 'end-element'
35+
}
36+
},
37+
// even flowstate support ;-)
38+
'flowstate': {
39+
'past': {
40+
'fill': '#CCCCCC',
41+
'font-size': 12
42+
},
43+
'current': {
44+
'fill': 'yellow',
45+
'font-color': 'red',
46+
'font-weight': 'bold'
47+
},
48+
'future': {
49+
'fill': '#FFFF99'
50+
},
51+
'request': {
52+
'fill': 'blue'
53+
},
54+
'invalid': {
55+
'fill': '#444444'
56+
},
57+
'approved': {
58+
'fill': '#58C4A3',
59+
'font-size': 12,
60+
'yes-text': '通过',
61+
'no-text': '拒绝'
62+
},
63+
'rejected': {
64+
'fill': '#C45879',
65+
'font-size': 12,
66+
'yes-text': '通过',
67+
'no-text': '拒绝'
68+
}
69+
},
70+
'line-width': 2,
71+
'font-size': 14,
72+
'font-family': 'Arial',
73+
'yes-text': '是',
74+
'no-text': '否'
75+
});
76+
}
77+
});
78+
79+
$('pre.highlight code').each(function(i, block) {
80+
hljs.highlightBlock(block);
81+
});
82+
83+
$('[class^="date:"]').each(function(i,e){
84+
$(this).html( $(this).text()+'<i>@ ' + $('[class^="date:"]').attr('class').split(':')[1] + '</i>' )
85+
})
86+
87+
emojify.setConfig({
88+
img_dir : 'http://hassankhan.github.io/emojify.js/images/emoji/'
89+
});
90+
91+
emojify.run();
92+
93+
});

g.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
call asciidoctor -C -a linkcss -a stylesheet=main.css -a stylesdir=assets -T layout src/*.md -D ./
3+
pause

layout/document.html.erb

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<%#encoding:UTF-8%><!DOCTYPE html>
2+
<html<%= (attr? :nolang) ? nil : %( lang="#{attr :lang, 'en'}") %>>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=<%= attr :encoding %>">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0"><%
6+
[:description, :keywords, :author, :copyright].each do |key|
7+
if attr? key %>
8+
<meta name="<%= key %>" content="<%= attr key %>"><%
9+
end
10+
end %>
11+
<title><%= doctitle(:sanitize => true) || (attr 'untitled-label') %></title><%
12+
if Asciidoctor::DEFAULT_STYLESHEET_KEYS.include?(attr :stylesheet)
13+
if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) %>
14+
<link rel="stylesheet" href="<%= normalize_web_path(Asciidoctor::DEFAULT_STYLESHEET_NAME, (attr :stylesdir, '')) %>"><%
15+
else %>
16+
<%= Asciidoctor::Stylesheets.instance.embed_primary_stylesheet %>
17+
<%
18+
end
19+
elsif attr? :stylesheet
20+
if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) %>
21+
<link rel="stylesheet" href="<%= normalize_web_path((attr :stylesheet), attr(:stylesdir, '')) %>"><%
22+
else %>
23+
<style>
24+
<%= read_asset normalize_system_path((attr :stylesheet), (attr :stylesdir, '')), true %>
25+
</style><%
26+
end
27+
end
28+
if attr? :icons, 'font'
29+
if !(attr 'iconfont-remote', '').nil? %>
30+
<link rel="stylesheet" href="share/font-awesome-4.2.0/css/font-awesome.min.css"><%
31+
else %>
32+
<link rel="stylesheet" href="<%= normalize_web_path(%(#{attr 'iconfont-name', 'font-awesome'}.css), (attr :stylesdir, '')) %>"><%
33+
end
34+
end
35+
case attr 'source-highlighter'
36+
when 'coderay'
37+
if (attr 'coderay-css', 'class') == 'class'
38+
if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) %>
39+
<link rel="stylesheet" href="<%= normalize_web_path('asciidoctor-coderay.css', (attr :stylesdir, '')) %>"><%
40+
else %>
41+
<%= Asciidoctor::Stylesheets.embed_coderay_stylesheet %>
42+
<%
43+
end
44+
end
45+
when 'pygments'
46+
if (attr 'pygments-css', 'class') == 'class'
47+
if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) %>
48+
<link rel="stylesheet" href="<%= normalize_web_path('asciidoctor-pygments.css', (attr :stylesdir, '')) %>"><%
49+
else %>
50+
<%= Asciidoctor::Stylesheets.embed_pygments_stylesheet(attr 'pygments-style') %>
51+
<%
52+
end
53+
end
54+
when 'highlightjs' %>
55+
<link rel="stylesheet" href="<%= attr 'highlightjsdir', 'http://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4' %>/styles/<%= attr 'highlightjs-theme', 'googlecode' %>.min.css">
56+
<script src="<%= attr 'highlightjsdir', 'http://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4' %>/highlight.min.js"></script>
57+
<script src="<%= attr 'highlightjsdir', 'http://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4' %>/lang/common.min.js"></script>
58+
<script>hljs.initHighlightingOnLoad()</script><%
59+
when 'prettify' %>
60+
<link rel="stylesheet" href="<%= attr 'prettifydir', 'http://cdnjs.cloudflare.com/ajax/libs/prettify/r298' %>/<%= attr 'prettify-theme', 'prettify' %>.min.css">
61+
<script src="<%= attr 'prettifydir', 'http://cdnjs.cloudflare.com/ajax/libs/prettify/r298' %>/prettify.min.js"></script>
62+
<script>document.addEventListener('DOMContentLoaded', prettyPrint)</script><%
63+
end
64+
if attr? 'math' %>
65+
<script type="text/x-mathjax-config">
66+
MathJax.Hub.Config({
67+
tex2jax: {
68+
inlineMath: [<%= Asciidoctor::INLINE_MATH_DELIMITERS[:latexmath] %>],
69+
displayMath: [<%= Asciidoctor::BLOCK_MATH_DELIMITERS[:latexmath] %>],
70+
ignoreClass: 'nomath|nolatexmath'
71+
},
72+
asciimath2jax: {
73+
delimiters: [<%= Asciidoctor::BLOCK_MATH_DELIMITERS[:asciimath] %>],
74+
ignoreClass: 'nomath|noasciimath'
75+
}
76+
});
77+
</script>
78+
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script>
79+
<script>document.addEventListener('DOMContentLoaded', MathJax.Hub.TypeSet)</script><%
80+
end
81+
%><%= (docinfo_content = docinfo).empty? ? nil : %(
82+
#{docinfo_content}) %>
83+
<link rel="stylesheet" href="share/highlight-github.css">
84+
</head>
85+
<body<%= @id && %( id="#{@id}") %> class="<%= [(attr :doctype),((attr? 'toc-class') && (attr? :toc) && (attr? 'toc-placement', 'auto') ? %(#{attr 'toc-class'} toc-#{attr 'toc-position', 'left'}) : nil)].compact * ' ' %>"<%= (attr? 'max-width') ? %( style="max-width: #{attr 'max-width'};") : nil %>><%
86+
unless noheader %>
87+
<div id="header"><%
88+
if doctype == 'manpage' %>
89+
<h1><%= doctitle %> Manual Page</h1><%
90+
if (attr? :toc) && (attr? 'toc-placement', 'auto') %>
91+
<div id="toc" class="<%= attr 'toc-class', 'toc' %>">
92+
<div id="toctitle"><%= attr 'toc-title' %></div>
93+
<%= converter.convert self, 'outline' %>
94+
</div><%
95+
end %>
96+
<h2><%= attr 'manname-title' %></h2>
97+
<div class="sectionbody">
98+
<p><%= %(#{attr :manname} - #{attr :manpurpose}) %></p>
99+
</div><%
100+
else
101+
if has_header?
102+
unless notitle %>
103+
<h1><%= @header.title %></h1><%
104+
end
105+
end
106+
end %>
107+
</div><%
108+
end %>
109+
<div id="content">
110+
<%if (attr? :toc) && (attr? 'toc-placement', 'auto') %>
111+
<div id="toc" class="<%= attr 'toc-class', 'toc' %>">
112+
<div id="toctitle"><%= attr 'toc-title' %></div>
113+
<%= converter.convert self, 'outline' %>
114+
</div><%
115+
end%>
116+
<%= content %>
117+
</div><%
118+
unless !footnotes? || attr?(:nofootnotes) %>
119+
<div id="footnotes">
120+
<hr><%
121+
footnotes.each do |fn| %>
122+
<div class="footnote" id="_footnote_<%= fn.index %>">
123+
<a href="#_footnoteref_<%= fn.index %>"><%= fn.index %></a>. <%= fn.text %>
124+
</div><%
125+
end %>
126+
</div><%
127+
end %><%
128+
unless nofooter %>
129+
<div id="footer">
130+
<div id="footer-text"><%
131+
if attr? :revnumber %>
132+
<%= %(#{attr 'version-label'} #{attr :revnumber}) %><br><%
133+
end
134+
if attr? 'last-update-label' %>
135+
<%= %(#{attr 'last-update-label'} #{attr :docdatetime}) %><%
136+
end %><%= (docinfo_content = (docinfo :footer)).empty? ? nil : %(
137+
#{docinfo_content}) %>
138+
</div>
139+
</div><%
140+
end %>
141+
<script src="share/jquery.js"></script>
142+
<script src="share/underscore.js"></script>
143+
<script src="share/highlight.pack.js"></script>
144+
<script src="share/holder.js"></script>
145+
<script src="share/raphael-min.js"></script>
146+
<script src="share/flowchart.min.js"></script>
147+
<script src="share/sequence-diagram-min.js"></script>
148+
<script src="share/emojify.min.js"></script>
149+
<script src="assets/main.js"></script>
150+
</body>
151+
</html>

layout/header.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Aliencode <https://github.com/aliencode[@aliencode]>
2+
:description: aliencode.me
3+
:keywords: aliencode.me
4+
:doctype: book
5+
:compat-mode:
6+
:page-layout!:
7+
:toc:
8+
:toc-placement: right
9+
:toclevels: 4
10+
:sectanchors:
11+
:sectlinks:
12+
:sectnums:
13+
:linkattrs:
14+
:icons: font
15+
:source-highlighter: highlight.js
16+
:experimental:
17+
:stem:
18+
:idprefix:
19+
:idseparator: -
20+
:ast: &ast;
21+
:dagger: pass:normal[^&dagger;^]
22+
:y: icon:check[role="green"]
23+
:n: icon:times[role="red"]
24+
:c: icon:file-text-o[role="blue"]
25+
:table-caption!:
26+
:example-caption!:
27+
:figure-caption!:
28+
:underscore: _
29+
30+
include::sidebar.adoc[]

layout/sidebar.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
. link:/[HOME]

0 commit comments

Comments
 (0)