use go-bindata to embed static assets

This commit is contained in:
mappu 2017-07-09 12:12:47 +12:00
parent 7cb1f02423
commit 1b4720fca2
4 changed files with 570 additions and 279 deletions

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
.PHONY: all clean
all: staticResources.go
clean:
rm staticResources.go
staticResources.go: static/ static/*
go-bindata -o staticResources.go -prefix static -pkg yatwiki3 static

27
static/highlight.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,279 +1,275 @@
package yatwiki3 /* wiki.css */
html,body {
var tmplWikiCss []byte = []byte(` background:white;color:black;font-size:12px;
/* wiki.css */ margin:0;padding:0;border:0;
html,body { }
background:white;color:black;font-size:12px; html,body,input{font-family:Verdana,Arial;}
margin:0;padding:0;border:0; table,tr,td,th {border:0px;}
} input {font-size:8px;}
html,body,input{font-family:Verdana,Arial;} a {text-decoration:none;color: blue;}
table,tr,td,th {border:0px;} a:hover {text-decoration:underline;}
input {font-size:8px;} img {border:0px;max-width:100%;}
a {text-decoration:none;color: blue;} ul {margin:0px; padding-left:30px;}
a:hover {text-decoration:underline;} h2 {display:inline;}
img {border:0px;max-width:100%;} pre {font-family:Consolas,Courier,monospace;font-size:11px;}
ul {margin:0px; padding-left:30px;} td {padding:0px 10px;}
h2 {display:inline;} .content{padding:8px;}
pre {font-family:Consolas,Courier,monospace;font-size:11px;} .s {text-decoration:line-through;}
td {padding:0px 10px;} .spoiler{color:black;background-color:black;}
.content{padding:8px;} .spoiler:hover{color:white;}
.s {text-decoration:line-through;}
.spoiler{color:black;background-color:black;} .imgur {
.spoiler:hover{color:white;} border:1px solid white;
width:90px;
.imgur { height:90px;
border:1px solid white; opacity:0.6;
width:90px; -moz-transition:all 0.1s linear;
height:90px; -webkit-transition:all 0.1s linear;
opacity:0.6; }
-moz-transition:all 0.1s linear; .imgur:hover {opacity: 1.0;}
-webkit-transition:all 0.1s linear;
} /* Header */
.imgur:hover {opacity: 1.0;} .header {
background:#DDD;
/* Header */ padding:3px;
.header { font-size:0px;
background:#DDD; box-shadow: 0px 4px 24px #CCC;
padding:3px; /*position:absolute;
font-size:0px; left:0;right:0;*/
box-shadow: 0px 4px 24px #CCC; }
/*position:absolute; .header a {
left:0;right:0;*/ background:#DDD;
} color:grey;
.header a { text-decoration: none;
background:#DDD; margin:0px 2px;
color:grey; border:1px solid #DDD;
text-decoration: none; display:inline-block;
margin:0px 2px; height:16px;
border:1px solid #DDD; padding:2px 3px;
display:inline-block; -moz-transition:all 0.1s linear;
height:16px; -webkit-transition:all 0.1s linear;
padding:2px 3px; }
-moz-transition:all 0.1s linear; .header a:hover {
-webkit-transition:all 0.1s linear; background:white;
} color:black;
.header a:hover { border:1px solid black;
background:white; border-color:grey black black grey;
color:black; }
border:1px solid black; .info {
border-color:grey black black grey; display:block;
} border:1px solid darkgrey;
.info { padding:2px 4px;
display:block; margin:10px 5px;
border:1px solid darkgrey; color:black;
padding:2px 4px; background-color:lightyellow;
margin:10px 5px; }
color:black;
background-color:lightyellow; /* Editor page */
} fieldset {border:1px solid grey;}
fieldset legend {
/* Editor page */ padding:2px 6px 2px 6px;
fieldset {border:1px solid grey;} background:#DDD;
fieldset legend { border:1px solid grey;
padding:2px 6px 2px 6px; font-weight:bold;
background:#DDD; }
border:1px solid grey; .editor {
font-weight:bold; padding:0px;
} margin:0px;
.editor { vertical-align:top;
padding:0px; }
margin:0px; #contentctr {
vertical-align:top; border:1px dashed lightgrey;
} position:absolute;
#contentctr { top:120px;right:10px;bottom:10px;left:10px;
border:1px dashed lightgrey; }
position:absolute; .editor textarea {
top:120px;right:10px;bottom:10px;left:10px; font-family:Consolas,Courier,monospace;font-size:10px;
} margin:0;padding:0;border:0;
.editor textarea {
font-family:Consolas,Courier,monospace;font-size:10px; width:100%;height:100%;
margin:0;padding:0;border:0; min-width:100%;min-height:100%; /* no resize */
max-width:100%;max-height:100%;
width:100%;height:100%; position:absolute; /* IE7 */
min-width:100%;min-height:100%; /* no resize */ }
max-width:100%;max-height:100%; .frm {
position:absolute; /* IE7 */ border:1px solid #DDD;
} background:#EEE;
.frm { font-size:10px;
border:1px solid #DDD; padding:5px;
background:#EEE; margin:5px 10px 10px 15px;
font-size:10px; }
padding:5px;
margin:5px 10px 10px 15px; /* Tables in content */
} .ti {border-collapse: collapse; border-style:hidden;}
.ti td {border-left:1px solid #DDD;border-right:1px solid #DDD;}
/* Tables in content */ .ti tr:first-child {font-weight:bold;}
.ti {border-collapse: collapse; border-style:hidden;} .ti tr:first-child td {border-bottom:1px solid #DDD;}
.ti td {border-left:1px solid #DDD;border-right:1px solid #DDD;} .ti tr:hover {background-color:#F8F8F8;}
.ti tr:first-child {font-weight:bold;} .ti tr:first-child:hover{background-color:white;}
.ti tr:first-child td {border-bottom:1px solid #DDD;}
.ti tr:hover {background-color:#F8F8F8;} /* Sprites */
.ti tr:first-child:hover{background-color:white;} .sprite {
display:inline-block;
/* Sprites */ width:16px;height:16px;
.sprite { vertical-align:text-bottom;
display:inline-block; background-repeat:no-repeat;
width:16px;height:16px; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAwCAYAAABwrHhvAAAGS0lEQVRYw52Y32sVVxDHl4JI+2ApwUj7YCmC0ioJIVQI0YpSUwlRoxQlInmQoBEjBpsI/gR/Iv5Co9GYqKiXoCCiL0pBRUViNBA3EBAlBIwvvvsPnJ7P4cwyd3fv7k0XvnfnnvnO7OyPc2bOBMaY4O7duwncunUrvH37tgHIekz+YyvQ/DSg13yB+ykUCkXo7+8PBwYGzOTkpAMyY1euXHH/OcPTjm7cuBHxNS5evBidL1++HKYGcO3atQgXLlwIz507Z8bHx83nz58dkBk7deqUeffunTl27JiBqx1dvXrVfPz4MYF9+/aZ169fOyAfOXIkTARw6dIlh+PHj4eHDh1yZKJGBsiMIXOhnTt3GvjaUU9Pjws0jtbWVhe0gP+JAE6fPh3s2bMnxPGjR4/M+/fv3UVu3rzpgMwYOuQtW7YYbLQjeTpxnDx50ixZsiQCtokAtm7dGra0tLiLYYTMOxsdHXVAZgwdHGRstKPD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tUlpttH0WBYt/efQyr5EZ87o+uNhgG09i/KfXUPY0tA7rbf52yyfVCx8O+78XL15Ed4XMGDo4cLHBVvoKGnnrf1EAZ8+erWZtZ+0eHh7O3d/DgYsNtrpnoKH7B6U6aIwHtlIJDh48OGDTpesB8NGV2tujgwMXG2x1b0FD9w+YCVKUajAejI6OOuzfv7+7o6Njkkddam+PDg5csSvnMUvnTTpuAsaCt2/fRrCO6ykeSu3t0cHRNuV+bLoDJ+B/YIUI7e3tvZRO5H+mHgUGQGYMHRxtU87FdQdOunAyYwKbaiOsX78+pA9UKBTcB0eLDSAzhg6Otsm6sHTf9EyRKknOwcuXLyPYVPpVphvVjL3YEECW6QlH22QFkDZDGNuwYUMo5+D58+cONsPNqqmpcQXnqlWrJtra2jpFh8wYOjhwRZcVQNoMiXfXnBOfMqsrKipWNDQ09Fp5RUp/YIUNomf27NlLfU6f523n+31/vc/5f6TYNvqaoN7XBPQifnPXlb2+rwdkf1/pawDpD8xV/YGZMRs5Znp9paondH9hjqopZojRf/M9B2Tz737/AAAAAElFTkSuQmCC);
vertical-align:text-bottom; }
background-repeat:no-repeat; .sprite.hm { background-position:0px 0px;}
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAwCAYAAABwrHhvAAAGS0lEQVRYw52Y32sVVxDHl4JI+2ApwUj7YCmC0ioJIVQI0YpSUwlRoxQlInmQoBEjBpsI/gR/Iv5Co9GYqKiXoCCiL0pBRUViNBA3EBAlBIwvvvsPnJ7P4cwyd3fv7k0XvnfnnvnO7OyPc2bOBMaY4O7duwncunUrvH37tgHIekz+YyvQ/DSg13yB+ykUCkXo7+8PBwYGzOTkpAMyY1euXHH/OcPTjm7cuBHxNS5evBidL1++HKYGcO3atQgXLlwIz507Z8bHx83nz58dkBk7deqUeffunTl27JiBqx1dvXrVfPz4MYF9+/aZ169fOyAfOXIkTARw6dIlh+PHj4eHDh1yZKJGBsiMIXOhnTt3GvjaUU9Pjws0jtbWVhe0gP+JAE6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BuANW6VxQS5FE96CfGeArMFMJYZwKdPn1JhHY5LFYxciie9BDlLX0FKePoNmQHYaBOwi858NiDiEJmxNK70E3TSYYxeQ1mzYGJiIrArXb2tUlpttH0WBYt/efQyr5EZ87o+uNhgG09i/KfXUPY0tA7rbf52yyfVCx8O+78XL15Ed4XMGDo4cLHBVvoKGnnrf1EAZ8+erWZtZ+0eHh7O3d/DgYsNtrpnoKH7B6U6aIwHtlIJDh48OGDTpesB8NGV2tujgwMXG2x1b0FD9w+YCVKUajAejI6OOuzfv7+7o6Njkkddam+PDg5csSvnMUvnTTpuAsaCt2/fRrCO6ykeSu3t0cHRNuV+bLoDJ+B/YIUI7e3tvZRO5H+mHgUGQGYMHRxtU87FdQdOunAyYwKbaiOsX78+pA9UKBTcB0eLDSAzhg6Otsm6sHTf9EyRKknOwcuXLyPYVPpVphvVjL3YEECW6QlH22QFkDZDGNuwYUMo5+D58+cONsPNqqmpcQXnqlWrJtra2jpFh8wYOjhwRZcVQNoMiXfXnBOfMqsrKipWNDQ09Fp5RUp/YIUNomf27NlLfU6f523n+31/vc/5f6TYNvqaoN7XBPQifnPXlb2+rwdkf1/pawDpD8xV/YGZMRs5Znp9paondH9hjqopZojRf/M9B2Tz737/AAAAAElFTkSuQmCC); .sprite.hs { background-position:0px -16px;}
} .sprite.sp { background-position:0px -32px;}
.sprite.hm { background-position:0px 0px;} .sprite.nw { background-position:-16px 0px;}
.sprite.hs { background-position:0px -16px;} .sprite.ed { background-position:-16px -16px;}
.sprite.sp { background-position:0px -32px;} .sprite.rn { background-position:-16px -32px;}
.sprite.nw { background-position:-16px 0px;} .sprite.no {
.sprite.ed { background-position:-16px -16px;} background:none;
.sprite.rn { background-position:-16px -32px;} }
.sprite.no { .sep {
background:none; display:inline-block;
} *display:inline; /* IE7 */
.sep { zoom: 1; /* IE7 */
display:inline-block; height:16px;
*display:inline; /* IE7 */ width:0px;
zoom: 1; /* IE7 */ border-left:1px solid darkgrey;
height:16px; border-right:1px solid #DDD;
width:0px; margin:0px 4px;
border-left:1px solid darkgrey; }
border-right:1px solid #DDD; /* Sections */
margin:0px 4px; .section {
} display:inline-block;
/* Sections */ background:#F8F8F8;
.section { width:auto;
display:inline-block; padding:3px;
background:#F8F8F8; border:1px dashed #DDD;
width:auto; }
padding:3px; .sectionheader {
border:1px dashed #DDD; color:green;
} font-weight:bold;
.sectionheader { }
color:green; /* Dropdown */
font-weight:bold; .ddmenu {
} display:block;
/* Dropdown */ position:absolute;
.ddmenu { top:28px;
display:block; left:32px;
position:absolute; width:180px;
top:28px; border-top:1px solid #999;
left:32px; box-shadow: 0px 4px 24px #CCC;
width:180px; z-index: 2;
border-top:1px solid #999; }
box-shadow: 0px 4px 24px #CCC; .ddmenu a {
z-index: 2; color:black;
} display:inline-block;
.ddmenu a { border:1px solid #999;
color:black; border-top:0px;
display:inline-block; width:170px;
border:1px solid #999; padding:4px;
border-top:0px; background:#EEE;
width:170px; }
padding:4px; .ddmenu a:hover {
background:#EEE; text-decoration:none;background:#FFF;
} -moz-transition:all 0.1s linear;
.ddmenu a:hover { -webkit-transition:all 0.1s linear;
text-decoration:none;background:#FFF; }
-moz-transition:all 0.1s linear; #tr1 {
-webkit-transition:all 0.1s linear; width:0px;height:0px;border-bottom:10px solid #999;
} border-right:10px solid transparent;border-left:10px solid transparent;
#tr1 { position:absolute;top:18px;left:35px;z-index:1;
width:0px;height:0px;border-bottom:10px solid #999; }
border-right:10px solid transparent;border-left:10px solid transparent; #tr2 {
position:absolute;top:18px;left:35px;z-index:1; width:0px;height:0px;border-bottom:10px solid #EEE;
} border-right:10px solid transparent;border-left:10px solid transparent;
#tr2 { position:absolute;top:19px;left:35px;z-index:3;
width:0px;height:0px;border-bottom:10px solid #EEE; }
border-right:10px solid transparent;border-left:10px solid transparent; /* Diffs, rawhtml */
position:absolute;top:19px;left:35px;z-index:3; del{text-decoration:none;background:red;font-weight:bold;}
} ins{text-decoration:none;background:lightgreen;font-weight:bold;}
/* Diffs, rawhtml */ .html a {color:red;font-weight:bold;}
del{text-decoration:none;background:red;font-weight:bold;}
ins{text-decoration:none;background:lightgreen;font-weight:bold;} /*
.html a {color:red;font-weight:bold;}
highlight.css
/* Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
highlight.css */
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name> pre code {
display: block; padding: 0.5em;
*/ }
pre code {
display: block; padding: 0.5em; pre .comment,
} pre .annotation,
pre .template_comment,
pre .comment, pre .diff .header,
pre .annotation, pre .chunk,
pre .template_comment, pre .apache .cbracket {
pre .diff .header, color: rgb(0, 128, 0);
pre .chunk, }
pre .apache .cbracket {
color: rgb(0, 128, 0); pre .keyword,
} pre .id,
pre .built_in,
pre .keyword, pre .smalltalk .class,
pre .id, pre .winutils,
pre .built_in, pre .bash .variable,
pre .smalltalk .class, pre .tex .command,
pre .winutils, pre .request,
pre .bash .variable, pre .status,
pre .tex .command, pre .nginx .title,
pre .request, pre .xml .tag,
pre .status, pre .xml .tag .value {
pre .nginx .title, color: rgb(0, 0, 255);
pre .xml .tag, }
pre .xml .tag .value {
color: rgb(0, 0, 255); pre .string,
} pre .title,
pre .parent,
pre .string, pre .tag .value,
pre .title, pre .rules .value,
pre .parent, pre .rules .value .number,
pre .tag .value, pre .ruby .symbol,
pre .rules .value, pre .ruby .symbol .string,
pre .rules .value .number, pre .aggregate,
pre .ruby .symbol, pre .template_tag,
pre .ruby .symbol .string, pre .django .variable,
pre .aggregate, pre .addition,
pre .template_tag, pre .flow,
pre .django .variable, pre .stream,
pre .addition, pre .apache .tag,
pre .flow, pre .date,
pre .stream, pre .tex .formula {
pre .apache .tag, color: rgb(163, 21, 21);
pre .date, }
pre .tex .formula {
color: rgb(163, 21, 21); pre .ruby .string,
} pre .decorator,
pre .filter .argument,
pre .ruby .string, pre .localvars,
pre .decorator, pre .array,
pre .filter .argument, pre .attr_selector,
pre .localvars, pre .pseudo,
pre .array, pre .pi,
pre .attr_selector, pre .doctype,
pre .pseudo, pre .deletion,
pre .pi, pre .envvar,
pre .doctype, pre .shebang,
pre .deletion, pre .preprocessor,
pre .envvar, pre .userType,
pre .shebang, pre .apache .sqbracket,
pre .preprocessor, pre .nginx .built_in,
pre .userType, pre .tex .special,
pre .apache .sqbracket, pre .prompt {
pre .nginx .built_in, color: rgb(43, 145, 175);
pre .tex .special, }
pre .prompt {
color: rgb(43, 145, 175); pre .phpdoc,
} pre .javadoc,
pre .xmlDocTag {
pre .phpdoc, color: rgb(128, 128, 128);
pre .javadoc, }
pre .xmlDocTag {
color: rgb(128, 128, 128); pre .vhdl .typename { font-weight: bold; }
} pre .vhdl .string { color: #666666; }
pre .vhdl .literal { color: rgb(163, 21, 21); }
pre .vhdl .typename { font-weight: bold; } pre .vhdl .attribute { color: #00B0E8; }
pre .vhdl .string { color: #666666; }
pre .vhdl .literal { color: rgb(163, 21, 21); } pre .xml .attribute { color: rgb(255, 0, 0); }
pre .vhdl .attribute { color: #00B0E8; }
pre .xml .attribute { color: rgb(255, 0, 0); }
`)

258
staticResources.go Normal file

File diff suppressed because one or more lines are too long