Skip to content

Commit

Permalink
Update pretty_expressive doc to 0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorawee committed Feb 11, 2024
1 parent d5c10a7 commit 9c7566e
Show file tree
Hide file tree
Showing 26 changed files with 1,302 additions and 369 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="by-name">
<h2>OCaml package documentation</h2>
<ol>
<li><a href="pretty_expressive/index.html">pretty_expressive</a> <span class="version">0.2</span></li>
<li><a href="pretty_expressive/index.html">pretty_expressive</a> <span class="version">0.3</span></li>
</ol>
</div>
</main>
Expand Down
Binary file added odoc.support/fonts/fira-mono-v14-latin-500.woff2
Binary file not shown.
Binary file not shown.
Binary file added odoc.support/fonts/fira-sans-v17-latin-500.woff2
Binary file not shown.
Binary file not shown.
Binary file added odoc.support/fonts/fira-sans-v17-latin-700.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
373 changes: 273 additions & 100 deletions odoc.support/highlight.pack.js

Large diffs are not rendered by default.

236 changes: 221 additions & 15 deletions odoc.support/odoc.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,105 @@
@charset "UTF-8";
/* Copyright (c) 2016 The odoc contributors. All rights reserved.
Distributed under the ISC license, see terms at the end of the file.
odoc 2.2.0 */
odoc 2.3.0 */

/* Fonts */
@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500');
@import url('https://fonts.googleapis.com/css?family=Noticia+Text:400,400i,700');
@import url('https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,500,500i,600,600i,700,700i');
/* noticia-text-regular - latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 400;
src: url('fonts/noticia-text-v15-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* noticia-text-italic - latin */
@font-face {
font-family: 'Noticia Text';
font-style: italic;
font-weight: 400;
src: url('fonts/noticia-text-v15-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* noticia-text-700 - latin */
@font-face {
font-family: 'Noticia Text';
font-style: normal;
font-weight: 700;
src: url('fonts/noticia-text-v15-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-mono-regular - latin */
@font-face {
font-family: 'Fira Mono';
font-style: normal;
font-weight: 400;
src: url('fonts/fira-mono-v14-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-mono-500 - latin */
@font-face {
font-family: 'Fira Mono';
font-style: normal;
font-weight: 500;
src: url('fonts/fira-mono-v14-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-sans-regular - latin */
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: url('fonts/fira-sans-v17-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-sans-italic - latin */
@font-face {
font-family: 'Fira Sans';
font-style: italic;
font-weight: 400;
src: url('fonts/fira-sans-v17-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-sans-500 - latin */
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: url('fonts/fira-sans-v17-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-sans-500italic - latin */
@font-face {
font-family: 'Fira Sans';
font-style: italic;
font-weight: 500;
src: url('fonts/fira-sans-v17-latin-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-sans-700 - latin */
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 700;
src: url('fonts/fira-sans-v17-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fira-sans-700italic - latin */
@font-face {
font-family: 'Fira Sans';
font-style: italic;
font-weight: 700;
src: url('fonts/fira-sans-v17-latin-700italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


:root,
.light:root {
--main-background: #FFFFFF;

--color: #333333;
--link-color: #2C94BD;
--source-color: grey;
--anchor-hover: #555;
--anchor-color: #d5d5d5;
--xref-shadow: #cc6666;
Expand All @@ -33,6 +119,7 @@
--toc-list-border: #ccc;

--spec-summary-border-color: #5c9cf5;
--spec-label-color: green;
--spec-summary-background: var(--code-background);
--spec-summary-hover-background: #ebeff2;
--spec-details-after-background: rgba(0, 4, 15, 0.05);
Expand Down Expand Up @@ -72,6 +159,8 @@
--hljs-type: #ac885b;
--hljs-meta: #82aaff;
--hljs-variable: #cf6a4c;

--spec-label-color: lightgreen;
}

@media (prefers-color-scheme: dark) {
Expand Down Expand Up @@ -118,6 +207,8 @@
--hljs-type: #ac885b;
--hljs-meta: #82aaff;
--hljs-variable: #cf6a4c;

--spec-label-color: lightgreen;
}
}

Expand All @@ -142,23 +233,31 @@ table {

html {
font-size: 15px;
scroll-behavior: smooth;
}

body {
text-align: left;
background: #FFFFFF;
color: var(--color);
background-color: var(--main-background);
font-family: "Noticia Text", Georgia, serif;
line-height: 1.5;
}

body {
max-width: 100ex;
margin-left: calc(10vw + 20ex);
margin-right: 4ex;
margin-top: 20px;
margin-bottom: 50px;
font-family: "Noticia Text", Georgia, serif;
line-height: 1.5;
}

body.odoc {
max-width: 100ex;
}

body.odoc-src {
margin-right: calc(10vw + 20ex);
}

header {
Expand Down Expand Up @@ -238,6 +337,10 @@ a {
color: var(--link-color);
}

.odoc-src pre a {
color: inherit;
}

a:hover {
box-shadow: 0 1px 0 0 var(--link-color);
}
Expand Down Expand Up @@ -289,6 +392,14 @@ a.anchor {
box-shadow: 0 1px 0 0 var(--xref-shadow);
}

/* Source links float inside preformated text or headings. */
a.source_link {
float: right;
color: var(--source-color);
font-family: "Fira Sans", Helvetica, Arial, sans-serif;
font-size: initial;
}

/* Section and document divisions.
Until at least 4.03 many of the modules of the stdlib start at .h7,
we restart the sequence there like h2 */
Expand Down Expand Up @@ -372,32 +483,32 @@ tt, code, pre {
font-weight: 400;
}

pre {
.odoc pre {
padding: 0.1em;
border: 1px solid var(--pre-border-color);
border-radius: 5px;
overflow-x: auto;
}

p code,
li code {
.odoc p code,
.odoc li code {
background-color: var(--li-code-background);
color: var(--li-code-color);
border-radius: 3px;
padding: 0 0.3ex;
}

p a > code {
p a > code, li a > code {
color: var(--link-color);
}

code {
.odoc code {
white-space: pre-wrap;
}

/* Code blocks (e.g. Examples) */

pre code {
.odoc pre code {
font-size: 0.893rem;
}

Expand All @@ -419,6 +530,10 @@ pre code {
padding: 0.35em 0.5em;
}

.spec .label, .spec .optlabel {
color: var(--spec-label-color);
}

li:not(:last-child) > .def-doc {
margin-bottom: 15px;
}
Expand Down Expand Up @@ -536,6 +651,12 @@ td.def-doc *:first-child {
.at-tags li { padding-left: 3ex; text-indent: -3ex; }
.at-tags .at-tag { text-transform: capitalize }

/* Alert emoji */

.alert::before, .deprecated::before {
content: '⚠️ ';
}

/* Lists of modules */

.modules { list-style-type: none; margin-left: -3ex; }
Expand Down Expand Up @@ -674,10 +795,26 @@ td.def-doc *:first-child {
padding-left: 12px;
}

/* Tables */

.odoc-table {
margin: 1em;
}

.odoc-table td, .odoc-table th {
padding-left: 0.5em;
padding-right: 0.5em;
border: 1px solid black;
}

.odoc-table th {
font-weight: bold;
}

/* Mobile adjustements. */

@media only screen and (max-width: 95ex) {
body.odoc {
@media only screen and (max-width: 110ex) {
body {
margin: 2em;
}
.odoc-toc {
Expand All @@ -704,6 +841,47 @@ td.def-doc *:first-child {
}
}

/* Source code. */

.source_container {
display: flex;
}

.source_line_column {
padding-right: 0.5em;
text-align: right;
background: #eee8d5;
}

.source_line {
padding: 0 1em;
}

.source_code {
flex-grow: 1;
background: #fdf6e3;
padding: 0 0.3em;
color: #657b83;
}

/* Source directories */

.odoc-directory::before {
content: "📁";
margin: 0.3em;
font-size: 1.3em;
}

.odoc-file::before {
content: "📄";
margin: 0.3em;
font-size: 1.3em;
}

.odoc-folder-list {
list-style: none;
}

/* Syntax highlighting (based on github-gist) */

.hljs {
Expand Down Expand Up @@ -777,6 +955,34 @@ td.def-doc *:first-child {
text-decoration: underline;
}

.VAL, .TYPE, .LET, .REC, .IN, .OPEN, .NONREC, .MODULE, .METHOD, .LETOP, .INHERIT, .INCLUDE, .FUNCTOR, .EXTERNAL, .CONSTRAINT, .ASSERT, .AND, .END, .CLASS, .STRUCT, .SIG {
color: #859900;;
}

.WITH, .WHILE, .WHEN, .VIRTUAL, .TRY, .TO, .THEN, .PRIVATE, .OF, .NEW, .MUTABLE, .MATCH, .LAZY, .IF, .FUNCTION, .FUN, .FOR, .EXCEPTION, .ELSE, .TO, .DOWNTO, .DO, .DONE, .BEGIN, .AS {
color: #cb4b16;
}

.TRUE, .FALSE {
color: #b58900;
}

.failwith, .INT, .SEMISEMI, .LIDENT {
color: #2aa198;
}

.STRING, .CHAR, .UIDENT {
color: #b58900;
}

.DOCSTRING {
color: #268bd2;
}

.COMMENT {
color: #93a1a1;
}

/*---------------------------------------------------------------------------
Copyright (c) 2016 The odoc contributors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>C (pretty_expressive.Pretty_expressive.Printer.Make.C)</title><link rel="stylesheet" href="../../../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../../../index.html">pretty_expressive</a> &#x00BB; <a href="../../../index.html">Pretty_expressive</a> &#x00BB; <a href="../../index.html">Printer</a> &#x00BB; <a href="../index.html">Make</a> &#x00BB; C</nav><header class="odoc-preamble"><h1>Parameter <code><span>Make.C</span></code></h1><p>The cost factory interface.</p><p>A valid cost factory should also satisfy the following contracts.</p><ul><li><code>le</code> is a total ordering.</li><li>If <code>le a b</code> and <code>le c d</code> then <code>le (combine a c) (combine b d)</code></li><li>If <code>a</code> &lt;= <code>b</code>, then <code>le (text a l) (text b l)</code></li><li>If <code>a</code> &lt;= <code>b</code>, then <code>le (newline a) (newline b)</code></li><li><code>text c (a + b) = combine (text c a) (text (c + a) b)</code></li><li><code>combine</code> is associative and has the identity equal to <code>text 0 0</code></li><li><code>text c 0</code> = <code>text 0 0</code> for any <code>c</code></li></ul><p>See <a href="../../index.html#val-default_cost_factory"><code>default_cost_factory</code></a>, <a href="../../../../index.html#factory">the cost factory section</a>, and <a href="https://dl.acm.org/doi/abs/10.1145/3622837">the paper</a> for examples of cost factories.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>A type for cost</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-text"><a href="#val-text" class="anchor"></a><code><span><span class="keyword">val</span> text : <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>text c l</code> calculates a cost for a text placement at column position <code>c</code> with length <code>l</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-newline"><a href="#val-newline" class="anchor"></a><code><span><span class="keyword">val</span> newline : <span>int <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>newline i</code> calculates a cost for a newline and indentation at level <code>i</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-combine"><a href="#val-combine" class="anchor"></a><code><span><span class="keyword">val</span> combine : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>combine x y</code> combines the costs <code>x</code> and <code>y</code> together</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-le"><a href="#val-le" class="anchor"></a><code><span><span class="keyword">val</span> le : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>le x y</code> tests if the cost <code>x</code> is less than or equal to the cost <code>y</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-limit"><a href="#val-limit" class="anchor"></a><code><span><span class="keyword">val</span> limit : int</span></code></div><div class="spec-doc"><p><code>limit</code> is <a href="../../../../index.html#complimit">the computation width limit</a>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-debug"><a href="#val-debug" class="anchor"></a><code><span><span class="keyword">val</span> debug : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p><code>debug c</code> produces a string representation of a cost <code>c</code></p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>C (pretty_expressive.Pretty_expressive.Printer.Make.C)</title><link rel="stylesheet" href="../../../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.3.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../../../index.html">pretty_expressive</a> &#x00BB; <a href="../../../index.html">Pretty_expressive</a> &#x00BB; <a href="../../index.html">Printer</a> &#x00BB; <a href="../index.html">Make</a> &#x00BB; C</nav><header class="odoc-preamble"><h1>Parameter <code><span>Make.C</span></code></h1><p>The cost factory interface.</p><p>A valid cost factory should also satisfy the following contracts.</p><ul><li><code>le</code> is a total ordering.</li><li>If <code>le a b</code> and <code>le c d</code> then <code>le (combine a c) (combine b d)</code></li><li>If <code>a</code> &lt;= <code>b</code>, then <code>le (text a l) (text b l)</code></li><li>If <code>a</code> &lt;= <code>b</code>, then <code>le (newline a) (newline b)</code></li><li><code>text c (a + b) = combine (text c a) (text (c + a) b)</code></li><li><code>combine</code> is associative and has the identity equal to <code>text 0 0</code></li><li><code>text c 0</code> = <code>text 0 0</code> for any <code>c</code></li></ul><p>The following contracts are required if <a href="../index.html#val-two_columns" title="Printer.Make.two_columns"><code>two_columns</code></a> is used.</p><ul><li>If <code>a</code> &lt;= <code>b</code>, then <code>le (two_columns_bias a) (two_columns_bias b)</code></li><li>If <code>a</code> &lt;= <code>b</code>, then <code>le (two_columns_overflow a) (two_columns_overflow b)</code></li></ul><p>See <a href="../../index.html#val-default_cost_factory" title="Printer.default_cost_factory"><code>default_cost_factory</code></a>, <a href="../../../../index.html#factory" title="factory">the cost factory section</a>, and <a href="https://dl.acm.org/doi/abs/10.1145/3622837">the paper</a> for examples of cost factories.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p>A type for cost</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-text"><a href="#val-text" class="anchor"></a><code><span><span class="keyword">val</span> text : <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>text c l</code> calculates a cost for a text placement at column position <code>c</code> with length <code>l</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-newline"><a href="#val-newline" class="anchor"></a><code><span><span class="keyword">val</span> newline : <span>int <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>newline i</code> calculates a cost for a newline and indentation at level <code>i</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-combine"><a href="#val-combine" class="anchor"></a><code><span><span class="keyword">val</span> combine : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>combine x y</code> combines the costs <code>x</code> and <code>y</code> together</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-le"><a href="#val-le" class="anchor"></a><code><span><span class="keyword">val</span> le : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p><code>le x y</code> tests if the cost <code>x</code> is less than or equal to the cost <code>y</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-two_columns_bias"><a href="#val-two_columns_bias" class="anchor"></a><code><span><span class="keyword">val</span> two_columns_bias : <span>int <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>two_columns_bias i</code> is the bias cost, added to each possible column separator so that the leftmost column separator is preferred.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-two_columns_overflow"><a href="#val-two_columns_overflow" class="anchor"></a><code><span><span class="keyword">val</span> two_columns_overflow : <span>int <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>two_columns_overflow i</code> is the cost due to exceeding the column separator. Make this cost greater than the usual overflow cost (for exceeding the page width limit) to prefer going over the page width limit instead of going over the column separator.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-limit"><a href="#val-limit" class="anchor"></a><code><span><span class="keyword">val</span> limit : int</span></code></div><div class="spec-doc"><p><code>limit</code> is <a href="../../../../index.html#complimit" title="complimit">the computation width limit</a>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-string_of_cost"><a href="#val-string_of_cost" class="anchor"></a><code><span><span class="keyword">val</span> string_of_cost : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p><code>string_of_cost c</code> produces a string representation of a cost <code>c</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-debug_format"><a href="#val-debug_format" class="anchor"></a><code><span><span class="keyword">val</span> debug_format : <span>string <span class="arrow">&#45;&gt;</span></span> <span>bool <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p><code>debug_format s is_tainted cost</code> produces a debugging string from the output of the core printer.</p></div></div></div></body></html>
Loading

0 comments on commit 9c7566e

Please sign in to comment.