diff options
author | Determinant <[email protected]> | 2018-07-24 21:36:18 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-07-24 21:36:18 -0400 |
commit | f6f44360ea2d3b98156ffa6aed237f6ef4da26d0 (patch) | |
tree | 0ee974b605eed1b1f9d0f9b44911d875a0cf0af4 | |
download | cgit-dark-f6f44360ea2d3b98156ffa6aed237f6ef4da26d0.tar.gz cgit-dark-f6f44360ea2d3b98156ffa6aed237f6ef4da26d0.tar.bz2 cgit-dark-f6f44360ea2d3b98156ffa6aed237f6ef4da26d0.zip |
init
27 files changed, 1408 insertions, 0 deletions
diff --git a/about-formatting.sh b/about-formatting.sh new file mode 100755 index 0000000..85daf9c --- /dev/null +++ b/about-formatting.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# This may be used with the about-filter or repo.about-filter setting in cgitrc. +# It passes formatting of about pages to differing programs, depending on the usage. + +# Markdown support requires python and markdown-python. +# RestructuredText support requires python and docutils. +# Man page support requires groff. + +# The following environment variables can be used to retrieve the configuration +# of the repository for which this script is called: +# CGIT_REPO_URL ( = repo.url setting ) +# CGIT_REPO_NAME ( = repo.name setting ) +# CGIT_REPO_PATH ( = repo.path setting ) +# CGIT_REPO_OWNER ( = repo.owner setting ) +# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +# CGIT_REPO_SECTION ( = section setting ) +# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) + +cd "$(dirname $0)/html-converters/" +case "$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')" in + *.markdown|*.mdown|*.md|*.mkd) exec ./md2html; ;; + *.rst) exec ./rst2html; ;; + *.[1-9]) exec ./man2html; ;; + *.htm|*.html) exec cat; ;; + *.txt|*) exec ./txt2html; ;; +esac diff --git a/assets/css/cgit.css b/assets/css/cgit.css new file mode 100644 index 0000000..a98f2bb --- /dev/null +++ b/assets/css/cgit.css @@ -0,0 +1,837 @@ +@font-face{ + font-family:'Fantasque Sans Mono'; + src:url('../assets/fonts/FantasqueSansMono-Regular.eot'); +} + +body { + background: #282828; +} + +div#cgit select, div#cgit input { + margin: 0; + padding: 0 0.3em; + height: 2em; + vertical-align: middle; + border: 1px solid #ebdbb2; + background-color: #1d2021; + color: #d5c4a1; + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +div#cgit select:focus, div#cgit input:focus { + outline: none; +} + +div#cgit { + padding: 0em; + margin: 0em; + font-family: sans-serif; + font-size: 10pt; + color: #ebdbb2; + background: #282828; + padding: 4px; +} + +div#cgit a { + color: #ebdbb2; + text-decoration: none; +} + +div#cgit a:hover { + color: #ebdbb2; + text-decoration: underline; +} + +div#cgit table { + border-collapse: collapse; +} + +div#cgit table#header { + width: 100%; + margin-bottom: 1em; +} + +div#cgit table#header td.logo { + width: 96px; + vertical-align: top; +} + +div#cgit table#header td.main { + font-size: 250%; + padding-left: 10px; + white-space: nowrap; +} + +div#cgit table#header td.main a { +} + +div#cgit table#header td.form { + text-align: right; + vertical-align: bottom; + padding-right: 1em; + padding-bottom: 2px; + white-space: nowrap; +} + +div#cgit table#header td.form form, +div#cgit table#header td.form input, +div#cgit table#header td.form select { + font-size: 100%; +} + +div#cgit table#header td.sub { + color: #a89984; + padding-left: 10px; +} + +div#cgit table.tabs { + border-bottom: solid 2px #d5c4a1; + border-collapse: collapse; + margin-top: 2em; + margin-bottom: 0px; + width: 100%; +} + +div#cgit table.tabs td { + padding: 2px 1em; + vertical-align: bottom; +} + +div#cgit table.tabs td a { + padding: 3px 0.75em; + color: #d5c4a1; + font-size: 110%; +} + +div#cgit table.tabs td a.active { + color: #000; + background-color: #d5c4a1; +} + +div#cgit table.tabs a[href^="http://"]:after, div#cgit table.tabs a[href^="https://"]:after { + content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgAhcJDQY+gm2TAAAAHWlUWHRDb21tZW50AAAAAABDcmVhdGVkIHdpdGggR0lNUGQuZQcAAABbSURBVAhbY2BABs4MU4CwhYHBh2Erww4wrGFQZHjI8B8IgUIscJWyDHcggltQhI4zGDCcRwhChPggHIggP1QoAVmQkSETrGoHsiAEsACtBYN0oDAMbgU6EBcAAL2eHUt4XUU4AAAAAElFTkSuQmCC); + opacity: 0.5; + margin: 0 0 0 5px; +} + +div#cgit table.tabs td.form { + text-align: right; +} + +div#cgit table.tabs td.form form { + padding-bottom: 2px; + font-size: 100%; + white-space: nowrap; +} + +div#cgit table.tabs td.form input, +div#cgit table.tabs td.form select { + font-size: 100%; +} + +div#cgit div.path { + margin: 0px; + padding: 5px 2em 2px 2em; + background: #3c3836; +} + +div#cgit div.content { + margin: 0px; + padding: 2em; + border-bottom: solid 2px #d5c4a1; +} + + +div#cgit table.list { + width: 100%; + border: none; + border-collapse: collapse; +} + +div#cgit table.list tr { +} + +div#cgit table.list tr.logheader { +} + +div#cgit table.list tr:nth-child(even) { + background: #2a2a2a; +} + +div#cgit table.list tr:nth-child(odd) { + background: #323232; +} + +div#cgit table.list tr:hover { + background: #282828; +} + +div#cgit table.list tr.nohover { +} + +div#cgit table.list tr.nohover:hover { +} + +div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { + background: #323232; +} + +div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { + background: #2a2a2a; +} + +div#cgit table.list th { + font-weight: bold; + padding: 0.25em 0.5em 0.27em 0.5em; + vertical-align: baseline; +} + +div#cgit table.list td { + border: none; + padding: 0.25em 0.5em 0.25em 0.5em; +} + +div#cgit table.list td.commitgraph { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + white-space: pre; +} + +div#cgit table.list td.commitgraph .column1 { + color: #fb4934; +} + +div#cgit table.list td.commitgraph .column2 { + color: #b8bb26; +} + +div#cgit table.list td.commitgraph .column3 { + color: #fabd2f; +} + +div#cgit table.list td.commitgraph .column4 { + color: #83a598; +} + +div#cgit table.list td.commitgraph .column5 { + color: #d3869b; +} + +div#cgit table.list td.commitgraph .column6 { + color: #8ec07c; +} + +div#cgit table.list td.logsubject { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + font-weight: bold; +} + +div#cgit table.list td.logmsg { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + white-space: pre; + padding: 0 0.5em; +} + +div#cgit table.list td a { +} + +div#cgit table.list td a.ls-dir { + font-weight: bold; +} + +div#cgit table.list td a:hover { +} + +div#cgit img { + border: none; +} + +div#cgit input#switch-btn { + margin: 2px 0px 0px 0px; +} + +div#cgit td#sidebar input.txt { + width: 100%; + margin: 2px 0px 0px 0px; +} + +div#cgit table#grid { + margin: 0px; +} + +div#cgit td#content { + vertical-align: top; + padding: 1em 2em 1em 1em; + border: none; +} + +div#cgit div#summary { + vertical-align: top; + margin-bottom: 1em; +} + +div#cgit table#downloads { + float: right; + border-collapse: collapse; + border: solid 1px #a89984; + margin-left: 0.5em; + margin-bottom: 0.5em; +} + +div#cgit table#downloads th { + background-color: #d5c4a1; +} + +div#cgit div#blob { + border: solid 1px #fbf1c7; +} + +div#cgit div.error { + color: #cc241d; + font-weight: bold; + margin: 1em 2em; +} + +div#cgit a.ls-blob, div#cgit a.ls-dir, div#cgit .ls-mod { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; +} + +div#cgit td.ls-size { + text-align: right; + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + width: 10em; +} + +div#cgit td.ls-mode { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + width: 10em; +} + +div#cgit table.blob { + margin-top: 0.5em; + border-top: solid 1px #fbf1c7; +} + +div#cgit pre { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; +} + +div#cgit table.blob td.lines { + margin: 0; padding: 0.5em 0 0 1em; + vertical-align: top; +} + +div#cgit table.blob td.linenumbers { + margin: 0; padding: 0.5em 0.5em 0 0.5em; + vertical-align: top; + text-align: right; + border-right: 1px solid #fbf1c7; +} + +div#cgit table.blob pre { + padding: 0; margin: 0; +} + +div#cgit table.blob td.linenumbers a, +div#cgit table.ssdiff td.lineno a { + text-align: right; + text-decoration: none; +} + +div#cgit table.blob td.linenumbers a:hover, +div#cgit table.ssdiff td.lineno a:hover { +} + +div#cgit table.bin-blob { + margin-top: 0.5em; + border: solid 1px #fbf1c7; +} + +div#cgit table.bin-blob th { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + white-space: pre; + border: solid 1px #a89984; + padding: 0.5em 1em; +} + +div#cgit table.bin-blob td { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + white-space: pre; + border-left: solid 1px #a89984; + padding: 0em 1em; +} + +div#cgit table.nowrap td { + white-space: nowrap; +} + +div#cgit table.commit-info { + border-collapse: collapse; + margin-top: 1.5em; +} + +div#cgit div.cgit-panel { + float: right; + margin-top: 1.5em; +} + +div#cgit div.cgit-panel table { + border-collapse: collapse; + border: solid 1px #928374; +} + +div#cgit div.cgit-panel th { + text-align: center; +} + +div#cgit div.cgit-panel td { + padding: 0.25em 0.5em; +} + +div#cgit div.cgit-panel td.label { + padding-right: 0.5em; +} + +div#cgit div.cgit-panel td.ctrl { + padding-left: 0.5em; +} + +div#cgit table.commit-info th { + text-align: left; + font-weight: normal; + padding: 0.1em 1em 0.1em 0.1em; + vertical-align: top; +} + +div#cgit table.commit-info td { + font-weight: normal; + padding: 0.1em 1em 0.1em 0.1em; +} + +div#cgit div.commit-subject { + font-weight: bold; + font-size: 125%; + margin: 1.5em 0em 0.5em 0em; + padding: 0em; +} + +div#cgit div.commit-msg { + white-space: pre; + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; +} + +div#cgit div.notes-header { + font-weight: bold; + padding-top: 1.5em; +} + +div#cgit div.notes { + white-space: pre; + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + border: solid 1px #ee9; + padding: 0.3em 2em 0.3em 1em; + float: left; +} + +div#cgit div.notes-footer { + clear: left; +} + +div#cgit div.diffstat-header { + font-weight: bold; + padding-top: 1.5em; +} + +div#cgit table.diffstat { + border-collapse: collapse; +} + +div#cgit table.diffstat th { + font-weight: normal; + text-align: left; + text-decoration: underline; + padding: 0.1em 1em 0.1em 0.1em; + font-size: 100%; +} + +div#cgit table.diffstat td { + padding: 0.2em 0.2em 0.1em 0.1em; + font-size: 100%; + border: none; +} + +div#cgit table.diffstat td.mode { + white-space: nowrap; +} + +div#cgit table.diffstat td span.modechange { + padding-left: 1em; + color: #cc241d; +} + +div#cgit table.diffstat td.add a { + color: #98971a; +} + +div#cgit table.diffstat td.del a { + color: #cc241d; +} + +div#cgit table.diffstat td.upd a { +} + +div#cgit table.diffstat td.graph { + width: 500px; + vertical-align: middle; +} + +div#cgit table.diffstat td.graph table { + border: none; +} + +div#cgit table.diffstat td.graph td { + padding: 0px; + border: 0px; + height: 7pt; +} + +div#cgit table.diffstat td.graph td.add { + background-color: #b8bb26; +} + +div#cgit table.diffstat td.graph td.rem { + background-color: #fb4934; +} + +div#cgit div.diffstat-summary { + color: #ebdbb2; + padding-top: 0.5em; +} + +div#cgit table.diff { + width: 100%; +} + +div#cgit table.diff td { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + white-space: pre; +} + +div#cgit table.diff td div.head { + font-weight: bold; + margin-top: 1em; +} + +div#cgit table.diff td div.hunk { + color: #fe8019; +} + +div#cgit table.diff td div.add { + color: #98971a; +} + +div#cgit table.diff td div.del { + color: #cc241d; +} + +div#cgit .sha1 { + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + font-size: 90%; +} + +div#cgit .left { + text-align: left; +} + +div#cgit .right { + text-align: right; +} + +div#cgit table.list td.reposection { + font-style: italic; + color: #ebdbb2; +} + +div#cgit a.button { + font-size: 80%; + padding: 0em 0.5em; +} + +div#cgit a.primary { + font-size: 100%; +} + +div#cgit a.secondary { + font-size: 90%; +} + +div#cgit td.toplevel-repo { + +} + +div#cgit table.list td.sublevel-repo { + padding-left: 1.5em; +} + +div#cgit ul.pager { + list-style-type: none; + text-align: center; + margin: 1em 0em 0em 0em; + padding: 0; +} + +div#cgit ul.pager li { + display: inline-block; + margin: 0.25em 0.5em; +} + +div#cgit ul.pager a { + color: #a89984; +} + +div#cgit ul.pager .current { + font-weight: bold; +} + +div#cgit span.age-mins { + font-weight: bold; + color: #689d6a; +} + +div#cgit span.age-hours { + color: #8ec07c; +} + +div#cgit span.age-days { + color: #83a598; +} + +div#cgit span.age-weeks { + color: #a89984; +} + +div#cgit span.age-months { + color: #ebdbb2; +} + +div#cgit span.age-years { + color: #ebdbb2; +} + +div#cgit span.insertions { +} + +div#cgit span.deletions { +} + +div#cgit div.footer { + margin-top: 0.5em; + text-align: center; + font-size: 80%; + color: #d5c4a1; +} + +div#cgit div.footer a { + color: #d5c4a1; + text-decoration: none; +} + +div#cgit div.footer a:hover { + text-decoration: underline; +} + +div#cgit a.branch-deco { + color: #282828; + margin: 0px 0.5em; + padding: 2px 0.25em; + background-color: #b8bb26; +} + +div#cgit a.tag-deco { + color: #282828; + margin: 0px 0.5em; + padding: 2px 0.25em; + background-color: #fabd2f; +} + +div#cgit a.remote-deco { + color: #282828; + margin: 2px 0.5em; + padding: 2px 0.25em; + background-color: #83a598; +} + +div#cgit a.deco { + color: #282828; + margin: 0px 0.5em; + padding: 2px 0.25em; + background-color: #fb4934; +} + +div#cgit div.commit-subject a.branch-deco, +div#cgit div.commit-subject a.tag-deco, +div#cgit div.commit-subject a.remote-deco, +div#cgit div.commit-subject a.deco { + margin-left: 1em; + font-size: 75%; +} + +div#cgit table.stats { + border: solid 1px #fbf1c7; + border-collapse: collapse; +} + +div#cgit table.stats th { + text-align: left; + padding: 1px 0.5em; + border: solid 1px #fbf1c7; +} + +div#cgit table.stats td { + text-align: right; + padding: 1px 0.5em; + border: solid 1px #fbf1c7; +} + +div#cgit table.stats td.total { + font-weight: bold; + text-align: left; +} + +div#cgit table.stats td.sum { + font-weight: bold; +} + +div#cgit table.stats td.left { + text-align: left; +} + +div#cgit table.vgraph { + border-collapse: separate; + border: solid 1px #fbf1c7; + height: 200px; +} + +div#cgit table.vgraph th { + font-weight: bold; + border: solid 1px white; + padding: 1px 0.5em; +} + +div#cgit table.vgraph td { + vertical-align: bottom; + padding: 0px 10px; +} + +div#cgit table.vgraph div.bar { +} + +div#cgit table.hgraph { + border: solid 1px #fbf1c7; + width: 800px; +} + +div#cgit table.hgraph th { + font-weight: bold; + border: solid 1px #fbf1c7; + padding: 1px 0.5em; +} + +div#cgit table.hgraph td { + vertical-align: middle; + padding: 2px 2px; +} + +div#cgit table.hgraph div.bar { + height: 1em; +} + +div#cgit table.ssdiff { + width: 100%; +} + +div#cgit table.ssdiff td { + font-size: 75%; + font-family: 'Fantasque Sans Mono', 'Inconsolata', monospace; + white-space: pre; + padding: 1px 4px 1px 4px; + border-left: solid 1px #928374; + border-right: solid 1px #928374; +} + +div#cgit table.ssdiff td.add { + background: #cfc; + min-width: 50%; +} + +div#cgit table.ssdiff td.add_dark { + background: #aca; + min-width: 50%; +} + +div#cgit table.ssdiff span.add { + background: #cfc; + font-weight: bold; +} + +div#cgit table.ssdiff td.del { + background: #fcc; + min-width: 50%; +} + +div#cgit table.ssdiff td.del_dark { + background: #caa; + min-width: 50%; +} + +div#cgit table.ssdiff span.del { + background: #fcc; + font-weight: bold; +} + +div#cgit table.ssdiff td.changed { + background: #ffc; + min-width: 50%; +} + +div#cgit table.ssdiff td.changed_dark { + background: #cca; + min-width: 50%; +} + +div#cgit table.ssdiff td.lineno { + text-align: right; + width: 3em; + min-width: 3em; +} + +div#cgit table.ssdiff td.hunk { + background: #ccf; + border-top: solid 1px #928374; + border-bottom: solid 1px #928374; +} + +div#cgit table.ssdiff td.head { + border-top: solid 1px #928374; + border-bottom: solid 1px #928374; +} + +div#cgit table.ssdiff td.head div.head { + font-weight: bold; +} + +div#cgit table.ssdiff td.foot { + border-top: solid 1px #928374; + border-left: none; + border-right: none; + border-bottom: none; +} + +div#cgit table.ssdiff td.space { + border: none; +} + +div#cgit table.ssdiff td.space div { + min-height: 3em; +} diff --git a/assets/css/gruvbox.css b/assets/css/gruvbox.css new file mode 100644 index 0000000..a014412 --- /dev/null +++ b/assets/css/gruvbox.css @@ -0,0 +1,73 @@ +.code .hll { background-color: #ffffcc } +.code { background: #282828; color: #ebdbb2; background-color: #282828 } +.code .c { color: #928374; font-style: italic; background-color: #282828 } /* Comment */ +.code .err { color: #ebdbb2; background-color: #282828 } /* Error */ +.code .esc { color: #ebdbb2; background-color: #282828 } /* Escape */ +.code .g { color: #ebdbb2; background-color: #282828 } /* Generic */ +.code .k { color: #fe8019; background-color: #282828 } /* Keyword */ +.code .l { color: #ebdbb2; background-color: #282828 } /* Literal */ +.code .n { color: #ebdbb2; background-color: #282828 } /* Name */ +.code .o { color: #fe8019; background-color: #282828 } /* Operator */ +.code .x { color: #ebdbb2; background-color: #282828 } /* Other */ +.code .p { color: #ebdbb2; background-color: #282828 } /* Punctuation */ +.code .ch { color: #928374; font-style: italic; background-color: #282828 } /* Comment.Hashbang */ +.code .cm { color: #928374; font-style: italic; background-color: #282828 } /* Comment.Multiline */ +.code .cp { color: #8ec07c; background-color: #282828 } /* Comment.Preproc */ +.code .c1 { color: #928374; font-style: italic; background-color: #282828 } /* Comment.Single */ +.code .cs { color: #928374; font-style: italic; background-color: #282828 } /* Comment.Special */ +.code .gd { color: #282828; background-color: #fb4934 } /* Generic.Deleted */ +.code .ge { color: #83a598; text-decoration: underline; background-color: #282828 } /* Generic.Emph */ +.code .gr { color: #ebdbb2; font-weight: bold; background-color: #fb4934 } /* Generic.Error */ +.code .gh { color: #b8bb26; font-weight: bold; background-color: #282828 } /* Generic.Heading */ +.code .gi { color: #282828; background-color: #b8bb26 } /* Generic.Inserted */ +.code .go { color: #504945; background-color: #282828 } /* Generic.Output */ +.code .gp { color: #ebdbb2; background-color: #282828 } /* Generic.Prompt */ +.code .gs { color: #ebdbb2; background-color: #282828 } /* Generic.Strong */ +.code .gu { color: #b8bb26; font-weight: bold; background-color: #282828 } /* Generic.Subheading */ +.code .gt { color: #ebdbb2; font-weight: bold; background-color: #fb4934 } /* Generic.Traceback */ +.code .kc { color: #fe8019; background-color: #282828 } /* Keyword.Constant */ +.code .kd { color: #fe8019; background-color: #282828 } /* Keyword.Declaration */ +.code .kn { color: #fe8019; background-color: #282828 } /* Keyword.Namespace */ +.code .kp { color: #fe8019; background-color: #282828 } /* Keyword.Pseudo */ +.code .kr { color: #fe8019; background-color: #282828 } /* Keyword.Reserved */ +.code .kt { color: #fabd2f; background-color: #282828 } /* Keyword.Type */ +.code .ld { color: #ebdbb2; background-color: #282828 } /* Literal.Date */ +.code .m { color: #d3869b; background-color: #282828 } /* Literal.Number */ +.code .s { color: #b8bb26; background-color: #282828 } /* Literal.String */ +.code .na { color: #b8bb26; font-weight: bold; background-color: #282828 } /* Name.Attribute */ +.code .nb { color: #fabd2f; background-color: #282828 } /* Name.Builtin */ +.code .nc { color: #ebdbb2; background-color: #282828 } /* Name.Class */ +.code .no { color: #d3869b; background-color: #282828 } /* Name.Constant */ +.code .nd { color: #ebdbb2; background-color: #282828 } /* Name.Decorator */ +.code .ni { color: #fabd2f; background-color: #282828 } /* Name.Entity */ +.code .ne { color: #fb4934; background-color: #282828 } /* Name.Exception */ +.code .nf { color: #fabd2f; background-color: #282828 } /* Name.Function */ +.code .nl { color: #fb4934; background-color: #282828 } /* Name.Label */ +.code .nn { color: #ebdbb2; background-color: #282828 } /* Name.Namespace */ +.code .nx { color: #ebdbb2; background-color: #282828 } /* Name.Other */ +.code .py { color: #ebdbb2; background-color: #282828 } /* Name.Property */ +.code .nt { color: #fb4934; background-color: #282828 } /* Name.Tag */ +.code .nv { color: #ebdbb2; background-color: #282828 } /* Name.Variable */ +.code .ow { color: #fe8019; background-color: #282828 } /* Operator.Word */ +.code .w { color: #ebdbb2; background-color: #282828 } /* Text.Whitespace */ +.code .mb { color: #d3869b; background-color: #282828 } /* Literal.Number.Bin */ +.code .mf { color: #d3869b; background-color: #282828 } /* Literal.Number.Float */ +.code .mh { color: #d3869b; background-color: #282828 } /* Literal.Number.Hex */ +.code .mi { color: #d3869b; background-color: #282828 } /* Literal.Number.Integer */ +.code .mo { color: #d3869b; background-color: #282828 } /* Literal.Number.Oct */ +.code .sb { color: #b8bb26; background-color: #282828 } /* Literal.String.Backtick */ +.code .sc { color: #b8bb26; background-color: #282828 } /* Literal.String.Char */ +.code .sd { color: #b8bb26; background-color: #282828 } /* Literal.String.Doc */ +.code .s2 { color: #b8bb26; background-color: #282828 } /* Literal.String.Double */ +.code .se { color: #b8bb26; background-color: #282828 } /* Literal.String.Escape */ +.code .sh { color: #b8bb26; background-color: #282828 } /* Literal.String.Heredoc */ +.code .si { color: #b8bb26; background-color: #282828 } /* Literal.String.Interpol */ +.code .sx { color: #b8bb26; background-color: #282828 } /* Literal.String.Other */ +.code .sr { color: #b8bb26; background-color: #282828 } /* Literal.String.Regex */ +.code .s1 { color: #b8bb26; background-color: #282828 } /* Literal.String.Single */ +.code .ss { color: #83a598; background-color: #282828 } /* Literal.String.Symbol */ +.code .bp { color: #fabd2f; background-color: #282828 } /* Name.Builtin.Pseudo */ +.code .vc { color: #ebdbb2; background-color: #282828 } /* Name.Variable.Class */ +.code .vg { color: #ebdbb2; background-color: #282828 } /* Name.Variable.Global */ +.code .vi { color: #ebdbb2; background-color: #282828 } /* Name.Variable.Instance */ +.code .il { color: #d3869b; background-color: #282828 } /* Literal.Number.Integer.Long */ diff --git a/assets/fonts/FantasqueSansMono-Bold.eot b/assets/fonts/FantasqueSansMono-Bold.eot Binary files differnew file mode 100644 index 0000000..cc1548e --- /dev/null +++ b/assets/fonts/FantasqueSansMono-Bold.eot diff --git a/assets/fonts/FantasqueSansMono-Bold.ttf b/assets/fonts/FantasqueSansMono-Bold.ttf Binary files differnew file mode 100644 index 0000000..f197d40 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-Bold.ttf diff --git a/assets/fonts/FantasqueSansMono-Bold.woff b/assets/fonts/FantasqueSansMono-Bold.woff Binary files differnew file mode 100644 index 0000000..b76d407 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-Bold.woff diff --git a/assets/fonts/FantasqueSansMono-BoldItalic.eot b/assets/fonts/FantasqueSansMono-BoldItalic.eot Binary files differnew file mode 100644 index 0000000..5beefb9 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-BoldItalic.eot diff --git a/assets/fonts/FantasqueSansMono-BoldItalic.ttf b/assets/fonts/FantasqueSansMono-BoldItalic.ttf Binary files differnew file mode 100644 index 0000000..4366dbb --- /dev/null +++ b/assets/fonts/FantasqueSansMono-BoldItalic.ttf diff --git a/assets/fonts/FantasqueSansMono-BoldItalic.woff b/assets/fonts/FantasqueSansMono-BoldItalic.woff Binary files differnew file mode 100644 index 0000000..6f2f2fd --- /dev/null +++ b/assets/fonts/FantasqueSansMono-BoldItalic.woff diff --git a/assets/fonts/FantasqueSansMono-Regular.eot b/assets/fonts/FantasqueSansMono-Regular.eot Binary files differnew file mode 100644 index 0000000..d527c4b --- /dev/null +++ b/assets/fonts/FantasqueSansMono-Regular.eot diff --git a/assets/fonts/FantasqueSansMono-Regular.ttf b/assets/fonts/FantasqueSansMono-Regular.ttf Binary files differnew file mode 100644 index 0000000..50574a9 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-Regular.ttf diff --git a/assets/fonts/FantasqueSansMono-Regular.woff b/assets/fonts/FantasqueSansMono-Regular.woff Binary files differnew file mode 100644 index 0000000..eddd103 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-Regular.woff diff --git a/assets/fonts/FantasqueSansMono-RegularItalic.eot b/assets/fonts/FantasqueSansMono-RegularItalic.eot Binary files differnew file mode 100644 index 0000000..33f02f3 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-RegularItalic.eot diff --git a/assets/fonts/FantasqueSansMono-RegularItalic.ttf b/assets/fonts/FantasqueSansMono-RegularItalic.ttf Binary files differnew file mode 100644 index 0000000..2560dfb --- /dev/null +++ b/assets/fonts/FantasqueSansMono-RegularItalic.ttf diff --git a/assets/fonts/FantasqueSansMono-RegularItalic.woff b/assets/fonts/FantasqueSansMono-RegularItalic.woff Binary files differnew file mode 100644 index 0000000..9c29458 --- /dev/null +++ b/assets/fonts/FantasqueSansMono-RegularItalic.woff diff --git a/assets/fonts/fonts.min.css b/assets/fonts/fonts.min.css new file mode 100644 index 0000000..8fbb5ed --- /dev/null +++ b/assets/fonts/fonts.min.css @@ -0,0 +1 @@ +@font-face{font-family:'Fantasque Sans Mono';src:url(FantasqueSansMono-Bold.eot);src:local('*'),url(FantasqueSansMono-Bold.eot?#iefix) format('embedded-opentype'),url(FantasqueSansMono-Bold.woff) format('woff'),url(FantasqueSansMono-Bold.ttf) format('truetype');font-style:normal;font-weight:700;font-stretch:normal;font-variant:normal}@font-face{font-family:'Fantasque Sans Mono';src:url(FantasqueSansMono-BoldItalic.eot);src:local('*'),url(FantasqueSansMono-BoldItalic.eot?#iefix) format('embedded-opentype'),url(FantasqueSansMono-BoldItalic.woff) format('woff'),url(FantasqueSansMono-BoldItalic.ttf) format('truetype');font-style:italic;font-weight:700;font-stretch:normal;font-variant:normal}@font-face{font-family:'Fantasque Sans Mono';src:url(FantasqueSansMono-Regular.eot);src:local('*'),url(FantasqueSansMono-Regular.eot?#iefix) format('embedded-opentype'),url(FantasqueSansMono-Regular.woff) format('woff'),url(FantasqueSansMono-Regular.ttf) format('truetype');font-style:normal;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'Fantasque Sans Mono';src:url(FantasqueSansMono-RegularItalic.eot);src:local('*'),url(FantasqueSansMono-RegularItalic.eot?#iefix) format('embedded-opentype'),url(FantasqueSansMono-RegularItalic.woff) format('woff'),url(FantasqueSansMono-RegularItalic.ttf) format('truetype');font-style:italic;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-Bold.eot);src:local('*'),url(OpenSans-Bold.eot?#iefix) format('embedded-opentype'),url(OpenSans-Bold.woff) format('woff'),url(OpenSans-Bold.ttf) format('truetype');font-style:normal;font-weight:700;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-BoldItalic.eot);src:local('*'),url(OpenSans-BoldItalic.eot?#iefix) format('embedded-opentype'),url(OpenSans-BoldItalic.woff) format('woff'),url(OpenSans-BoldItalic.ttf) format('truetype');font-style:italic;font-weight:700;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-ExtraBold.eot);src:local('*'),url(OpenSans-ExtraBold.eot?#iefix) format('embedded-opentype'),url(OpenSans-ExtraBold.woff) format('woff'),url(OpenSans-ExtraBold.ttf) format('truetype');font-style:normal;font-weight:800;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-ExtraBoldItalic.eot);src:local('*'),url(OpenSans-ExtraBoldItalic.eot?#iefix) format('embedded-opentype'),url(OpenSans-ExtraBoldItalic.woff) format('woff'),url(OpenSans-ExtraBoldItalic.ttf) format('truetype');font-style:italic;font-weight:800;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-Italic.eot);src:local('*'),url(OpenSans-Italic.eot?#iefix) format('embedded-opentype'),url(OpenSans-Italic.woff) format('woff'),url(OpenSans-Italic.ttf) format('truetype');font-style:italic;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-Light.eot);src:local('*'),url(OpenSans-Light.eot?#iefix) format('embedded-opentype'),url(OpenSans-Light.woff) format('woff'),url(OpenSans-Light.ttf) format('truetype');font-style:normal;font-weight:300;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-LightItalic.eot);src:local('*'),url(OpenSans-LightItalic.eot?#iefix) format('embedded-opentype'),url(OpenSans-LightItalic.woff) format('woff'),url(OpenSans-LightItalic.ttf) format('truetype');font-style:italic;font-weight:300;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-Regular.eot);src:local('*'),url(OpenSans-Regular.eot?#iefix) format('embedded-opentype'),url(OpenSans-Regular.woff) format('woff'),url(OpenSans-Regular.ttf) format('truetype');font-style:normal;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-SemiBold.eot);src:local('*'),url(OpenSans-SemiBold.eot?#iefix) format('embedded-opentype'),url(OpenSans-SemiBold.woff) format('woff'),url(OpenSans-SemiBold.ttf) format('truetype');font-style:normal;font-weight:600;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans';src:url(OpenSans-SemiBoldItalic.eot);src:local('*'),url(OpenSans-SemiBoldItalic.eot?#iefix) format('embedded-opentype'),url(OpenSans-SemiBoldItalic.woff) format('woff'),url(OpenSans-SemiBoldItalic.ttf) format('truetype');font-style:italic;font-weight:600;font-stretch:normal;font-variant:normal}@font-face{font-family:'Open Sans Condensed';src:url(OpenSansCondensed-Bold.eot);src:local('*'),url(OpenSansCondensed-Bold.eot?#iefix) format('embedded-opentype'),url(OpenSansCondensed-Bold.woff) format('woff'),url(OpenSansCondensed-Bold.ttf) format('truetype');font-style:normal;font-weight:700;font-stretch:condensed;font-variant:normal}@font-face{font-family:'Open Sans Condensed';src:url(OpenSansCondensed-Light.eot);src:local('*'),url(OpenSansCondensed-Light.eot?#iefix) format('embedded-opentype'),url(OpenSansCondensed-Light.woff) format('woff'),url(OpenSansCondensed-Light.ttf) format('truetype');font-style:normal;font-weight:300;font-stretch:condensed;font-variant:normal}@font-face{font-family:'Open Sans Condensed';src:url(OpenSansCondensed-LightItalic.eot);src:local('*'),url(OpenSansCondensed-LightItalic.eot?#iefix) format('embedded-opentype'),url(OpenSansCondensed-LightItalic.woff) format('woff'),url(OpenSansCondensed-LightItalic.ttf) format('truetype');font-style:italic;font-weight:300;font-stretch:condensed;font-variant:normal}@font-face{font-family:'PT Sans';src:url(PTSans-Bold.eot);src:local('*'),url(PTSans-Bold.eot?#iefix) format('embedded-opentype'),url(PTSans-Bold.woff) format('woff'),url(PTSans-Bold.ttf) format('truetype');font-style:normal;font-weight:700;font-stretch:normal;font-variant:normal}@font-face{font-family:'PT Sans';src:url(PTSans-BoldItalic.eot);src:local('*'),url(PTSans-BoldItalic.eot?#iefix) format('embedded-opentype'),url(PTSans-BoldItalic.woff) format('woff'),url(PTSans-BoldItalic.ttf) format('truetype');font-style:italic;font-weight:700;font-stretch:normal;font-variant:normal}@font-face{font-family:'PT Sans';src:url(PTSans-Italic.eot);src:local('*'),url(PTSans-Italic.eot?#iefix) format('embedded-opentype'),url(PTSans-Italic.woff) format('woff'),url(PTSans-Italic.ttf) format('truetype');font-style:italic;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'PT Sans';src:url(PTSans-Regular.eot);src:local('*'),url(PTSans-Regular.eot?#iefix) format('embedded-opentype'),url(PTSans-Regular.woff) format('woff'),url(PTSans-Regular.ttf) format('truetype');font-style:normal;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'PT Sans Caption';src:url(PTSansCaption-Bold.eot);src:local('*'),url(PTSansCaption-Bold.eot?#iefix) format('embedded-opentype'),url(PTSansCaption-Bold.woff) format('woff'),url(PTSansCaption-Bold.ttf) format('truetype');font-style:normal;font-weight:700;font-stretch:normal;font-variant:small-caps}@font-face{font-family:'PT Sans Caption';src:url(PTSansCaption-Regular.eot);src:local('*'),url(PTSansCaption-Regular.eot?#iefix) format('embedded-opentype'),url(PTSansCaption-Regular.woff) format('woff'),url(PTSansCaption-Regular.ttf) format('truetype');font-style:normal;font-weight:400;font-stretch:normal;font-variant:small-caps}@font-face{font-family:'PT Sans Narrow';src:url(PTSansNarrow-Bold.eot);src:local('*'),url(PTSansNarrow-Bold.eot?#iefix) format('embedded-opentype'),url(PTSansNarrow-Bold.woff) format('woff'),url(PTSansNarrow-Bold.ttf) format('truetype');font-style:normal;font-weight:700;font-stretch:condensed;font-variant:normal}@font-face{font-family:'PT Sans Narrow';src:url(PTSansNarrow-Regular.eot);src:local('*'),url(PTSansNarrow-Regular.eot?#iefix) format('embedded-opentype'),url(PTSansNarrow-Regular.woff) format('woff'),url(PTSansNarrow-Regular.ttf) format('truetype');font-style:normal;font-weight:400;font-stretch:condensed;font-variant:normal}@font-face{font-family:Satisfy;src:url(Satisfy-Regular.eot);src:local('*'),url(Satisfy-Regular.eot?#iefix) format('embedded-opentype'),url(Satisfy-Regular.woff) format('woff'),url(Satisfy-Regular.ttf) format('truetype');font-style:normal;font-weight:400;font-stretch:normal;font-variant:normal}@font-face{font-family:'Glyphicons Halflings';src:url(glyphicons-halflings-regular.eot);src:url(glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(glyphicons-halflings-regular.woff2) format('woff2'),url(glyphicons-halflings-regular.woff) format('woff'),url(glyphicons-halflings-regular.ttf) format('truetype'),url(glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}
\ No newline at end of file @@ -0,0 +1,57 @@ +include=/home/ymf/repo/cgit/theme.cgitrc +robots=noindex, nofollow + +root-title=Ted's Git Mirror +root-desc=Please contact me before using the code without license information. + +repo.url=h99 +repo.desc=My solutions to ninety-nine Haskell problems. +repo.path=/home/ymf/repo/h99.git + +repo.url=nixie-clock +repo.desc=A multi-functional nixie tube clock implemented in Rust. +repo.path=/home/ymf/repo/nixie-clock.git + +repo.url=ethy.py +repo.desc=Decryption/verification/generation of Ethereum wallets in one script. +repo.path=/home/ymf/repo/ethy.py.git + +repo.url=salticidae +repo.desc=Minimal C++ asynchronous network library. +repo.path=/home/ymf/repo/salticidae.git + +repo.url=cppromise +repo.desc=Lightweight C++14/17 implementation of Promise modeled Javascript Promise/A+. +repo.path=/home/ymf/repo/cppromise.git + +repo.url=runes +repo.desc=No-std NES emulator library and minimal emulator written purely in Rust. +repo.path=/home/ymf/repo/runes.git + +repo.url=nerv +repo.desc=A Lua-based toolkit for high-performance deep learning +repo.path=/home/ymf/repo/nerv.git + +repo.url=nerv-speech +repo.desc=Important extensions for NERV (HTK/Kaldi IO support, sequence training, etc.) +repo.path=/home/ymf/repo/nerv-speech.git + +repo.url=mpd_trigger +repo.desc=Execute whatever you want when MPD (Music Player Daemon) changes its state +repo.path=/home/ymf/repo/mpd_trigger.git + +repo.url=cibic +repo.desc=C Implemented Bare and Ingenuous Compiler +repo.path=/home/ymf/repo/cibic.git + +repo.url=lab_monitor +repo.desc=An easy-to-deploy and simple web interface to monitor whatever you want. +repo.path=/home/ymf/repo/lab_monitor.git + +repo.url=piztor +repo.desc=A simple location sharing system +repo.path=/home/ymf/repo/piztor.git + +repo.url=sonsi +repo.desc=Stupid and Obvious Non-recursive Scheme Interpreter +repo.path=/home/ymf/repo/sonsi.git diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..60542fe --- /dev/null +++ b/footer.html @@ -0,0 +1,3 @@ +<div class="footer"> +Powered by <a href="https://git.zx2c4.com/cgit/about/">cgit v1.1</a>, Themed by Ted Yin. +</div> diff --git a/gen_conf.sh b/gen_conf.sh new file mode 100755 index 0000000..cea5592 --- /dev/null +++ b/gen_conf.sh @@ -0,0 +1,28 @@ +#!/bin/bash +BASE_DIR="$(cd $(dirname $0); pwd -P)" +if [[ ! "$#" -eq 1 ]]; then + echo "please specify the virtual root, e.g. /git/" + exit 1 +fi +VIRT_ROOT=${1%/} +cat > theme.cgitrc << EOF +css= +logo= +virtual-root=$VIRT_ROOT +header=${BASE_DIR}/header.html +footer=${BASE_DIR}/footer.html +source-filter=${BASE_DIR}/syntax-highlighting.py +about-filter=${BASE_DIR}/about-formatting.sh +readme=:README.md +readme=:README.rst +enable-commit-graph=1 +EOF +echo "Done." + +cat > nginx.conf << EOF +location $VIRT_ROOT/assets { + root ${BASE_DIR}; + rewrite ^$VIRT_ROOT/assets(.*)$ /assets\$1 break; + disable_symlinks off; +} +EOF diff --git a/header.html b/header.html new file mode 100644 index 0000000..b168138 --- /dev/null +++ b/header.html @@ -0,0 +1,3 @@ +<link href="/git/assets/css/cgit.css" rel="stylesheet" type="text/css"> +<link href="/git/assets/css/gruvbox.css" rel="stylesheet" type="text/css"> +<link href="/git/assets/fonts/fonts.min.css" rel="stylesheet" type="text/css"> diff --git a/html-converters/man2html b/html-converters/man2html new file mode 100755 index 0000000..0ef7884 --- /dev/null +++ b/html-converters/man2html @@ -0,0 +1,4 @@ +#!/bin/sh +echo "<div style=\"font-family: monospace\">" +groff -mandoc -T html -P -r -P -l | egrep -v '(<html>|<head>|<meta|<title>|</title>|</head>|<body>|</body>|</html>|<!DOCTYPE|"http://www.w3.org)' +echo "</div>" diff --git a/html-converters/md2html b/html-converters/md2html new file mode 100755 index 0000000..3ae9ec7 --- /dev/null +++ b/html-converters/md2html @@ -0,0 +1,294 @@ +#!/usr/bin/env python3 +import markdown +import sys +import io +from pygments.formatters import HtmlFormatter +sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') +sys.stdout.write(''' +<style> +.markdown-body { + font-size: 14px; + line-height: 1.6; + overflow: hidden; +} +.markdown-body>*:first-child { + margin-top: 0 !important; +} +.markdown-body>*:last-child { + margin-bottom: 0 !important; +} +.markdown-body a.absent { + color: #c00; +} +.markdown-body a.anchor { + display: block; + padding-left: 30px; + margin-left: -30px; + cursor: pointer; + position: absolute; + top: 0; + left: 0; + bottom: 0; +} +.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { + margin: 20px 0 10px; + padding: 0; + font-weight: bold; + -webkit-font-smoothing: antialiased; + cursor: text; + position: relative; +} +.markdown-body h1 .mini-icon-link, .markdown-body h2 .mini-icon-link, .markdown-body h3 .mini-icon-link, .markdown-body h4 .mini-icon-link, .markdown-body h5 .mini-icon-link, .markdown-body h6 .mini-icon-link { + display: none; + color: #000; +} +.markdown-body h1:hover a.anchor, .markdown-body h2:hover a.anchor, .markdown-body h3:hover a.anchor, .markdown-body h4:hover a.anchor, .markdown-body h5:hover a.anchor, .markdown-body h6:hover a.anchor { + text-decoration: none; + line-height: 1; + padding-left: 0; + margin-left: -22px; + top: 15%} +.markdown-body h1:hover a.anchor .mini-icon-link, .markdown-body h2:hover a.anchor .mini-icon-link, .markdown-body h3:hover a.anchor .mini-icon-link, .markdown-body h4:hover a.anchor .mini-icon-link, .markdown-body h5:hover a.anchor .mini-icon-link, .markdown-body h6:hover a.anchor .mini-icon-link { + display: inline-block; +} +.markdown-body h1 tt, .markdown-body h1 code, .markdown-body h2 tt, .markdown-body h2 code, .markdown-body h3 tt, .markdown-body h3 code, .markdown-body h4 tt, .markdown-body h4 code, .markdown-body h5 tt, .markdown-body h5 code, .markdown-body h6 tt, .markdown-body h6 code { + font-size: inherit; +} +.markdown-body h1 { + font-size: 28px; + color: #000; +} +.markdown-body h2 { + font-size: 24px; + border-bottom: 1px solid #ccc; + color: #000; +} +.markdown-body h3 { + font-size: 18px; +} +.markdown-body h4 { + font-size: 16px; +} +.markdown-body h5 { + font-size: 14px; +} +.markdown-body h6 { + color: #777; + font-size: 14px; +} +.markdown-body p, .markdown-body blockquote, .markdown-body ul, .markdown-body ol, .markdown-body dl, .markdown-body table, .markdown-body pre { + margin: 15px 0; +} +.markdown-body hr { + background: transparent url("/dirty-shade.png") repeat-x 0 0; + border: 0 none; + color: #ccc; + height: 4px; + padding: 0; +} +.markdown-body>h2:first-child, .markdown-body>h1:first-child, .markdown-body>h1:first-child+h2, .markdown-body>h3:first-child, .markdown-body>h4:first-child, .markdown-body>h5:first-child, .markdown-body>h6:first-child { + margin-top: 0; + padding-top: 0; +} +.markdown-body a:first-child h1, .markdown-body a:first-child h2, .markdown-body a:first-child h3, .markdown-body a:first-child h4, .markdown-body a:first-child h5, .markdown-body a:first-child h6 { + margin-top: 0; + padding-top: 0; +} +.markdown-body h1+p, .markdown-body h2+p, .markdown-body h3+p, .markdown-body h4+p, .markdown-body h5+p, .markdown-body h6+p { + margin-top: 0; +} +.markdown-body li p.first { + display: inline-block; +} +.markdown-body ul, .markdown-body ol { + padding-left: 30px; +} +.markdown-body ul.no-list, .markdown-body ol.no-list { + list-style-type: none; + padding: 0; +} +.markdown-body ul li>:first-child, .markdown-body ul li ul:first-of-type, .markdown-body ul li ol:first-of-type, .markdown-body ol li>:first-child, .markdown-body ol li ul:first-of-type, .markdown-body ol li ol:first-of-type { + margin-top: 0px; +} +.markdown-body ul li p:last-of-type, .markdown-body ol li p:last-of-type { + margin-bottom: 0; +} +.markdown-body ul ul, .markdown-body ul ol, .markdown-body ol ol, .markdown-body ol ul { + margin-bottom: 0; +} +.markdown-body dl { + padding: 0; +} +.markdown-body dl dt { + font-size: 14px; + font-weight: bold; + font-style: italic; + padding: 0; + margin: 15px 0 5px; +} +.markdown-body dl dt:first-child { + padding: 0; +} +.markdown-body dl dt>:first-child { + margin-top: 0px; +} +.markdown-body dl dt>:last-child { + margin-bottom: 0px; +} +.markdown-body dl dd { + margin: 0 0 15px; + padding: 0 15px; +} +.markdown-body dl dd>:first-child { + margin-top: 0px; +} +.markdown-body dl dd>:last-child { + margin-bottom: 0px; +} +.markdown-body blockquote { + border-left: 4px solid #DDD; + padding: 0 15px; + color: #777; +} +.markdown-body blockquote>:first-child { + margin-top: 0px; +} +.markdown-body blockquote>:last-child { + margin-bottom: 0px; +} +.markdown-body table th { + font-weight: bold; +} +.markdown-body table th, .markdown-body table td { + border: 1px solid #ccc; + padding: 6px 13px; +} +.markdown-body table tr { + border-top: 1px solid #ccc; + background-color: #fff; +} +.markdown-body table tr:nth-child(2n) { + background-color: #f8f8f8; +} +.markdown-body img { + max-width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.markdown-body span.frame { + display: block; + overflow: hidden; +} +.markdown-body span.frame>span { + border: 1px solid #ddd; + display: block; + float: left; + overflow: hidden; + margin: 13px 0 0; + padding: 7px; + width: auto; +} +.markdown-body span.frame span img { + display: block; + float: left; +} +.markdown-body span.frame span span { + clear: both; + color: #333; + display: block; + padding: 5px 0 0; +} +.markdown-body span.align-center { + display: block; + overflow: hidden; + clear: both; +} +.markdown-body span.align-center>span { + display: block; + overflow: hidden; + margin: 13px auto 0; + text-align: center; +} +.markdown-body span.align-center span img { + margin: 0 auto; + text-align: center; +} +.markdown-body span.align-right { + display: block; + overflow: hidden; + clear: both; +} +.markdown-body span.align-right>span { + display: block; + overflow: hidden; + margin: 13px 0 0; + text-align: right; +} +.markdown-body span.align-right span img { + margin: 0; + text-align: right; +} +.markdown-body span.float-left { + display: block; + margin-right: 13px; + overflow: hidden; + float: left; +} +.markdown-body span.float-left span { + margin: 13px 0 0; +} +.markdown-body span.float-right { + display: block; + margin-left: 13px; + overflow: hidden; + float: right; +} +.markdown-body span.float-right>span { + display: block; + overflow: hidden; + margin: 13px auto 0; + text-align: right; +} +.markdown-body code, .markdown-body tt { + margin: 0 2px; + padding: 0px 5px; + border: 1px solid #eaeaea; + background-color: #f8f8f8; + border-radius: 3px; +} +.markdown-body code { + white-space: nowrap; +} +.markdown-body pre>code { + margin: 0; + padding: 0; + white-space: pre; + border: none; + background: transparent; +} +.markdown-body .highlight pre, .markdown-body pre { + background-color: #f8f8f8; + border: 1px solid #ccc; + font-size: 13px; + line-height: 19px; + overflow: auto; + padding: 6px 10px; + border-radius: 3px; +} +.markdown-body pre code, .markdown-body pre tt { + margin: 0; + padding: 0; + background-color: transparent; + border: none; +} +''') +#sys.stdout.write(HtmlFormatter(style='pastie').get_style_defs('.highlight')) +sys.stdout.write(''' +</style> +''') +sys.stdout.write("<div class='markdown-body'>") +sys.stdout.flush() +# Note: you may want to run this through bleach for sanitization +markdown.markdownFromFile(output_format="html5", extensions=["markdown.extensions.fenced_code", "markdown.extensions.codehilite", "markdown.extensions.tables"], extension_configs={"markdown.extensions.codehilite":{"css_class":"code"}}) +sys.stdout.write("</div>") diff --git a/html-converters/rst2html b/html-converters/rst2html new file mode 100755 index 0000000..0adca0e --- /dev/null +++ b/html-converters/rst2html @@ -0,0 +1,2 @@ +#!/bin/bash +exec rst2html5 --template <(echo -e "%(body_pre_docinfo)s\n%(docinfo)s\n%(body)s") --syntax-highlight=short diff --git a/html-converters/txt2html b/html-converters/txt2html new file mode 100755 index 0000000..495eece --- /dev/null +++ b/html-converters/txt2html @@ -0,0 +1,4 @@ +#!/bin/sh +echo "<pre>" +sed "s|&|\\&|g;s|'|\\'|g;s|\"|\\"|g;s|<|\\<|g;s|>|\\>|g" +echo "</pre>" diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..41f57a8 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,5 @@ +location /git/assets { + root /home/ymf/repo/cgit; + rewrite ^/git/assets(.*)$ /assets$1 break; + disable_symlinks off; +} diff --git a/syntax-highlighting.py b/syntax-highlighting.py new file mode 100755 index 0000000..5d5682b --- /dev/null +++ b/syntax-highlighting.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 + +# This script uses Pygments and Python3. You must have both installed +# for this to work. +# +# http://pygments.org/ +# http://python.org/ +# +# It may be used with the source-filter or repo.source-filter settings +# in cgitrc. +# +# The following environment variables can be used to retrieve the +# configuration of the repository for which this script is called: +# CGIT_REPO_URL ( = repo.url setting ) +# CGIT_REPO_NAME ( = repo.name setting ) +# CGIT_REPO_PATH ( = repo.path setting ) +# CGIT_REPO_OWNER ( = repo.owner setting ) +# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +# CGIT_REPO_SECTION ( = section setting ) +# CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) + + +import sys +import io +from pygments import highlight +from pygments.util import ClassNotFound +from pygments.lexers import TextLexer +from pygments.lexers import guess_lexer +from pygments.lexers import guess_lexer_for_filename +from pygments.formatters import HtmlFormatter +from os import path + + +sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') +data = sys.stdin.read() +filename = sys.argv[1] +formatter = HtmlFormatter(cssclass="code") + +try: + lexer = guess_lexer_for_filename(filename, data) +except ClassNotFound: + # check if there is any shebang + if data[0:2] == '#!': + try: + lexer = guess_lexer(data) + except ClassNotFound: + lexer = TextLexer() + else: + lexer = TextLexer() +except TypeError: + lexer = TextLexer() + +# highlight! :-) +# printout pygments' css definitions as well +#sys.stdout.write('<style>') +#with open(path.join(path.dirname(path.realpath(__file__)), 'gruvbox.css')) as f: +# sys.stdout.write(f.read()) #formatter.get_style_defs('.highlight')) +#sys.stdout.write('</style>') +sys.stdout.write(highlight(data, lexer, formatter, outfile=None)) diff --git a/theme.cgitrc b/theme.cgitrc new file mode 100644 index 0000000..f9f1f1b --- /dev/null +++ b/theme.cgitrc @@ -0,0 +1,10 @@ +css= +logo= +virtual-root=/git +header=/home/ymf/repo/cgit/header.html +footer=/home/ymf/repo/cgit/footer.html +source-filter=/home/ymf/repo/cgit/syntax-highlighting.py +about-filter=/home/ymf/repo/cgit/about-formatting.sh +readme=:README.md +readme=:README.rst +enable-commit-graph=1 |