hyakko 0.5.2 → 0.6.0
raw patch · 32 files changed
+1853/−270 lines, 32 filesbinary-added
Files
- hyakko.cabal +31/−4
- resources/hyakko.css +0/−185
- resources/hyakko.html +0/−44
- resources/linear/hyakko.css +338/−0
- resources/linear/hyakko.html +42/−0
- resources/linear/public/fonts/aller-bold.eot binary
- resources/linear/public/fonts/aller-bold.ttf binary
- resources/linear/public/fonts/aller-bold.woff binary
- resources/linear/public/fonts/aller-light.eot binary
- resources/linear/public/fonts/aller-light.ttf binary
- resources/linear/public/fonts/aller-light.woff binary
- resources/linear/public/fonts/fleurons.eot binary
- resources/linear/public/fonts/fleurons.ttf binary
- resources/linear/public/fonts/fleurons.woff binary
- resources/linear/public/fonts/novecento-bold.eot binary
- resources/linear/public/fonts/novecento-bold.ttf binary
- resources/linear/public/fonts/novecento-bold.woff binary
- resources/linear/public/images/gray.png binary
- resources/linear/public/stylesheets/normalize.css +375/−0
- resources/parallel/hyakko.css +506/−0
- resources/parallel/hyakko.html +43/−0
- resources/parallel/public/fonts/aller-bold.eot binary
- resources/parallel/public/fonts/aller-bold.ttf binary
- resources/parallel/public/fonts/aller-bold.woff binary
- resources/parallel/public/fonts/aller-light.eot binary
- resources/parallel/public/fonts/aller-light.ttf binary
- resources/parallel/public/fonts/aller-light.woff binary
- resources/parallel/public/fonts/novecento-bold.eot binary
- resources/parallel/public/fonts/novecento-bold.ttf binary
- resources/parallel/public/fonts/novecento-bold.woff binary
- resources/parallel/public/stylesheets/normalize.css +375/−0
- src/Hyakko.lhs +143/−37
@@ -1,5 +1,5 @@ name: hyakko-version: 0.5.2+version: 0.6.0 cabal-version: >= 1.6 build-type: Simple license: MIT@@ -17,9 +17,36 @@ quick-and-dirty, hundred-line-long, literate-programming-style documentation generator. data-files:- -- HTML template and CSS sytle- resources/hyakko.html- resources/hyakko.css+ -- linear layout files+ resources/linear/hyakko.html+ resources/linear/hyakko.css+ resources/linear/public/images/gray.png+ resources/linear/public/stylesheets/normalize.css+ resources/linear/public/fonts/aller-bold.eot+ resources/linear/public/fonts/aller-bold.ttf+ resources/linear/public/fonts/aller-bold.woff+ resources/linear/public/fonts/aller-light.eot+ resources/linear/public/fonts/aller-light.ttf+ resources/linear/public/fonts/aller-light.woff+ resources/linear/public/fonts/fleurons.eot+ resources/linear/public/fonts/fleurons.ttf+ resources/linear/public/fonts/fleurons.woff+ resources/linear/public/fonts/novecento-bold.eot+ resources/linear/public/fonts/novecento-bold.ttf+ resources/linear/public/fonts/novecento-bold.woff+ -- parallel layout files+ resources/parallel/hyakko.html+ resources/parallel/hyakko.css+ resources/parallel/public/stylesheets/normalize.css+ resources/parallel/public/fonts/aller-bold.eot+ resources/parallel/public/fonts/aller-bold.ttf+ resources/parallel/public/fonts/aller-bold.woff+ resources/parallel/public/fonts/aller-light.eot+ resources/parallel/public/fonts/aller-light.ttf+ resources/parallel/public/fonts/aller-light.woff+ resources/parallel/public/fonts/novecento-bold.eot+ resources/parallel/public/fonts/novecento-bold.ttf+ resources/parallel/public/fonts/novecento-bold.woff extra-source-files: src/Text/Markdown.hs
@@ -1,185 +0,0 @@-/*--------------------- Layout and Typography ----------------------------*/-body {- font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;- font-size: 15px;- line-height: 22px;- color: #252519;- margin: 0; padding: 0;-}-a {- color: #261a3b;-}- a:visited {- color: #261a3b;- }-p {- margin: 0 0 15px 0;-}-h1, h2, h3, h4, h5, h6 {- margin: 0px 0 15px 0;-}- h1 {- margin-top: 40px;- }-#container {- position: relative;-}-#background {- position: fixed;- top: 0; left: 525px; right: 0; bottom: 0;- background: #f5f5ff;- border-left: 1px solid #e5e5ee;- z-index: -1;-}-#jump_to, #jump_page {- background: white;- -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;- -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;- font: 10px Arial;- text-transform: uppercase;- cursor: pointer;- text-align: right;-}-#jump_to, #jump_wrapper {- position: fixed;- right: 0; top: 0;- padding: 5px 10px;-}- #jump_wrapper {- padding: 0;- display: none;- }- #jump_to:hover #jump_wrapper {- display: block;- }- #jump_page {- padding: 5px 0 3px;- margin: 0 0 25px 25px;- }- #jump_page .source {- display: block;- padding: 5px 10px;- text-decoration: none;- border-top: 1px solid #eee;- }- #jump_page .source:hover {- background: #f5f5ff;- }- #jump_page .source:first-child {- }-table td {- border: 0;- outline: 0;-}- td.docs, th.docs {- max-width: 450px;- min-width: 450px;- min-height: 5px;- padding: 10px 25px 1px 50px;- overflow-x: hidden;- vertical-align: top;- text-align: left;- }- .docs pre {- margin: 15px 0 15px;- padding-left: 15px;- }- .docs p tt, .docs p code {- background: #f8f8ff;- border: 1px solid #dedede;- font-size: 12px;- padding: 0 0.2em;- }- .pilwrap {- position: relative;- }- .pilcrow {- font: 12px Arial;- text-decoration: none;- color: #454545;- position: absolute;- top: 3px; left: -20px;- padding: 1px 2px;- opacity: 0;- -webkit-transition: opacity 0.2s linear;- }- td.docs:hover .pilcrow {- opacity: 1;- }- td.code, th.code {- padding: 14px 15px 16px 25px;- width: 100%;- vertical-align: top;- background: #f5f5ff;- border-left: 1px solid #e5e5ee;- }- pre, tt, code {- font-size: 12px; line-height: 18px;- font-family: Monaco, Consolas, "Lucida Console", monospace;- margin: 0; padding: 0;- }---/*---------------------- Syntax Highlighting -----------------------------*/-td.linenos { background-color: #f0f0f0; padding-right: 10px; }-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }-body .hll { background-color: #ffffcc }-body .co { color: #408080; font-style: italic } /* Comment */-body .er { border: 1px solid #FF0000 } /* Error */-body .k { color: #954121 } /* Keyword */-body .o { color: #666666 } /* Operator */-body .ot { color: #408080; font-style: italic } /* Comment.Multiline */-body .cp { color: #BC7A00 } /* Comment.Preproc */-body .cs { color: #408080; font-style: italic } /* Comment.Special */-body .gd { color: #A00000 } /* Generic.Deleted */-body .ge { font-style: italic } /* Generic.Emph */-body .gr { color: #FF0000 } /* Generic.Error */-body .gh { color: #000080; font-weight: bold } /* Generic.Heading */-body .gi { color: #00A000 } /* Generic.Inserted */-body .go { color: #808080 } /* Generic.Output */-body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */-body .gs { font-weight: bold } /* Generic.Strong */-body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */-body .gt { color: #0040D0 } /* Generic.Traceback */-body .kc { color: #954121 } /* Keyword.Constant */-body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */-body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */-body .kp { color: #954121 } /* Keyword.Pseudo */-body .kw { color: #954121; font-weight: bold } /* Keyword.Reserved */-body .kt { color: #B00040 } /* Keyword.Type */-body .m { color: #666666 } /* Literal.Number */-body .st { color: #219161 } /* Literal. */-body .na { color: #7D9029 } /* Name.Attribute */-body .nb { color: #954121 } /* Name.Builtin */-body .nc { color: #0000FF; font-weight: bold } /* Name.Class */-body .no { color: #880000 } /* Name.Constant */-body .nd { color: #AA22FF } /* Name.Decorator */-body .ni { color: #999999; font-weight: bold } /* Name.Entity */-body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */-body .fu { color: #0000FF } /* Name.Function */-body .nl { color: #A0A000 } /* Name.Label */-body .dt { color: #0000FF; font-weight: bold } /* Name.Namespace */-body .nt { color: #954121; font-weight: bold } /* Name.Tag */-body .nv { color: #19469D } /* Name.Variable */-body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */-body .w { color: #bbbbbb } /* Text.Whitespace */-body .fl { color: #666666 } /* Literal.Number.Float */-body .mh { color: #666666 } /* Literal.Number.Hex */-body .dv { color: #666666 } /* Literal.Number.Integer */-body .mo { color: #666666 } /* Literal.Number.Oct */-body .sb { color: #219161 } /* Literal.String.Backtick */-body .ch { color: #219161 } /* Literal.String.Char */-body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */-body .s2 { color: #219161 } /* Literal.String.Double */-body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */-body .sh { color: #219161 } /* Literal.String.Heredoc */-body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */-body .sx { color: #954121 } /* Literal.String.Other */-body .sr { color: #BB6688 } /* Literal.String.Regex */-body .s1 { color: #219161 } /* Literal.String.Single */-body .ss { color: #19469D } /* Literal.String.Symbol */-body .bp { color: #954121 } /* Name.Builtin.Pseudo */-body .vc { color: #19469D } /* Name.Variable.Class */-body .vg { color: #19469D } /* Name.Variable.Global */-body .vi { color: #19469D } /* Name.Variable.Instance */-body .il { color: #666666 } /* Literal.Number.Integer.Long */
@@ -1,44 +0,0 @@-<!DOCTYPE html>--<html>-<head>- <title>$title$</title>- <meta http-equiv="content-type" content="text/html; charset=UTF-8">- <link rel="stylesheet" media="all" href="hyakko.css" />-</head>-<body>- <div id="container">- <div id="background"></div>- $if(multi)$- <div id="jump_to">- Jump To …- <div id="jump_wrapper">- <div id="jump_page">-$for(source)$-$source$-$endfor$- </div>- </div>- </div>- $endif$- <table cellpadding="0" cellspacing="0">- <thead>- <tr>- <th class="docs">- <h1>- $title$- </h1>- </th>- <th class="code">- </th>- </tr>- </thead>- <tbody>-$for(section)$-$section$-$endfor$- </tbody>- </table>- </div>-</body>-</html>
@@ -0,0 +1,338 @@+/*--------------------- Typography ----------------------------*/++@font-face {+ font-family: 'aller-light';+ src: url('public/fonts/aller-light.eot');+ src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/aller-light.woff') format('woff'),+ url('public/fonts/aller-light.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++@font-face {+ font-family: 'aller-bold';+ src: url('public/fonts/aller-bold.eot');+ src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/aller-bold.woff') format('woff'),+ url('public/fonts/aller-bold.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++@font-face {+ font-family: 'novecento-bold';+ src: url('public/fonts/novecento-bold.eot');+ src: url('public/fonts/novecento-bold.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/novecento-bold.woff') format('woff'),+ url('public/fonts/novecento-bold.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++@font-face {+ font-family: 'fleurons';+ src: url('public/fonts/fleurons.eot');+ src: url('public/fonts/fleurons.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/fleurons.woff') format('woff'),+ url('public/fonts/fleurons.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++/*--------------------- Base Styles ----------------------------*/++body {+ font-family: "aller-light";+ background: url('public/images/gray.png') #fff;+ background-size: 322px;+ margin: 0;+}++hr {+ height: 1px;+ background: #ddd;+ border: 0;+}++h1, h2, h3, h4, h5, h6 {+ color: #112233;+ font-weight: normal;+ font-family: "novecento-bold";+ text-transform: uppercase;+ line-height: 1em;+ margin-top: 50px;+}+ h1 {+ margin: 0;+ text-align: center;+ }+ h2 {+ font-size: 1.3em;+ }+ h1:after {+ content: "8";+ display: block;+ font-family: "fleurons";+ color: #999;+ font-size: 80px;+ padding: 10px 0 25px;+ }++a {+ color: #000;+}++b, strong {+ font-weight: normal;+ font-family: "aller-bold";+}++blockquote {+ border-left: 5px solid #ccc;+ margin-left: 0;+ padding: 1px 0 1px 1em;+}+ .page blockquote p {+ font-family: Menlo, Consolas, Monaco, monospace;+ font-size: 14px; line-height: 19px;+ color: #999;+ margin: 10px 0 0;+ white-space: pre-wrap;+ }++pre, tt, code {+ font-family: Menlo, Consolas, Monaco, monospace;+ font-size: 12px;+ display: inline-block;+ border: 1px solid #EAEAEA;+ background: #f8f8f8;+ color: #555;+ padding: 0 5px;+ line-height: 20px;+}+ .page pre {+ margin: 0;+ width: 608px;+ padding: 10px 15px;+ background: #fcfcfc;+ -moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);+ -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);+ box-shadow: inset 0 0 10px rgba(0,0,0,0.1);+ overflow-x: auto;+ }+ .page pre code {+ border: 0;+ padding: 0;+ background: transparent;+ }++.fleur {+ font-family: "fleurons";+ font-size: 100px;+ text-align: center;+ margin: 40px 0;+ color: #ccc;+}++/*--------------------- Layout ----------------------------*/++.container {+ width: 760px;+ margin: 0 auto;+ background: #fff;+ background: rgba(255,255,255, 0.4);+ overflow: hidden;+}+ .page {+ width: 640px;+ padding: 30px;+ margin: 30px;+ background: #fff;+ font-size: 17px;+ line-height: 26px;+ }+ .page p {+ color: #30404f;+ margin: 26px 0;+ }++ul.sections {+ list-style: none;+ padding:0 0 5px 0;;+ margin:0;+}++.page li p {+ margin: 12px 0;+}++.toc {+ max-height: 0;+ overflow: hidden;+ text-align: center;+ font-size: 13px;+ line-height: 20px;+ -moz-transition: max-height 1s;+ -webkit-transition: max-height 1s;+ transition: max-height 1s;+}+ .header:hover .toc {+ max-height: 500px;+ }+ .toc h3 {+ margin-top: 20px;+ }+ .toc ol {+ margin: 0 0 20px 0;+ display: inline-block;+ text-align: left;+ list-style-type: upper-roman;+ }+ .toc li {+ font-family: 'novecento-bold';+ }+ .toc li a {+ font-family: 'aller-light';+ }+++/*---------------------- Syntax Highlighting -----------------------------*/++td.linenos { background-color: #f0f0f0; padding-right: 10px; }+span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }+/*++github.com style (c) Vasily Polovnyov <vast@whiteants.net>++*/++pre code {+ display: block; padding: 0.5em;+ color: #000;+ background: #f8f8ff+}++pre .comment,+pre .template_comment,+pre .diff .header,+pre .javadoc {+ color: #408080;+ font-style: italic+}++pre .kw,+pre .assignment,+pre .literal,+pre .css .rule .keyword,+pre .winutils,+pre .javascript .title,+pre .lisp .title,+pre .subst {+ color: #954121;+ /*font-weight: bold*/+}++pre .dv,+pre .hexcolor {+ color: #40a070+}++pre .st,+pre .tag .value,+pre .phpdoc,+pre .tex .formula {+ color: #219161;+}++pre .dt,+pre .fu,+pre .id {+ color: #19469D;+}+pre .params {+ color: #00F;+}++pre .javascript .title,+pre .lisp .title,+pre .subst {+ font-weight: normal+}++pre .class .title,+pre .haskell .label,+pre .tex .command {+ color: #458;+ font-weight: bold+}++pre .tag,+pre .tag .title,+pre .rules .property,+pre .django .tag .keyword {+ color: #000080;+ font-weight: normal+}++pre .attribute,+pre .variable,+pre .instancevar,+pre .lisp .body {+ color: #008080+}++pre .regexp {+ color: #B68+}++pre .class {+ color: #458;+ font-weight: bold+}++pre .symbol,+pre .ruby .symbol .string,+pre .ruby .symbol .keyword,+pre .ruby .symbol .keymethods,+pre .lisp .keyword,+pre .tex .special,+pre .input_number {+ color: #990073+}++pre .builtin,+pre .constructor,+pre .built_in,+pre .lisp .title {+ color: #0086b3+}++pre .ot,+pre .pi,+pre .doctype,+pre .shebang,+pre .cdata {+ color: #999;+ font-weight: bold+}++pre .deletion {+ background: #fdd+}++pre .addition {+ background: #dfd+}++pre .diff .change {+ background: #0086b3+}++pre .chunk {+ color: #aaa+}++pre .tex .formula {+ opacity: 0.5;+}
@@ -0,0 +1,42 @@+<!DOCTYPE html>++<html>+<head>+ <title>$title$</title>+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">+ <link rel="stylesheet" media="all" href="public/stylesheets/normalize.css" />+ $for(css)$+ <link rel="stylesheet" media="all" href="$css$" />+ $endfor$+</head>+<body>+ <div class="container">+ <div class="page">++ <div class="header">+ $if(header)$+ $header$+ $else$+ <h1>$title$</h1>+ $endif$++ $if(multi)$+ <div class="toc">+ <h3>Table of Contents</h3>+ <ol>+ $for(source)$+ <li>$source$</li>+ $endfor$+ </ol>+ </div>+ $endif$+ </div>++$for(section)$+$section$+$endfor$+ <div class="fleur">h</div>+ </div>+ </div>+</body>+</html>
binary file changed (absent → 29804 bytes)
binary file changed (absent → 66836 bytes)
binary file changed (absent → 33244 bytes)
binary file changed (absent → 29509 bytes)
binary file changed (absent → 68620 bytes)
binary file changed (absent → 33124 bytes)
binary file changed (absent → 35557 bytes)
binary file changed (absent → 64772 bytes)
binary file changed (absent → 36284 bytes)
binary file changed (absent → 18190 bytes)
binary file changed (absent → 48136 bytes)
binary file changed (absent → 20576 bytes)
binary file changed (absent → 56906 bytes)
@@ -0,0 +1,375 @@+/*! normalize.css v2.0.1 | MIT License | git.io/normalize */++/* ==========================================================================+ HTML5 display definitions+ ========================================================================== */++/*+ * Corrects `block` display not defined in IE 8/9.+ */++article,+aside,+details,+figcaption,+figure,+footer,+header,+hgroup,+nav,+section,+summary {+ display: block;+}++/*+ * Corrects `inline-block` display not defined in IE 8/9.+ */++audio,+canvas,+video {+ display: inline-block;+}++/*+ * Prevents modern browsers from displaying `audio` without controls.+ * Remove excess height in iOS 5 devices.+ */++audio:not([controls]) {+ display: none;+ height: 0;+}++/*+ * Addresses styling for `hidden` attribute not present in IE 8/9.+ */++[hidden] {+ display: none;+}++/* ==========================================================================+ Base+ ========================================================================== */++/*+ * 1. Sets default font family to sans-serif.+ * 2. Prevents iOS text size adjust after orientation change, without disabling+ * user zoom.+ */++html {+ font-family: sans-serif; /* 1 */+ -webkit-text-size-adjust: 100%; /* 2 */+ -ms-text-size-adjust: 100%; /* 2 */+}++/*+ * Removes default margin.+ */++body {+ margin: 0;+}++/* ==========================================================================+ Links+ ========================================================================== */++/*+ * Addresses `outline` inconsistency between Chrome and other browsers.+ */++a:focus {+ outline: thin dotted;+}++/*+ * Improves readability when focused and also mouse hovered in all browsers.+ */++a:active,+a:hover {+ outline: 0;+}++/* ==========================================================================+ Typography+ ========================================================================== */++/*+ * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,+ * Safari 5, and Chrome.+ */++h1 {+ font-size: 2em;+}++/*+ * Addresses styling not present in IE 8/9, Safari 5, and Chrome.+ */++abbr[title] {+ border-bottom: 1px dotted;+}++/*+ * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.+ */++b,+strong {+ font-weight: bold;+}++/*+ * Addresses styling not present in Safari 5 and Chrome.+ */++dfn {+ font-style: italic;+}++/*+ * Addresses styling not present in IE 8/9.+ */++mark {+ background: #ff0;+ color: #000;+}+++/*+ * Corrects font family set oddly in Safari 5 and Chrome.+ */++code,+kbd,+pre,+samp {+ font-family: monospace, serif;+ font-size: 1em;+}++/*+ * Improves readability of pre-formatted text in all browsers.+ */++pre {+ white-space: pre;+ white-space: pre-wrap;+ word-wrap: break-word;+}++/*+ * Sets consistent quote types.+ */++q {+ quotes: "\201C" "\201D" "\2018" "\2019";+}++/*+ * Addresses inconsistent and variable font size in all browsers.+ */++small {+ font-size: 80%;+}++/*+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.+ */++sub,+sup {+ font-size: 75%;+ line-height: 0;+ position: relative;+ vertical-align: baseline;+}++sup {+ top: -0.5em;+}++sub {+ bottom: -0.25em;+}++/* ==========================================================================+ Embedded content+ ========================================================================== */++/*+ * Removes border when inside `a` element in IE 8/9.+ */++img {+ border: 0;+}++/*+ * Corrects overflow displayed oddly in IE 9.+ */++svg:not(:root) {+ overflow: hidden;+}++/* ==========================================================================+ Figures+ ========================================================================== */++/*+ * Addresses margin not present in IE 8/9 and Safari 5.+ */++figure {+ margin: 0;+}++/* ==========================================================================+ Forms+ ========================================================================== */++/*+ * Define consistent border, margin, and padding.+ */++fieldset {+ border: 1px solid #c0c0c0;+ margin: 0 2px;+ padding: 0.35em 0.625em 0.75em;+}++/*+ * 1. Corrects color not being inherited in IE 8/9.+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.+ */++legend {+ border: 0; /* 1 */+ padding: 0; /* 2 */+}++/*+ * 1. Corrects font family not being inherited in all browsers.+ * 2. Corrects font size not being inherited in all browsers.+ * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome+ */++button,+input,+select,+textarea {+ font-family: inherit; /* 1 */+ font-size: 100%; /* 2 */+ margin: 0; /* 3 */+}++/*+ * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in+ * the UA stylesheet.+ */++button,+input {+ line-height: normal;+}++/*+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`+ * and `video` controls.+ * 2. Corrects inability to style clickable `input` types in iOS.+ * 3. Improves usability and consistency of cursor style between image-type+ * `input` and others.+ */++button,+html input[type="button"], /* 1 */+input[type="reset"],+input[type="submit"] {+ -webkit-appearance: button; /* 2 */+ cursor: pointer; /* 3 */+}++/*+ * Re-set default cursor for disabled elements.+ */++button[disabled],+input[disabled] {+ cursor: default;+}++/*+ * 1. Addresses box sizing set to `content-box` in IE 8/9.+ * 2. Removes excess padding in IE 8/9.+ */++input[type="checkbox"],+input[type="radio"] {+ box-sizing: border-box; /* 1 */+ padding: 0; /* 2 */+}++/*+ * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.+ * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome+ * (include `-moz` to future-proof).+ */++input[type="search"] {+ -webkit-appearance: textfield; /* 1 */+ -moz-box-sizing: content-box;+ -webkit-box-sizing: content-box; /* 2 */+ box-sizing: content-box;+}++/*+ * Removes inner padding and search cancel button in Safari 5 and Chrome+ * on OS X.+ */++input[type="search"]::-webkit-search-cancel-button,+input[type="search"]::-webkit-search-decoration {+ -webkit-appearance: none;+}++/*+ * Removes inner padding and border in Firefox 4+.+ */++button::-moz-focus-inner,+input::-moz-focus-inner {+ border: 0;+ padding: 0;+}++/*+ * 1. Removes default vertical scrollbar in IE 8/9.+ * 2. Improves readability and alignment in all browsers.+ */++textarea {+ overflow: auto; /* 1 */+ vertical-align: top; /* 2 */+}++/* ==========================================================================+ Tables+ ========================================================================== */++/*+ * Remove most spacing between table cells.+ */++table {+ border-collapse: collapse;+ border-spacing: 0;+}
@@ -0,0 +1,506 @@+/*--------------------- Typography ----------------------------*/++@font-face {+ font-family: 'aller-light';+ src: url('public/fonts/aller-light.eot');+ src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/aller-light.woff') format('woff'),+ url('public/fonts/aller-light.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++@font-face {+ font-family: 'aller-bold';+ src: url('public/fonts/aller-bold.eot');+ src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/aller-bold.woff') format('woff'),+ url('public/fonts/aller-bold.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++@font-face {+ font-family: 'novecento-bold';+ src: url('public/fonts/novecento-bold.eot');+ src: url('public/fonts/novecento-bold.eot?#iefix') format('embedded-opentype'),+ url('public/fonts/novecento-bold.woff') format('woff'),+ url('public/fonts/novecento-bold.ttf') format('truetype');+ font-weight: normal;+ font-style: normal;+}++/*--------------------- Layout ----------------------------*/+html { height: 100%; }+body {+ font-family: "aller-light";+ font-size: 14px;+ line-height: 18px;+ color: #30404f;+ margin: 0; padding: 0;+ height:100%;+}+#container { min-height: 100%; }++a {+ color: #000;+}++b, strong {+ font-weight: normal;+ font-family: "aller-bold";+}++p, ul, ol {+ margin: 15px 0 0px;+}++h1, h2, h3, h4, h5, h6 {+ color: #112233;+ line-height: 1em;+ font-weight: normal;+ font-family: "novecento-bold";+ text-transform: uppercase;+ margin: 30px 0 15px 0;+}++h1 {+ margin-top: 40px;+}++hr {+ border: 0;+ background: 1px solid #ddd;+ height: 1px;+ margin: 20px 0;+}++pre, tt, code {+ font-size: 12px; line-height: 16px;+ font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;+ margin: 0; padding: 0;+}+ .annotation pre {+ display: block;+ margin: 0;+ padding: 7px 10px;+ background: #fcfcfc;+ -moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);+ -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);+ box-shadow: inset 0 0 10px rgba(0,0,0,0.1);+ overflow-x: auto;+ }+ .annotation pre code {+ border: 0;+ padding: 0;+ background: transparent;+ }+++blockquote {+ border-left: 5px solid #ccc;+ margin: 0;+ padding: 1px 0 1px 1em;+}+ .sections blockquote p {+ font-family: Menlo, Consolas, Monaco, monospace;+ font-size: 12px; line-height: 16px;+ color: #999;+ margin: 10px 0 0;+ white-space: pre-wrap;+ }++ul.sections {+ list-style: none;+ padding:0 0 5px 0;;+ margin:0;+}++code.sourceCode {+ padding: 0;+ background: inherit;+}++/*+ Force border-box so that % widths fit the parent+ container without overlap because of margin/padding.++ More Info : http://www.quirksmode.org/css/box.html+*/+ul.sections > li > div {+ -moz-box-sizing: border-box; /* firefox */+ -ms-box-sizing: border-box; /* ie */+ -webkit-box-sizing: border-box; /* webkit */+ -khtml-box-sizing: border-box; /* konqueror */+ box-sizing: border-box; /* css3 */+}+++/*---------------------- Jump Page -----------------------------*/+#jump_to, #jump_page {+ margin: 0;+ background: white;+ -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;+ -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;+ font: 16px Arial;+ cursor: pointer;+ text-align: right;+ list-style: none;+}++#jump_to a {+ text-decoration: none;+}++#jump_to a.large {+ display: none;+}+#jump_to a.small {+ font-size: 22px;+ font-weight: bold;+ color: #676767;+}++#jump_to, #jump_wrapper {+ position: fixed;+ right: 0; top: 0;+ padding: 10px 15px;+ margin:0;+}++#jump_wrapper {+ display: none;+ padding:0;+}++#jump_to:hover #jump_wrapper {+ display: block;+}++#jump_page {+ padding: 5px 0 3px;+ margin: 0 0 25px 25px;+}++#jump_page .source {+ display: block;+ padding: 15px;+ text-decoration: none;+ border-top: 1px solid #eee;+}++#jump_page .source:hover {+ background: #f5f5ff;+}++#jump_page .source:first-child {+}++/*---------------------- Low resolutions (> 320px) ---------------------*/+@media only screen and (min-width: 320px) {+ .pilwrap { display: none; }++ ul.sections > li > div {+ display: block;+ padding:5px 10px 0 10px;+ }++ ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {+ padding-left: 30px;+ }++ ul.sections > li > div.content {+ background: #f5f5ff;+ overflow-x:auto;+ -webkit-box-shadow: inset 0 0 5px #e5e5ee;+ box-shadow: inset 0 0 5px #e5e5ee;+ border: 1px solid #dedede;+ margin:5px 10px 5px 10px;+ padding-bottom: 5px;+ }++ ul.sections > li > div.annotation pre {+ margin: 7px 0 7px;+ padding-left: 15px;+ }++ ul.sections > li > div.annotation p tt, .annotation code {+ background: #f8f8ff;+ border: 1px solid #dedede;+ font-size: 12px;+ padding: 0 0.2em;+ }+}++/*---------------------- (> 481px) ---------------------*/+@media only screen and (min-width: 481px) {+ #container {+ position: relative;+ }+ body {+ background-color: #F5F5FF;+ font-size: 15px;+ line-height: 21px;+ }+ pre, tt, code {+ line-height: 18px;+ }+ p, ul, ol {+ margin: 0 0 15px;+ }+++ #jump_to {+ padding: 5px 10px;+ }+ #jump_wrapper {+ padding: 0;+ }+ #jump_to, #jump_page {+ font: 10px Arial;+ text-transform: uppercase;+ }+ #jump_page .source {+ padding: 5px 10px;+ }+ #jump_to a.large {+ display: inline-block;+ }+ #jump_to a.small {+ display: none;+ }++++ #background {+ position: absolute;+ top: 0; bottom: 0;+ width: 350px;+ background: #fff;+ border-right: 1px solid #e5e5ee;+ z-index: -1;+ }++ ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {+ padding-left: 40px;+ }++ ul.sections > li {+ white-space: nowrap;+ }++ ul.sections > li > div {+ display: inline-block;+ }++ ul.sections > li > div.annotation {+ max-width: 350px;+ min-width: 350px;+ min-height: 5px;+ padding: 13px;+ overflow-x: hidden;+ white-space: normal;+ vertical-align: top;+ text-align: left;+ }+ ul.sections > li > div.annotation pre {+ margin: 15px 0 15px;+ padding-left: 15px;+ }++ ul.sections > li > div.content {+ padding: 13px;+ vertical-align: top;+ background: #f5f5ff;+ border: none;+ -webkit-box-shadow: none;+ box-shadow: none;+ }++ .pilwrap {+ position: relative;+ display: inline;+ }++ .pilcrow {+ font: 12px Arial;+ text-decoration: none;+ color: #454545;+ position: absolute;+ top: 3px; left: -20px;+ padding: 1px 2px;+ opacity: 0;+ -webkit-transition: opacity 0.2s linear;+ }+ .for-h1 .pilcrow {+ top: 47px;+ }+ .for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {+ top: 35px;+ }++ ul.sections > li > div.annotation:hover .pilcrow {+ opacity: 1;+ }+}++/*---------------------- (> 1025px) ---------------------*/+@media only screen and (min-width: 1025px) {++ body {+ font-size: 16px;+ line-height: 24px;+ }++ #background {+ width: 525px;+ }+ ul.sections > li > div.annotation {+ max-width: 525px;+ min-width: 525px;+ padding: 10px 25px 1px 50px;+ }+ ul.sections > li > div.content {+ padding: 9px 15px 16px 25px;+ }+}++/*---------------------- Syntax Highlighting -----------------------------*/++td.linenos { background-color: #f0f0f0; padding-right: 10px; }+span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }+/*++github.com style (c) Vasily Polovnyov <vast@whiteants.net>++*/++pre code {+ display: block; padding: 0.5em;+ color: #000;+ background: #f8f8ff+}++pre .comment,+pre .template_comment,+pre .diff .header,+pre .javadoc {+ color: #408080;+ font-style: italic+}++pre .kw,+pre .assignment,+pre .literal,+pre .css .rule .keyword,+pre .winutils,+pre .javascript .title,+pre .lisp .title,+pre .subst {+ color: #954121;+ /*font-weight: bold*/+}++pre .dv,+pre .hexcolor {+ color: #40a070+}++pre .st,+pre .tag .value,+pre .phpdoc,+pre .tex .formula {+ color: #219161;+}++pre .dt,+pre .fu,+pre .id {+ color: #19469D;+}+pre .params {+ color: #00F;+}++pre .javascript .title,+pre .lisp .title,+pre .subst {+ font-weight: normal+}++pre .class .title,+pre .haskell .label,+pre .tex .command {+ color: #458;+ font-weight: bold+}++pre .tag,+pre .tag .title,+pre .rules .property,+pre .django .tag .keyword {+ color: #000080;+ font-weight: normal+}++pre .attribute,+pre .variable,+pre .instancevar,+pre .lisp .body {+ color: #008080+}++pre .regexp {+ color: #B68+}++pre .class {+ color: #458;+ font-weight: bold+}++pre .symbol,+pre .ruby .symbol .string,+pre .ruby .symbol .keyword,+pre .ruby .symbol .keymethods,+pre .lisp .keyword,+pre .tex .special,+pre .input_number {+ color: #990073+}++pre .builtin,+pre .constructor,+pre .built_in,+pre .lisp .title {+ color: #0086b3+}++pre .ot,+pre .pi,+pre .doctype,+pre .shebang,+pre .cdata {+ color: #999;+ font-weight: bold+}++pre .deletion {+ background: #fdd+}++pre .addition {+ background: #dfd+}++pre .diff .change {+ background: #0086b3+}++pre .chunk {+ color: #aaa+}++pre .tex .formula {+ opacity: 0.5;+}
@@ -0,0 +1,43 @@+<!DOCTYPE html>++<html>+<head>+ <title>$title$</title>+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">+ <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">+ $for(css)$+ <link rel="stylesheet" media="all" href="$css$" />+ $endfor$+</head>+<body>+ <div id="container">+ <div id="background"></div>+ $if(multi)$+ <ul id="jump_to">+ <li>+ <a class="large" href="javascript:void(0);">Jump To …</a>+ <a class="small" href="javascript:void(0);">+</a>+ <div id="jump_wrapper">+ <div id="jump_page">+ $for(source)$+ $source$+ $endfor$+ </div>+ </li>+ </ul>+ $endif$+ <ul class="sections">+$if(title)$+ <li id="title">+ <div class="annotation">+ <h1>$title$</h1>+ </div>+ </li>+$endif$+$for(section)$+$section$+$endfor$+ </ul>+ </div>+</body>+</html>
binary file changed (absent → 29804 bytes)
binary file changed (absent → 66836 bytes)
binary file changed (absent → 33244 bytes)
binary file changed (absent → 29509 bytes)
binary file changed (absent → 68620 bytes)
binary file changed (absent → 33124 bytes)
binary file changed (absent → 18190 bytes)
binary file changed (absent → 48136 bytes)
binary file changed (absent → 20576 bytes)
@@ -0,0 +1,375 @@+/*! normalize.css v2.0.1 | MIT License | git.io/normalize */++/* ==========================================================================+ HTML5 display definitions+ ========================================================================== */++/*+ * Corrects `block` display not defined in IE 8/9.+ */++article,+aside,+details,+figcaption,+figure,+footer,+header,+hgroup,+nav,+section,+summary {+ display: block;+}++/*+ * Corrects `inline-block` display not defined in IE 8/9.+ */++audio,+canvas,+video {+ display: inline-block;+}++/*+ * Prevents modern browsers from displaying `audio` without controls.+ * Remove excess height in iOS 5 devices.+ */++audio:not([controls]) {+ display: none;+ height: 0;+}++/*+ * Addresses styling for `hidden` attribute not present in IE 8/9.+ */++[hidden] {+ display: none;+}++/* ==========================================================================+ Base+ ========================================================================== */++/*+ * 1. Sets default font family to sans-serif.+ * 2. Prevents iOS text size adjust after orientation change, without disabling+ * user zoom.+ */++html {+ font-family: sans-serif; /* 1 */+ -webkit-text-size-adjust: 100%; /* 2 */+ -ms-text-size-adjust: 100%; /* 2 */+}++/*+ * Removes default margin.+ */++body {+ margin: 0;+}++/* ==========================================================================+ Links+ ========================================================================== */++/*+ * Addresses `outline` inconsistency between Chrome and other browsers.+ */++a:focus {+ outline: thin dotted;+}++/*+ * Improves readability when focused and also mouse hovered in all browsers.+ */++a:active,+a:hover {+ outline: 0;+}++/* ==========================================================================+ Typography+ ========================================================================== */++/*+ * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,+ * Safari 5, and Chrome.+ */++h1 {+ font-size: 2em;+}++/*+ * Addresses styling not present in IE 8/9, Safari 5, and Chrome.+ */++abbr[title] {+ border-bottom: 1px dotted;+}++/*+ * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.+ */++b,+strong {+ font-weight: bold;+}++/*+ * Addresses styling not present in Safari 5 and Chrome.+ */++dfn {+ font-style: italic;+}++/*+ * Addresses styling not present in IE 8/9.+ */++mark {+ background: #ff0;+ color: #000;+}+++/*+ * Corrects font family set oddly in Safari 5 and Chrome.+ */++code,+kbd,+pre,+samp {+ font-family: monospace, serif;+ font-size: 1em;+}++/*+ * Improves readability of pre-formatted text in all browsers.+ */++pre {+ white-space: pre;+ white-space: pre-wrap;+ word-wrap: break-word;+}++/*+ * Sets consistent quote types.+ */++q {+ quotes: "\201C" "\201D" "\2018" "\2019";+}++/*+ * Addresses inconsistent and variable font size in all browsers.+ */++small {+ font-size: 80%;+}++/*+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.+ */++sub,+sup {+ font-size: 75%;+ line-height: 0;+ position: relative;+ vertical-align: baseline;+}++sup {+ top: -0.5em;+}++sub {+ bottom: -0.25em;+}++/* ==========================================================================+ Embedded content+ ========================================================================== */++/*+ * Removes border when inside `a` element in IE 8/9.+ */++img {+ border: 0;+}++/*+ * Corrects overflow displayed oddly in IE 9.+ */++svg:not(:root) {+ overflow: hidden;+}++/* ==========================================================================+ Figures+ ========================================================================== */++/*+ * Addresses margin not present in IE 8/9 and Safari 5.+ */++figure {+ margin: 0;+}++/* ==========================================================================+ Forms+ ========================================================================== */++/*+ * Define consistent border, margin, and padding.+ */++fieldset {+ border: 1px solid #c0c0c0;+ margin: 0 2px;+ padding: 0.35em 0.625em 0.75em;+}++/*+ * 1. Corrects color not being inherited in IE 8/9.+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.+ */++legend {+ border: 0; /* 1 */+ padding: 0; /* 2 */+}++/*+ * 1. Corrects font family not being inherited in all browsers.+ * 2. Corrects font size not being inherited in all browsers.+ * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome+ */++button,+input,+select,+textarea {+ font-family: inherit; /* 1 */+ font-size: 100%; /* 2 */+ margin: 0; /* 3 */+}++/*+ * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in+ * the UA stylesheet.+ */++button,+input {+ line-height: normal;+}++/*+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`+ * and `video` controls.+ * 2. Corrects inability to style clickable `input` types in iOS.+ * 3. Improves usability and consistency of cursor style between image-type+ * `input` and others.+ */++button,+html input[type="button"], /* 1 */+input[type="reset"],+input[type="submit"] {+ -webkit-appearance: button; /* 2 */+ cursor: pointer; /* 3 */+}++/*+ * Re-set default cursor for disabled elements.+ */++button[disabled],+input[disabled] {+ cursor: default;+}++/*+ * 1. Addresses box sizing set to `content-box` in IE 8/9.+ * 2. Removes excess padding in IE 8/9.+ */++input[type="checkbox"],+input[type="radio"] {+ box-sizing: border-box; /* 1 */+ padding: 0; /* 2 */+}++/*+ * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.+ * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome+ * (include `-moz` to future-proof).+ */++input[type="search"] {+ -webkit-appearance: textfield; /* 1 */+ -moz-box-sizing: content-box;+ -webkit-box-sizing: content-box; /* 2 */+ box-sizing: content-box;+}++/*+ * Removes inner padding and search cancel button in Safari 5 and Chrome+ * on OS X.+ */++input[type="search"]::-webkit-search-cancel-button,+input[type="search"]::-webkit-search-decoration {+ -webkit-appearance: none;+}++/*+ * Removes inner padding and border in Firefox 4+.+ */++button::-moz-focus-inner,+input::-moz-focus-inner {+ border: 0;+ padding: 0;+}++/*+ * 1. Removes default vertical scrollbar in IE 8/9.+ * 2. Improves readability and alignment in all browsers.+ */++textarea {+ overflow: auto; /* 1 */+ vertical-align: top; /* 2 */+}++/* ==========================================================================+ Tables+ ========================================================================== */++/*+ * Remove most spacing between table cells.+ */++table {+ border-collapse: collapse;+ border-spacing: 0;+}
@@ -1,3 +1,6 @@+Hyakko+======+ **Hyakko** is a Haskell port of [docco](http://jashkenas.github.com/docco/): the original quick-and-dirty, hundred-line-line, literate-programming-style documentation generator. It produces HTML that displays your comments@@ -45,7 +48,7 @@ > import Data.List (sort) > import Data.Maybe (fromJust, isNothing) > import Data.Version (showVersion)-> import Control.Monad (filterM, (>=>), forM)+> import Control.Monad (filterM, (>=>), forM, forM_, unless) > import qualified Text.Blaze.Html as B > import Text.Blaze.Html.Renderer.Utf8 (renderHtml) > import qualified Text.Highlighting.Kate as K@@ -56,13 +59,15 @@ > , doesDirectoryExist > , doesFileExist > , createDirectoryIfMissing+> , copyFile > ) > import System.FilePath ( takeBaseName > , takeExtension > , takeFileName > , (</>)+> , addTrailingPathSeparator > )-> import Paths_hyakko (getDataFileName, version)+> import Paths_hyakko (getDataFileName, version, getDataDir) Main Documentation Generation Functions ---------------------------------------@@ -96,14 +101,21 @@ > where generate :: FilePath -> IO () > generate x = do > code <- T.readFile x-> let sections = parse (getLanguage x) code+> dataDir <- getDataDir+> let sections = parse (getLanguage x) code+> opts' = configHyakko opts+> unless (isNothing $ layout opts') $ do+> let layoutDir = fromJust $ layout opts'+> copyDirectory opts'$ dataDir </> "resources"+> </> layoutDir+> </> "public" > if null sections then > putStrLn $ "hyakko doesn't support the language extension " > ++ takeExtension x > else do > let highlighted = highlight x sections-> y = mapSections sections highlighted-> generateHTML opts x y+> y = mapSections sections highlighted+> generateHTML opts' x y Given a string of source code, parse out each comment and the code that follows it, and create an individual **section** for it. Sections take the@@ -250,40 +262,83 @@ </tr> > sectionTemplate :: [Map String Text]+> -> Maybe String > -> [Int] > -> [(String, String)]-> sectionTemplate section = map sections-> where sections x =+> sectionTemplate section layoutType count =+> let isLayout = not $ isNothing layoutType+> sections = if isLayout then layoutFn $ fromJust layoutType+> else undefined+> in map sections count+> where layoutFn "parallel" = parallel+> layoutFn "linear" = linear+> layoutFn _ = undefined+> parallel x = > let x' = x + 1 > sect = section !! x+> docsHtml = T.unpack $ sect M.! "docsHtml"+> codeHtml = T.unpack $ sect M.! "codeHtml"+> codeText = T.unpack $ sect M.! "codeText"+> header = docsHtml =~ L.pack "^\\s*<(h\\d)"+> isBlank = T.null $ replace "\\s" (T.pack codeText) "" > in ("section", concat-> [ "<tr id=\"section-"-> , show x'-> , "\"><td class=\"docs\">"-> , "<div class=\"pilwrap\">"-> , "<a class=\"pilcrow\" href=\"#section-"+> [ "<li id=\"section-" > , show x'+> , "\"><div class=\"annotation\">"+> , "<div class=\"pilwrap"+> , if null header then "" else " for-" ++ tail header+> , "\"><a class=\"pilcrow\" href=\""+> , show x' > , "\">λ</a></div>"-> , T.unpack $ sect M.! "docsHtml"-> , "</td><td class=\"code\">"-> , T.unpack $ sect M.! "codeHtml"-> , "</td></tr>"+> , docsHtml+> , "</div>"+> , if isBlank then "" else "<div class=\"content\">"+> ++ codeHtml ++ "</div>" > ])+> linear x =+> let sect = section !! x+> codeText = T.unpack $ sect M.! "codeText"+> isText = not $ null codeText+> in ("section", concat+> [ T.unpack $ sect M.! "docsHtml"+> , if isText then T.unpack $ sect M.! "codeHtml" else []+> ]) +> cssTemplate :: Hyakko -> [(String, String)]+> cssTemplate opts =+> let maybeLayout = layout opts+> normalize = "public" </> "stylesheets" </> "normalize.css"+> otherFile = if isNothing maybeLayout then ([] ++) else+> (["resources" </> fromJust maybeLayout </> normalize] ++)+> in zip ["css", "css"] $ otherFile ["hyakko.css"]+ Once all of the code is finished highlighting, we can generate the HTML file and write out the documentation. Pass the completed sections into the template found in `resources/hyakko.html` > generateHTML :: Hyakko -> FilePath -> [Map String Text] -> IO () > generateHTML opts src section = do-> let title = takeFileName src-> dest = destination (output opts) src+> let title = takeFileName src+> dest = destination (output opts) src+> maybeLayout = layout opts+> header = T.unpack $ (section !! 0) M.! "docsHtml"+> isHeader = header =~ L.pack "^<(h\\d)"+> count = [0 .. (length section) - 1]+> (h, count') = if isHeader then+> let layout' = if isNothing maybeLayout then ""+> else fromJust maybeLayout+> in ( [("header", header)]+> , (if layout' == "linear" then tail else id) count)+> else+> ([("header", header)], count) > source <- sources $ dirOrFiles opts-> html <- hyakkoTemplate (template opts) $ concat+> html <- hyakkoTemplate opts $ concat > [ [("title", title)]+> , h+> , cssTemplate opts > , multiTemplate $ length source > , sourceTemplate opts source-> , sectionTemplate section [0 .. (length section) - 1]+> , sectionTemplate section maybeLayout count' > ] > putStrLn $ "hyakko: " ++ src ++ " -> " ++ dest > T.writeFile dest html@@ -336,21 +391,31 @@ > destination :: FilePath -> FilePath -> FilePath > destination out fp = out </> (takeBaseName fp) ++ ".html" +The function `hyakkoFile`, used to grab the contents of either the default+css and html or a custom css and html. Then move it to the output directory.++> hyakkoFile :: String -> Hyakko -> IO Text+> hyakkoFile filetype opts = do+> let maybeFile = (if filetype == "css" then css else template) opts+> if isNothing maybeFile then+> readDataFile $ "resources"+> </> (fromJust $ layout opts)+> </> "hyakko." ++ filetype+> else+> T.readFile $ fromJust maybeFile++ Create the template that we will use to generate the Hyakko HTML page. -> hyakkoTemplate :: Maybe FilePath -> [(String, String)] -> IO Text-> hyakkoTemplate maybeFile var = do-> content <- if isNothing maybeFile then-> readDataFile "resources/hyakko.html"-> else-> T.readFile $ fromJust maybeFile+> hyakkoTemplate :: Hyakko -> [(String, String)] -> IO Text+> hyakkoTemplate opts var = do+> content <- hyakkoFile "html" opts > return . T.pack . renderTemplate var $ T.unpack content The CSS styles we'd like to apply to the documentation. -> hyakkoStyles :: Maybe FilePath -> IO Text-> hyakkoStyles Nothing = readDataFile "resources/hyakko.css"-> hyakkoStyles (Just file) = T.readFile file+> hyakkoStyles :: Hyakko -> IO Text+> hyakkoStyles = hyakkoFile "css" Reads from resource path given in cabal package @@ -364,7 +429,7 @@ > files <- forM file $ \x -> do > isDir <- doesDirectoryExist x > if isDir then-> unpackDirectories x+> unpackDirectories x >>= return . fst > else > return [x] > return . sort $ concat files@@ -372,23 +437,49 @@ Turns the directory give into a list of files including all of the files in sub-directories. -> unpackDirectories :: FilePath -> IO [FilePath]+> unpackDirectories :: FilePath -> IO ([FilePath], [FilePath]) > unpackDirectories d = do-> let reg = "[^(^\\.{1,2}$)]" :: ByteString+> let reg = L.pack "[^(^\\.{1,2}$)]" > content <- getDirectoryContents d >>= return . filter (=~ reg) > let content' = map (d </>) content > files <- filterM doesFileExist content' > subdir <- filterM doesDirectoryExist content'-> subcontent <- mapM unpackDirectories subdir >>= return . concat-> return (files ++ subcontent)+> subcontent <- mapM unpackDirectories subdir >>= \x ->+> return (concatMap fst x, concatMap snd x)+> return (files ++ fst subcontent, subdir ++ snd subcontent) +> copyDirectory :: Hyakko -> FilePath -> IO ()+> copyDirectory opts dir = do+> (files, dirs) <- unpackDirectories dir+> dataDir <- getDataDir+> let oldLocation = T.pack . addTrailingPathSeparator $ dataDir+> </> "resources"+> </> (fromJust $ layout opts)+> dirout = output opts+> createDirectoryIfMissing False $ dirout </> "public"++Create all the directories needed to put future files into.++> forM_ dirs $ \x -> do+> let x' = T.pack x+> dir' = T.unpack $ T.replace oldLocation "" x'+> createDirectoryIfMissing False $ dirout </> dir'++Copy all the files into the recently created directories.++> forM_ files $ \x -> do+> let x' = T.pack x+> file = dirout </> (T.unpack $ T.replace oldLocation "" x')+> copyFile x file+ Configuration ------------- Data structure for command line argument parsing. > data Hyakko =-> Hyakko { output :: FilePath+> Hyakko { layout :: Maybe String+> , output :: FilePath > , css :: Maybe FilePath > , template :: Maybe FilePath > , dirOrFiles :: [FilePath]@@ -399,7 +490,9 @@ > defaultConfig :: Hyakko > defaultConfig = Hyakko-> { output = "docs" &= typDir+> { layout = Just "parallel" &= typ "LAYOUT"+> &= help "choose a built-in layout (parallel, linear)"+> , output = "docs" &= typDir > &= help "use a custom output path" > , css = Nothing &= typFile > &= help "use a custom css file"@@ -408,12 +501,25 @@ > , dirOrFiles = [] &= args &= typ "FILES/DIRS" > } &= summary ("hyakko v" ++ showVersion version) +**Configure** this particular run of hyakko. We might use a passed-in+external template, or one of the built-in **layouts**.++> configHyakko :: Hyakko -> Hyakko+> configHyakko oldConfig =+> if isNothing $ template oldConfig then+> let dir = "resources" </> (fromJust $ layout oldConfig)+> in oldConfig { template = Just $ dir </> "hyakko.html"+> , css = Just $ dir </> "hyakko.css"+> }+> else+> oldConfig { layout = Nothing }+ Run the script. > main :: IO () > main = do > opts <- cmdArgs defaultConfig-> style <- hyakkoStyles $ css opts+> style <- hyakkoStyles opts > source <- sources $ dirOrFiles opts > let dirout = output opts > createDirectoryIfMissing False dirout