mirror of
https://github.com/c-cube/linol.git
synced 2026-01-30 21:27:29 -05:00
deploy: 7730eabf98
This commit is contained in:
parent
bc58c16c36
commit
66508f8de1
1829 changed files with 40517 additions and 863 deletions
|
|
@ -1 +0,0 @@
|
|||
theme: jekyll-theme-minimal
|
||||
BIN
_odoc-theme/fonts/DejaVuSansMono-Bold.woff2
Normal file
BIN
_odoc-theme/fonts/DejaVuSansMono-Bold.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/DejaVuSansMono-BoldOblique.woff2
Normal file
BIN
_odoc-theme/fonts/DejaVuSansMono-BoldOblique.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/DejaVuSansMono-Oblique.woff2
Normal file
BIN
_odoc-theme/fonts/DejaVuSansMono-Oblique.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/DejaVuSansMono.woff2
Normal file
BIN
_odoc-theme/fonts/DejaVuSansMono.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/PTC55F.woff2
Normal file
BIN
_odoc-theme/fonts/PTC55F.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/PTC75F.woff2
Normal file
BIN
_odoc-theme/fonts/PTC75F.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/PTS55F.woff2
Normal file
BIN
_odoc-theme/fonts/PTS55F.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/PTS56F.woff2
Normal file
BIN
_odoc-theme/fonts/PTS56F.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/PTS75F.woff2
Normal file
BIN
_odoc-theme/fonts/PTS75F.woff2
Normal file
Binary file not shown.
BIN
_odoc-theme/fonts/PTS76F.woff2
Normal file
BIN
_odoc-theme/fonts/PTS76F.woff2
Normal file
Binary file not shown.
59
_odoc-theme/fonts/fonts.css
Normal file
59
_odoc-theme/fonts/fonts.css
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
@charset "UTF-8";
|
||||
|
||||
/* PT Sans */
|
||||
|
||||
@font-face
|
||||
{ font-family: 'PT-Sans';
|
||||
src: url('PTS55F.woff2') format('woff2');
|
||||
font-weight: 400; font-style: normal; }
|
||||
|
||||
@font-face
|
||||
{ font-family: 'PT-Sans';
|
||||
src: url('PTS75F.woff2') format('woff2');
|
||||
font-weight: 700; font-style: normal; }
|
||||
|
||||
@font-face
|
||||
{ font-family: 'PT-Sans';
|
||||
src: url('PTS56F.woff2') format('woff2');
|
||||
font-weight: 400; font-style: italic; }
|
||||
|
||||
@font-face
|
||||
{ font-family: 'PT-Sans';
|
||||
src: url('PTS76F.woff2') format('woff2');
|
||||
font-weight: 700; font-style: italic; }
|
||||
|
||||
/* PT Sans caption */
|
||||
|
||||
@font-face
|
||||
{ font-family: 'PT-Sans-Caption';
|
||||
src: url('PTC55F.woff2') format('woff2');
|
||||
font-weight: 400; font-style: normal; }
|
||||
|
||||
@font-face
|
||||
{ font-family: 'PT-Sans-Caption';
|
||||
src: url('PTC75F.woff2') format('woff2');
|
||||
font-weight: 700; font-style: normal; }
|
||||
|
||||
/* DejaVu 400 */
|
||||
|
||||
@font-face
|
||||
{ font-family: 'DejaVu-SansMono';
|
||||
src: url('DejaVuSansMono.woff2') format('woff2');
|
||||
font-weight: 400; font-style: normal; }
|
||||
|
||||
@font-face
|
||||
{ font-family: 'DejaVu-SansMono';
|
||||
src: url('DejaVuSansMono-Oblique.woff2') format('woff2');
|
||||
font-weight: 400; font-style: oblique; }
|
||||
|
||||
/* DejaVu 700 */
|
||||
|
||||
@font-face
|
||||
{ font-family: 'DejaVu-SansMono';
|
||||
src: url('DejaVuSansMono-Bold.woff2') format('woff2');
|
||||
font-weight: 700; font-style: normal; }
|
||||
|
||||
@font-face
|
||||
{ font-family: 'DejaVu-SansMono';
|
||||
src: url('DejaVuSansMono-BoldOblique.woff2') format('woff2');
|
||||
font-weight: 700; font-style: oblique; }
|
||||
376
_odoc-theme/manual.css
Normal file
376
_odoc-theme/manual.css
Normal file
|
|
@ -0,0 +1,376 @@
|
|||
@charset "UTF-8";
|
||||
@import url("fonts/fonts.css");
|
||||
@import url("theme.css");
|
||||
|
||||
/* Copyright (c) 2019 The odig programmers. All rights reserved.
|
||||
Distributed under the ISC license, see terms at the end of the file.
|
||||
odig v0.0.9 */
|
||||
|
||||
:root { --font-headings: "PT-Sans-Caption";
|
||||
--font-body: "PT-Sans";
|
||||
--font-mono: "DejaVu-SansMono";
|
||||
|
||||
--size-font: 0.96875rem;
|
||||
--size-font-micro: calc(0.675 * var(--size-font));
|
||||
--size-font-tiny-ratio: 0.75;
|
||||
--size-font-tiny: calc(var(--size-font-tiny-ratio) * var(--size-font));
|
||||
--size-font-small: calc(0.875 * var(--size-font));
|
||||
--size-font-large: calc(1.25 * var(--size-font));
|
||||
--size-font-big: calc(1.5 * var(--size-font));
|
||||
--size-font-huge: calc(1.75 * var(--size-font));
|
||||
--size-font-mono-ratio: 0.87097;
|
||||
--size-line-ratio: 1.5;
|
||||
--size-line: calc(var(--size-line-ratio) * var(--size-font));
|
||||
--size-half-line: calc(0.5 * var(--size-line)); }
|
||||
|
||||
/* Reset a few things. */
|
||||
|
||||
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,
|
||||
a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,select,
|
||||
small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,
|
||||
fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,
|
||||
article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,
|
||||
menu,nav,output,ruby,section,summary,time,mark,audio,video,button,input
|
||||
{ margin: 0; padding: 0; border: 0; /* outline: 0; */
|
||||
font-size: inherit; font: inherit; font-weight: inherit;
|
||||
line-height: inherit; vertical-align: baseline;
|
||||
text-align: inherit; color: inherit; background: transparent; }
|
||||
|
||||
table { border-collapse: collapse; border-spacing: 0; }
|
||||
*, *:before, *:After { box-sizing: border-box; }
|
||||
|
||||
/* Note the stylesheet has quite hackish CSS selectors as the markup's
|
||||
classification is sometimes a bit lacking. */
|
||||
|
||||
/* Geometry.
|
||||
See also media adjustements at the end of the stylesheet. */
|
||||
|
||||
body { background-color: var(--color-bg);
|
||||
color: var(--color-fg);
|
||||
font-size: var(--size-font);
|
||||
font-family: var(--font-body), sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: var(--size-line);
|
||||
text-align: left;
|
||||
position: relative;
|
||||
max-width: 120ch;
|
||||
margin: 0 auto;
|
||||
padding: calc(1.5 * var(--size-line));
|
||||
padding-top: calc(0.5 * var(--size-line)); }
|
||||
|
||||
body > * { max-width: 80ch; width: 75% }
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2) /* toc */
|
||||
{ position: absolute;
|
||||
top: 0px; right: 0px;
|
||||
width: 20%;
|
||||
margin-left: var(--size-line);
|
||||
margin-top: calc(2 * var(--size-line));
|
||||
margin-right: var(--size-line);
|
||||
border-top: solid thin var(--color-rule); }
|
||||
|
||||
/* Rules
|
||||
We remove the top one, keep the last one and add one over h1 and h2 */
|
||||
|
||||
body > hr:last-of-type {
|
||||
margin-top: var(--size-line);
|
||||
border-style: none;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
text-align: right;
|
||||
border-top: solid thin var(--color-rule); }
|
||||
|
||||
body > hr:first-of-type { display: none } /* order with last-of-type imporant */
|
||||
h1, h2 { border-top: solid thin var(--color-rule) }
|
||||
|
||||
/* Hacks */
|
||||
|
||||
body > a > img /* Navigation arrows, a bit problematic for dark themes */
|
||||
{ display: inline-block; margin:0;
|
||||
background-color: var(--color-code-block-bg); /* bof */ }
|
||||
|
||||
body > p br, h1 br { display: none; } /* brs should die */
|
||||
|
||||
/* Basic markup */
|
||||
|
||||
h1, h2, h3, h4, h5, h6
|
||||
{ font-family: var(--font-headings), sans-serif;
|
||||
font-weight: 400;
|
||||
text-transform: uppercase;
|
||||
margin-top: var(--size-line); }
|
||||
|
||||
h1, h2 { line-height: calc(1.5 * var(--size-line));
|
||||
padding-top: calc(0.75 * var(--size-line)); }
|
||||
|
||||
hr + h1, hr + h2 { margin-top: calc(0.25 * var(--size-line)) }
|
||||
|
||||
h1 { font-size: var(--size-font-huge); }
|
||||
h2 { font-size: var(--size-font-big); }
|
||||
h3 { font-size: var(--size-font-large); }
|
||||
|
||||
div, nav, p, ol, ul, dl, pre, table, blockquote
|
||||
{ margin-top: var(--size-half-line); }
|
||||
|
||||
ul, ol { list-style-position: outside }
|
||||
ul { list-style-type: square }
|
||||
ul > li { margin-left: 2.25ch; }
|
||||
ol > li { margin-left: 2ch; }
|
||||
|
||||
em { font-style: italic }
|
||||
b, strong { font-weight: 700 }
|
||||
small { font-size: var(--size-font-small); }
|
||||
|
||||
sup { vertical-align: super; }
|
||||
sub { vertical-align: sub; }
|
||||
sup, sub { font-size : calc(1em * var(--size-font-tiny-ratio));
|
||||
line-height: 0; margin-left: 0.2ex; }
|
||||
|
||||
img { display: block;
|
||||
margin-top: var(--size-half-line); margin-bottom: var(--size-half-line); }
|
||||
|
||||
blockquote { margin-left: var(--size-half-line); }
|
||||
|
||||
/* Links and anchors. Note anchors need to be refined a bit further down
|
||||
in certain cases. */
|
||||
|
||||
a { text-decoration:none; color: var(--color-link); }
|
||||
a:hover { box-shadow:0 1px 0 0 var(--color-link); }
|
||||
a.anchor:before { content: "#" }
|
||||
a.anchor:hover { box-shadow: none; text-decoration: underline; }
|
||||
*:hover > a.anchor { visibility: visible }
|
||||
a.anchor
|
||||
{ visibility: hidden; position: absolute;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
margin-left: -2.5ch;
|
||||
padding-right: 1ch; padding-left: 1ch; /* To remain selectable */
|
||||
color: var(--color-link);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
*:target /* Linked highlight */
|
||||
{ background-color: var(--color-bg-highlight);
|
||||
box-shadow: 0 0 0 3px var(--color-bg-highlight) }
|
||||
|
||||
/* Code and code highlighting */
|
||||
|
||||
.c003, .c004, .c005, .c006, .c015,
|
||||
code, pre
|
||||
{ font-family: var(--font-mono), monospace;
|
||||
font-weight: 400;
|
||||
font-size: calc(1em * var(--size-font-mono-ratio));
|
||||
color: var(--color-code-fg); }
|
||||
|
||||
.c004, .c002 { color: var(--color-code-type-id); }
|
||||
.c005 { font-style: oblique }
|
||||
.c006 { font-weight: 700 }
|
||||
.c015 { text-align: left }
|
||||
|
||||
pre .c003, pre .c004, pre .c005, pre .c006,
|
||||
pre code { font-size: inherit } /* don't apply transform twice... */
|
||||
a code { color: inherit }
|
||||
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { text-transform: none; }
|
||||
|
||||
pre { background: var(--color-code-block-bg);
|
||||
padding-left: 0.8ch; padding-right: 0.8ch;
|
||||
margin-left: -0.8ch; margin-right: -0.8ch;
|
||||
padding-top: 1ch; padding-bottom: 1ch;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word; }
|
||||
|
||||
/* Table of contents, like in odoc.css except we don't have a class */
|
||||
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2)
|
||||
{ font-size: var(--size-font-small); }
|
||||
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2) a
|
||||
{ color : var(--color-fg); }
|
||||
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2) a:hover
|
||||
{ color : var(--color-link); }
|
||||
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2)
|
||||
{ font-family: var(--font-headings); text-transform: uppercase;
|
||||
list-style-type: none; padding-top: var(--size-line) }
|
||||
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2) li
|
||||
{ margin-left: 0; padding-left: 3.25ch; text-indent: -3.25ch; }
|
||||
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2) ul
|
||||
{ font-family: var(--font-body);
|
||||
text-transform: none;
|
||||
margin-top:0; }
|
||||
|
||||
/* toplevel examples */
|
||||
|
||||
div.caml-example.toplevel div.caml-input::before { content: "#" }
|
||||
div.caml-input, div.caml-output { margin-top: 0; }
|
||||
|
||||
.caml-input {}
|
||||
.caml-output { color: var(--color-code-string) /* why not */ }
|
||||
|
||||
/* Other HeVeA classes */
|
||||
|
||||
.c000 { border-spacing: 2ch; border-collapse: separate; margin: 0 auto; }
|
||||
.c001 { border-spacing: 1ch; border-collapse: separate }
|
||||
.c008 { font-size: var(--size-font-small) }
|
||||
.c009 { font-style:italic }
|
||||
.c010 { font-style:italic; color:var(--color-link) }
|
||||
.c011 { font-style:italic; font-weight:700 }
|
||||
.c012 { font-style:italic }
|
||||
.c013 { font-style:italic }
|
||||
.c018 { text-align: right }
|
||||
.c019 { text-align: left}
|
||||
.dcenter { margin: 0 auto; }
|
||||
.description { margin-left: var(--size-line) }
|
||||
.dd-description br { display: none }
|
||||
dd + dt { margin-top: var(--size-half-line) }
|
||||
|
||||
dt .c003 { font-style:normal; font-weight:700 } /* options */
|
||||
|
||||
.indexenv { list-style-type: none }
|
||||
.indexenv li { margin-left: 0 }
|
||||
|
||||
/* Page specific */
|
||||
|
||||
/* Cover page */
|
||||
|
||||
div.maintitle > span > span
|
||||
{ text-transform: uppercase;
|
||||
font-family: var(--font-headings);
|
||||
line-height: var(--size-line-ratio);
|
||||
font-size: calc(2.25 * var(--size-font)) !important;
|
||||
margin-left: -0.25ch; /* compensate nbsp */ }
|
||||
|
||||
div.maintitle > span > span > br { display: none }
|
||||
div.maintitle > span > span > span
|
||||
{ display: block;
|
||||
text-transform: none;
|
||||
font-style: italic;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--size-font-big) !important; }
|
||||
|
||||
div.maintitle > span > span > span > span /* ugh */
|
||||
{ font-style: normal;
|
||||
line-height: var(--size-line);
|
||||
font-size: var(--size-font) !important; }
|
||||
|
||||
div.maintitle > span > span > span > span > span /* ugh bis */
|
||||
{ font-size: var(--size-font-small) !important;
|
||||
font-style: italic;
|
||||
margin-left: -1.25ch; }
|
||||
|
||||
div.maintitle + blockquote hr { display : none }
|
||||
div.maintitle + blockquote
|
||||
{ margin: 0;
|
||||
/* margin-top: calc(-1 * var(--size-line)); chrome but not FF, bah... */
|
||||
font-size: var(--size-font-small);
|
||||
border-bottom: solid thin var(--color-rule);
|
||||
padding-bottom: var(--size-half-line); }
|
||||
|
||||
div.maintitle ~ blockquote:last-of-type { display: none } /* remove branding */
|
||||
|
||||
div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2) /* undo side toc */
|
||||
{ position: static;
|
||||
padding: 0;
|
||||
margin: 0; margin-top: var(--size-line);
|
||||
width: 100%; }
|
||||
|
||||
div.maintitle ~ br { display: none }
|
||||
div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2) > li { margin: 0; }
|
||||
div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2) a
|
||||
{ color: var(--color-link) }
|
||||
|
||||
div.maintitle ~ table { margin-top: 0 }
|
||||
div.maintitle ~ ul:first-of-type:not(.itemize):not(.ftoc2)
|
||||
{ list-style-type: none;
|
||||
font-family: inherit; text-transform: inherit;
|
||||
font-size: inherit;
|
||||
margin-top: var(--size-half-line);
|
||||
border: none; }
|
||||
|
||||
div.maintitle ~ ul { list-style-type: none }
|
||||
div.maintitle ~ ul li { margin-left: 0 }
|
||||
|
||||
/* Contents page */
|
||||
|
||||
h1#sec1 + ul:first-of-type /* undo side toc */
|
||||
{ position: static;
|
||||
list-style-type: none;
|
||||
margin: 0; margin-top: var(--size-half-line);
|
||||
width: 100%; border: none; padding: 0;
|
||||
font-size: var(--size-font-big); }
|
||||
|
||||
h1#sec1 + ul:first-of-type li
|
||||
{ margin-left: 0; padding-left: 0; text-indent: 0 }
|
||||
|
||||
h1#sec1 ~ ul ul
|
||||
{ list-style-type: none; font-size: var(--size-font-large); font-style: italic;}
|
||||
|
||||
h1#sec1 ~ ul ul ul
|
||||
{ font-size: var(--size-font); font-style: normal;
|
||||
margin-top: var(--size-half-line); }
|
||||
|
||||
h1#sec1 ~ ul ul ul ul { margin-left: 2.5ch; margin-top: 0;}
|
||||
h1#sec1 ~ ul > li { margin-top: var(--size-line); }
|
||||
h1#sec1 ~ ul > li > ul > li { margin-top: var(--size-half-line); }
|
||||
|
||||
/* Media adjustments */
|
||||
|
||||
@media only screen and (min-width:160ch) /* and (min-height: 60rem) */
|
||||
{
|
||||
:root { --size-font: 1.125rem; } /* consider using vmin units */
|
||||
}
|
||||
|
||||
@media only screen and (max-width:80ch)
|
||||
{
|
||||
body { padding: var(--size-line); }
|
||||
body > * { width: 100%; }
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2)
|
||||
{ position: static;
|
||||
margin: 0; margin-top: var(--size-line);
|
||||
width: 100%; }
|
||||
pre { font-size: var(--size-font-tiny); }
|
||||
}
|
||||
|
||||
@media print
|
||||
{
|
||||
* { -webkit-print-color-adjust: exact; }
|
||||
.content nav:first-child { visibility: hidden }
|
||||
body > * { width: 100%; }
|
||||
body > ul:first-of-type:not(.itemize):not(.ftoc2)
|
||||
{ position: static; width: 100%;
|
||||
margin: 0; margin-top: var(--size-line); }
|
||||
|
||||
/* odig.light with slight adjustements */
|
||||
:root
|
||||
{ --color-bg: white;
|
||||
--color-bg-highlight: #CAD7EF;
|
||||
--color-fg: black;
|
||||
--color-rule: #DADBDB;
|
||||
|
||||
--color-code-block-bg: #E8E8E8;
|
||||
--color-code-fg: #16191D;
|
||||
--color-code-comment: #747679;
|
||||
--color-code-keyword: #874aa9;
|
||||
--color-code-type-id: #a9874a;
|
||||
--color-code-string: #4aa987;
|
||||
|
||||
--color-link: #557dcc;
|
||||
--color-broken-link: #f71414; }
|
||||
}
|
||||
|
||||
/*
|
||||
Copyright (c) 2019 The odig programmers
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
334
_odoc-theme/odoc.css
Normal file
334
_odoc-theme/odoc.css
Normal file
|
|
@ -0,0 +1,334 @@
|
|||
@charset "UTF-8";
|
||||
@import url("fonts/fonts.css");
|
||||
@import url("theme.css");
|
||||
|
||||
/* Copyright (c) 2019 The odig programmers. All rights reserved.
|
||||
Distributed under the ISC license, see terms at the end of the file. */
|
||||
|
||||
/* Reset a few things. */
|
||||
|
||||
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,
|
||||
a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,select,
|
||||
small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,
|
||||
fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,
|
||||
article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,
|
||||
menu,nav,output,ruby,section,summary,time,mark,audio,video,button,input
|
||||
{ margin: 0; padding: 0; border: 0; /* outline: 0; */
|
||||
font-size: inherit; font: inherit; font-weight: inherit;
|
||||
line-height: inherit; vertical-align: baseline;
|
||||
text-align: inherit; color: inherit; background: transparent; }
|
||||
|
||||
table { border-collapse: collapse; border-spacing: 0; }
|
||||
*, *:before, *:after { box-sizing: border-box; }
|
||||
|
||||
/* Basic geometry */
|
||||
|
||||
:root { --font-headings: "PT-Sans-Caption";
|
||||
--font-body: "PT-Sans";
|
||||
--font-mono: "DejaVu-SansMono";
|
||||
--size-font: 0.96875rem;
|
||||
--size-font-micro: calc(0.675 * var(--size-font));
|
||||
--size-font-tiny-ratio: 0.75;
|
||||
--size-font-tiny: calc(var(--size-font-tiny-ratio) * var(--size-font));
|
||||
--size-font-small: calc(0.875 * var(--size-font));
|
||||
--size-font-large: calc(1.25 * var(--size-font));
|
||||
--size-font-big: calc(1.5 * var(--size-font));
|
||||
--size-font-huge: calc(1.75 * var(--size-font));
|
||||
--size-font-mono-ratio: 0.87097;
|
||||
--size-font-mono-ratio: 0.865;
|
||||
--size-line-ratio: 1.5;
|
||||
--size-line: calc(var(--size-line-ratio) * var(--size-font));
|
||||
--size-half-line: calc(0.5 * var(--size-line));
|
||||
--size-fourth-line: calc(0.25 * var(--size-line)); }
|
||||
|
||||
.odoc { background-color: var(--color-bg);
|
||||
color: var(--color-fg);
|
||||
font-size: var(--size-font);
|
||||
font-family: var(--font-body), sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: var(--size-line);
|
||||
text-align: left;
|
||||
display: grid;
|
||||
margin: 0 auto;
|
||||
max-width: 130ch;
|
||||
grid-template-columns: minmax(50ch,76ch) minmax(23ch,1fr);
|
||||
grid-column-gap: calc(2 * var(--size-line));
|
||||
grid-template-areas: "nav nav"
|
||||
"header toc"
|
||||
"content toc";
|
||||
padding: calc(1.5 * var(--size-line));
|
||||
padding-top: calc(0.5 * var(--size-line)); }
|
||||
|
||||
.odoc-nav { grid-area: nav; }
|
||||
.odoc-preamble { grid-area: header; }
|
||||
.odoc-content { grid-area: content; margin: 0 }
|
||||
.odoc-toc
|
||||
{ grid-area: toc;
|
||||
margin-top: var(--size-line);
|
||||
border-top: solid thin var(--color-rule); }
|
||||
|
||||
/* Media adjustments */
|
||||
|
||||
@media only screen and (min-width:160ch) /* and (min-height: 60rem) */
|
||||
{
|
||||
:root { --size-font: 1.125rem; } /* consider using vmin units */
|
||||
}
|
||||
|
||||
@media only screen and (max-width:80ch) /* Basically mobile */
|
||||
{
|
||||
.odoc
|
||||
{ padding: var(--size-line);
|
||||
grid-template-columns: auto;
|
||||
grid-template-rows: none;
|
||||
grid-template-areas: "nav"
|
||||
"header"
|
||||
"toc"
|
||||
"content"; }
|
||||
.odoc-toc { margin: 0; margin-top: var(--size-line); }
|
||||
pre { font-size: var(--size-font-tiny); }
|
||||
}
|
||||
|
||||
@media print
|
||||
{
|
||||
* { -webkit-print-color-adjust: exact; }
|
||||
.odoc-nav { visibility: hidden }
|
||||
.odoc-toc { margin: 0; margin-top: var(--size-line); }
|
||||
|
||||
/* odig.light with slight adjustements */
|
||||
:root
|
||||
{ --color-bg: white;
|
||||
--color-bg-highlight: #CAD7EF;
|
||||
--color-fg: black;
|
||||
--color-rule: #DADBDB;
|
||||
|
||||
--color-code-block-bg: #E8E8E8;
|
||||
--color-code-fg: #16191D;
|
||||
--color-code-comment: #747679;
|
||||
--color-code-keyword: #874aa9;
|
||||
--color-code-type-id: #a9874a;
|
||||
--color-code-string: #4aa987;
|
||||
|
||||
--color-link: #557dcc;
|
||||
--color-broken-link: #f71414; }
|
||||
}
|
||||
|
||||
/* Block level markup */
|
||||
|
||||
header > * + *, div > * + *, details > * + *
|
||||
{ margin-top: var(--size-half-line); }
|
||||
|
||||
ul + * , ol + * { margin-top: 0; }
|
||||
ul, ol { margin-top: var(--size-fourth-line);
|
||||
margin-bottom: var(--size-fourth-line);
|
||||
list-style-position: outside; }
|
||||
|
||||
li *:first-child, li ol, li ul { margin-top: 0; }
|
||||
|
||||
ul { list-style-type: square; }
|
||||
ul > li { margin-left: 2.25ch; }
|
||||
ol > li { margin-left: 2ch; }
|
||||
ol li::marker
|
||||
{ font-family: var(--font-headings), sans-serif;
|
||||
font-size: var(--size-font-small); }
|
||||
|
||||
img
|
||||
{ display: block;
|
||||
margin-top: var(--size-half-line);
|
||||
margin-bottom: var(--size-half-line); }
|
||||
|
||||
/* Headings and horizontal rulers */
|
||||
|
||||
h1, h2, .odoc-content > *:first-child
|
||||
{ border-top: solid thin var(--color-rule);
|
||||
padding-top: calc(0.75 * var(--size-line));
|
||||
margin-top: var(--size-line); }
|
||||
|
||||
h1, h2, h3, h4, h5, h6
|
||||
{ font-family: var(--font-headings), sans-serif;
|
||||
font-weight: 400;
|
||||
text-transform: uppercase;
|
||||
margin-top: var(--size-line); }
|
||||
|
||||
h1, h2 { line-height: calc(1.5 * var(--size-line)); }
|
||||
h1 { font-size: var(--size-font-huge); }
|
||||
h2 { font-size: var(--size-font-big); }
|
||||
h3 { font-size: var(--size-font-large); }
|
||||
|
||||
/* Phrasing content */
|
||||
|
||||
em { font-style: italic }
|
||||
b, strong { font-weight: 700 }
|
||||
small { font-size: var(--size-font-small); }
|
||||
|
||||
sup { vertical-align: super; }
|
||||
sub { vertical-align: sub; }
|
||||
sup, sub
|
||||
{ font-size : calc(1em * var(--size-font-tiny-ratio));
|
||||
line-height: 0; margin-left: 0.2ex; }
|
||||
|
||||
/* Code and code highlighting */
|
||||
|
||||
code, pre
|
||||
{ font-family: var(--font-mono), monospace;
|
||||
font-weight: 400;
|
||||
font-size: calc(1em * var(--size-font-mono-ratio));
|
||||
color: var(--color-code-fg);
|
||||
overflow-wrap: anywhere; }
|
||||
|
||||
code span span { white-space: nowrap } /* Do not break these units */
|
||||
|
||||
pre code { font-size: inherit } /* don't apply transform twice... */
|
||||
a code { color: inherit }
|
||||
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { text-transform: none; }
|
||||
|
||||
pre
|
||||
{ background: var(--color-code-block-bg);
|
||||
padding-left: 0.8ch; padding-right: 0.8ch;
|
||||
margin-left: -0.8ch; margin-right: -0.8ch;
|
||||
padding-top: 1ch; padding-bottom: 1ch;
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: break-word; }
|
||||
|
||||
.arrow { white-space: nowrap }
|
||||
.keyword , .hljs-keyword { color : var(--color-code-keyword); }
|
||||
.hljs-type { color : var(--color-code-type-id); }
|
||||
.hljs-string { color : var(--color-code-string); }
|
||||
.hljs-comment { color : var(--color-code-comment); font-style: italic; }
|
||||
|
||||
/* Links and anchors. Note anchors need to be refined a bit further down
|
||||
in certain cases. */
|
||||
|
||||
a { text-decoration:none; color: var(--color-link); }
|
||||
a:hover { box-shadow:0 1px 0 0 var(--color-link); }
|
||||
a.anchor:before { content: "#" }
|
||||
a.anchor:hover { box-shadow: none; text-decoration: underline; }
|
||||
*:hover > a.anchor { visibility: visible }
|
||||
a.anchor
|
||||
{ visibility: hidden; position: absolute;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
margin-left: -2.5ch;
|
||||
padding-right: 1ch; padding-left: 1ch; /* To remain selectable */
|
||||
color: var(--color-link);
|
||||
text-align: right; }
|
||||
|
||||
*:target /* Linked highlight */
|
||||
{ background-color: var(--color-bg-highlight);
|
||||
box-shadow: 0 0 0 3px var(--color-bg-highlight) }
|
||||
|
||||
.xref-unresolved { box-shadow:0 1px 0 0 var(--color-broken-link)}
|
||||
|
||||
/* Table of contents */
|
||||
|
||||
.odoc-toc { font-size: var(--size-font-small); }
|
||||
.odoc-toc a { color : var(--color-fg); }
|
||||
.odoc-toc a:hover { color : var(--color-link) }
|
||||
.odoc-toc ul
|
||||
{ font-family: var(--font-headings); text-transform: uppercase;
|
||||
margin-top: var(--size-line);
|
||||
list-style-type: none; }
|
||||
|
||||
.odoc-toc ul ul
|
||||
{ font-family: var(--font-body); text-transform: none; margin-top:0; }
|
||||
|
||||
.odoc-toc ul ul ul { margin-left:1.5ch }
|
||||
.odoc-toc li { margin-left: 0; padding-left: 1ch; text-indent: -1ch; }
|
||||
.odoc-toc > ul > li { margin-top: calc(0.25 * var(--size-half-line)) }
|
||||
.odoc-toc > ul > li > ul > li:last-child
|
||||
{ margin-bottom: var(--size-half-line) }
|
||||
|
||||
.odoc-toc ul ul li { margin-left: 0; padding-left: 0; }
|
||||
|
||||
/* Module structure items */
|
||||
|
||||
.odoc-spec { padding-bottom: var(--size-fourth-line); }
|
||||
.spec { margin-top: 0; }
|
||||
.spec-doc { margin-top:0; padding-left: 1ch; }
|
||||
.spec-doc > *:first-child { margin-top: 0 }
|
||||
|
||||
/* Indent on wrap */
|
||||
.spec, .spec td:first-child { padding-left: 4ch; text-indent: -4ch }
|
||||
.spec td.field { padding-left: 6ch }
|
||||
|
||||
.spec .def-doc .comment-delim + * { margin-top: 0 }
|
||||
.spec .def-doc .comment-delim /* make them invisible yet copy-pastable */
|
||||
{ position: absolute; width: 1px; height: 1px; overflow: hidden; }
|
||||
|
||||
/* But we don't do it for types for now because of variants and
|
||||
records. This makes :target highlight be off. And poses
|
||||
other problems (e.g. need to indent back the last ] or }.
|
||||
A better markup strategy should be found here. */
|
||||
.spec.type { padding-left: 0; text-indent: 0 }
|
||||
.spec.type > a.anchor
|
||||
{ padding-left: 1ch; padding-right: 1ch; /* values from a.anchor */ }
|
||||
.spec li > a.anchor, .spec > a.anchor
|
||||
{ padding-right: 0.5ch; padding-left: 2ch; }
|
||||
|
||||
.spec ol { margin:0; list-style-type: none; }
|
||||
.spec li { margin-left: 0; padding-left: 4ch; text-indent: -4ch }
|
||||
.spec li.record.field { margin-left: 2ch }
|
||||
|
||||
.spec .def-doc { display: inline-block }
|
||||
.spec .def-doc { padding-left: /* 4 + 3 */ 7ch; }
|
||||
.spec .def-doc p { margin-left: -4ch; text-indent: 0 }
|
||||
|
||||
.odoc-include summary { cursor: pointer }
|
||||
|
||||
/* Package, module and @tag lists
|
||||
|
||||
Allowing indent on wrap with the anchor makes all this quite convoluted.
|
||||
Is there a better way ? */
|
||||
|
||||
.packages, .modules, .at-tags { list-style-type: none; margin-left: -2ch; }
|
||||
.packages li, .modules li, .at-tags li { padding-left: 2ch; text-indent: -2ch; }
|
||||
.modules li a.anchor, .packages li a.anchor
|
||||
{ padding-right: 0.5ch; padding-left: 2ch; }
|
||||
|
||||
.synopsis { padding-left: 1ch; }
|
||||
.version { font-size: var(--size-font-micro); }
|
||||
.at-tag { text-transform : capitalize }
|
||||
|
||||
/* Package page */
|
||||
|
||||
h1 .version, h1 nav { font-size: var(--size-font); line-height:0 }
|
||||
h1 nav
|
||||
{ display: inline-block;
|
||||
font-family: var(--font-body);
|
||||
text-transform: capitalize; }
|
||||
|
||||
.package.info td:first-child { padding-right: 2ch; min-width: 13ch}
|
||||
.package.info ul { list-style-type: none; display: inline; margin:0; padding:0}
|
||||
.package.info li { display: inline-block; margin:0; margin-right:1ex; }
|
||||
#info-authors li, #info-maintainers li { display: block; }
|
||||
|
||||
/* Package index page */
|
||||
|
||||
.by-name nav a
|
||||
{ font-family: var(--font-headings);
|
||||
font-size: var(--size-font-large);
|
||||
text-transform: uppercase;
|
||||
margin-right: 1ch;
|
||||
display: inline-block; }
|
||||
|
||||
.by-tag ol { list-style-type: none; }
|
||||
.by-tag ol.tags li { margin-left: 1ch; display: inline-block }
|
||||
.by-tag td:first-child
|
||||
{ font-family: var(--font-headings);
|
||||
font-size: var(--size-font-large);
|
||||
text-transform: uppercase; }
|
||||
|
||||
/*
|
||||
Copyright (c) 2019 The odig programmers
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
34
_odoc-theme/theme.css
Normal file
34
_odoc-theme/theme.css
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
:root
|
||||
{ --color-bg: #F6F6F6;
|
||||
--color-bg-highlight: #CAD7EF;
|
||||
--color-fg: #1F2227;
|
||||
--color-rule: #DADBDB;
|
||||
|
||||
--color-code-block-bg: #E8E8E8;
|
||||
--color-code-fg: #16191D;
|
||||
--color-code-comment: #747679;
|
||||
--color-code-keyword: #874aa9;
|
||||
--color-code-type-id: #a9874a;
|
||||
--color-code-string: #4aa987;
|
||||
|
||||
--color-link: #557dcc;
|
||||
--color-broken-link: #f71414; }
|
||||
|
||||
@media (prefers-color-scheme: dark)
|
||||
{
|
||||
:root
|
||||
{ --color-bg: #181B20;
|
||||
--color-bg-highlight: #303644;
|
||||
--color-fg: #8C8D90;
|
||||
--color-rule: #2F3236;
|
||||
|
||||
--color-code-block-bg: #24272A;
|
||||
--color-code-fg: #A3A4A6;
|
||||
--color-code-comment: #747679;
|
||||
--color-code-keyword: #7F668D;
|
||||
--color-code-type-id: #8D7F66;
|
||||
--color-code-string: #668d7f;
|
||||
|
||||
--color-link: #7788AA;
|
||||
--color-broken-link: #900505; }
|
||||
}
|
||||
31
cmdliner/Cmdliner/Arg/index.html
Normal file
31
cmdliner/Cmdliner/Arg/index.html
Normal file
File diff suppressed because one or more lines are too long
2
cmdliner/Cmdliner/Cmd/Env/index.html
Normal file
2
cmdliner/Cmdliner/Cmd/Env/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Env (cmdliner.Cmdliner.Cmd.Env)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../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">cmdliner</a> » <a href="../../index.html">Cmdliner</a> » <a href="../index.html">Cmd</a> » Env</nav><header class="odoc-preamble"><h1>Module <code><span>Cmd.Env</span></code></h1><p>Environment variable and their information.</p></header><nav class="odoc-toc"><ul><li><a href="#envvars">Environment variables</a></li><li><a href="#info">Environment variable information</a></li></ul></nav><div class="odoc-content"><h2 id="envvars"><a href="#envvars" class="anchor"></a>Environment variables</h2><div class="odoc-spec"><div class="spec type anchored" id="type-var"><a href="#type-var" class="anchor"></a><code><span><span class="keyword">type</span> var</span><span> = string</span></code></div><div class="spec-doc"><p>The type for environment names.</p></div></div><h2 id="info"><a href="#info" class="anchor"></a>Environment variable information</h2><div class="odoc-spec"><div class="spec type anchored" id="type-info"><a href="#type-info" class="anchor"></a><code><span><span class="keyword">type</span> info</span><span> = <a href="../../Term/index.html#type-env_info">Term.env_info</a></span></code></div><div class="spec-doc"><p>The type for environment variable information.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-info"><a href="#val-info" class="anchor"></a><code><span><span class="keyword">val</span> info : <span><span class="optlabel">?deprecated</span>:string <span class="arrow">-></span></span> <span><span class="optlabel">?docs</span>:string <span class="arrow">-></span></span> <span><span class="optlabel">?doc</span>:string <span class="arrow">-></span></span> <span><a href="#type-var">var</a> <span class="arrow">-></span></span> <a href="#type-info">info</a></span></code></div><div class="spec-doc"><p><code>info ~docs ~doc var</code> describes an environment variable <code>var</code> such that:</p><ul><li><code>doc</code> is the man page information of the environment variable, defaults to <code>"undocumented"</code>.</li><li><code>docs</code> is the title of the man page section in which the environment variable will be listed, it defaults to <a href="../../Manpage/index.html#val-s_environment"><code>Cmdliner.Manpage.s_environment</code></a>.</li><li><code>deprecated</code>, if specified the environment is deprecated and the string is a message output on standard error when the environment variable gets used to lookup the default value of an argument.</li></ul><p>In <code>doc</code> the <a href="../../../tool_man.html#doclang" title="doclang">documentation markup language</a> can be used with following variables:</p><ul><li><code>$(env)</code>, the value of <code>var</code>.</li><li>The variables mentioned in <a href="#val-info"><code>info</code></a>.</li></ul></div></div></div></body></html>
|
||||
2
cmdliner/Cmdliner/Cmd/Exit/index.html
Normal file
2
cmdliner/Cmdliner/Cmd/Exit/index.html
Normal file
File diff suppressed because one or more lines are too long
57
cmdliner/Cmdliner/Cmd/index.html
Normal file
57
cmdliner/Cmdliner/Cmd/index.html
Normal file
File diff suppressed because one or more lines are too long
8
cmdliner/Cmdliner/Manpage/index.html
Normal file
8
cmdliner/Cmdliner/Manpage/index.html
Normal file
File diff suppressed because one or more lines are too long
32
cmdliner/Cmdliner/Term/index.html
Normal file
32
cmdliner/Cmdliner/Term/index.html
Normal file
File diff suppressed because one or more lines are too long
2
cmdliner/Cmdliner/index.html
Normal file
2
cmdliner/Cmdliner/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Cmdliner (cmdliner.Cmdliner)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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">cmdliner</a> » Cmdliner</nav><header class="odoc-preamble"><h1>Module <code><span>Cmdliner</span></code></h1><p>Declarative definition of command line interfaces.</p><p>Consult the <a href="../tutorial.html" title="tutorial">tutorial</a>, details about the supported <a href="../cli.html" title="cli">command line syntax</a> and <a href="../examples.html" title="examples">examples</a> of use.</p><p>Open the module to use it, it defines only three modules in your scope.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Manpage"><a href="#module-Manpage" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Manpage/index.html">Manpage</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Man page specification.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Term"><a href="#module-Term" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Term/index.html">Term</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Terms.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Cmd"><a href="#module-Cmd" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Cmd/index.html">Cmd</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Commands.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Arg"><a href="#module-Arg" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Arg/index.html">Arg</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Terms for command line arguments.</p></div></div></div></body></html>
|
||||
421
cmdliner/_doc-dir/CHANGES.md
Executable file
421
cmdliner/_doc-dir/CHANGES.md
Executable file
|
|
@ -0,0 +1,421 @@
|
|||
v1.2.0 2023-04-10 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- In manpage specification the new variable `$(iname)` substitutes the
|
||||
command invocation (from program name to subcommand) in bold (#168).
|
||||
This variable is now used in the default introduction of the `EXIT STATUS`
|
||||
section. Thanks to Ali Caglayan for suggesting.
|
||||
- Fix manpage rendering when `PAGER=less` is set (#167).
|
||||
- Plain text manpage rendering: fix broken handling of `` `Noblank ``.
|
||||
Thanks to Michael Richards and Reynir Björnsson for the report (#176).
|
||||
- Fix install to directory with spaces (#172). Thanks to
|
||||
@ZSFactory for reporting and suggesting the fix.
|
||||
- Fix manpage paging on Windows (#166). Thanks to Nicolás Ojeda Bär
|
||||
for the report and the solution.
|
||||
|
||||
v1.1.1 2022-03-23 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- General documentation fixes, tweaks and improvements.
|
||||
- Docgen: suppress trailing whitespace in synopsis rendering.
|
||||
- Docgen: fix duplicate rendering of standard options when using `Term.ret` (#135).
|
||||
- Docgen: fix duplicate rendering of command name on ``Term.ret (`Help (fmt, None)``
|
||||
(#135).
|
||||
|
||||
v1.1.0 2022-02-06 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- Require OCaml 4.08.
|
||||
|
||||
- Support for deprecating commands, arguments and environment variables (#66).
|
||||
See the `?deprecated` argument of `Cmd.info`, `Cmd.Env.info` and `Arg.info`.
|
||||
|
||||
- Add `Manpage.s_none` a special section name to use whenever you
|
||||
want something not to be listed in a command's manpage.
|
||||
|
||||
- Add `Arg.conv'` like `Arg.conv` but with a parser signature that returns
|
||||
untagged string errors.
|
||||
|
||||
- Add `Term.{term,cli_parse}_result'` functions.
|
||||
|
||||
- Add deprecation alerts on what is already deprecated.
|
||||
|
||||
- On unices, use `command -v` rather than `type` to find commands.
|
||||
|
||||
- Stop using backticks for left quotes. Use apostrophes everywhere.
|
||||
Thanks to Ryan Moore for reporting a typo that prompted the change (#128).
|
||||
|
||||
- Rework documentation structure. Move out tutorial, examples and
|
||||
reference doc from the `.mli` to multiple `.mld` pages.
|
||||
|
||||
- `Arg.doc_alts` and `Arg.doc_alts_enum`, change the default rendering
|
||||
to match the manpage convention which is to render these tokens in
|
||||
bold. If you want to recover the previous rendering or were using
|
||||
these functions outside man page rendering use an explicit
|
||||
`~quoted:true` (the optional argument is available on earlier
|
||||
versions).
|
||||
|
||||
- The deprecated `Term.exit` and `Term.exit_status_of_result` now
|
||||
require a `unit` result. This avoids various errors to go undetected.
|
||||
Thanks to Thomas Leonard for the patch (#124).
|
||||
|
||||
- Fix absent and default option values (`?none` string argument of `Arg.some`)
|
||||
rendering in manpages:
|
||||
|
||||
1. They were not escaped, they now are.
|
||||
2. They where not rendered in bold, they now are.
|
||||
3. The documentation language was interpreted, it is no longer the case.
|
||||
|
||||
If you were relying on the third point via `?none` of `Arg.some`, use the new
|
||||
`?absent` optional argument of `Arg.info` instead. Besides a new
|
||||
`Arg.some'` function is added to specify a value for `?none` instead
|
||||
of a string. Thanks to David Allsopp for the patch (#111).
|
||||
|
||||
- Documentation generation use: `…` (U+2026) instead of `...` for
|
||||
ellipsis. See also UTF-8 manpage support below.
|
||||
|
||||
- Documentation generation, improve command synopsis rendering on
|
||||
commands with few options (i.e. mention them).
|
||||
|
||||
- Documentation generation, drop section heading in the output if the section
|
||||
is empty.
|
||||
|
||||
### New `Cmd` module and deprecation of the `Term` evaluation interface
|
||||
|
||||
This version of cmdliner deprecates the `Term.eval*` evaluation
|
||||
functions and `Term.info` information values in favor of the new
|
||||
`Cmdliner.Cmd` module.
|
||||
|
||||
The `Cmd` module generalizes the existing sub command support to allow
|
||||
arbitrarily nested sub commands each with its own man page and command
|
||||
line syntax represented by a `Term.t` value.
|
||||
|
||||
The mapping between the old interface and the new one should be rather
|
||||
straightforward. In particular `Term.info` and `Cmd.info` have exactly
|
||||
the same semantics and fields and a command value simply pairs a
|
||||
command information with a term.
|
||||
|
||||
However in this transition the following things are changed or added:
|
||||
|
||||
* All default values of `Cmd.info` match those of `Term.info` except
|
||||
for:
|
||||
* The `?exits` argument which defaults to `Cmd.Exit.defaults`
|
||||
rather than the empty list.
|
||||
* The `?man_xrefs` which defaults to the list ``[`Main]`` rather
|
||||
than the empty list (this means that by default sub commands
|
||||
at any level automatically cross-reference the main command).
|
||||
* The `?sdocs` argument which defaults to `Manpage.s_common_options`
|
||||
rather than `Manpage.s_options`.
|
||||
|
||||
* The `Cmd.Exit.some_error` code is added to `Cmd.Exit.defaults`
|
||||
(which in turn is the default for `Cmd.info` see above). This is an
|
||||
error code clients can use when they don't want to bother about
|
||||
having precise exit codes. It is high so that low, meaningful,
|
||||
codes can later be added without breaking a tool's compatibility. In
|
||||
particular the convenience evaluation functions `Cmd.eval_result*`
|
||||
use this code when they evaluate to an error.
|
||||
|
||||
* If you relied on `?term_err` defaulting to `1` in the various
|
||||
`Term.exit*` function, note that the new `Cmd.eval*` function use
|
||||
`Exit.cli_error` as a default. You may want to explicitly specify
|
||||
`1` instead if you use `Term.ret` with the `` `Error`` case
|
||||
or `Term.term_result`.
|
||||
|
||||
Finally be aware that if you replace, in an existing tool, an encoding
|
||||
of sub commands as positional arguments you will effectively break the
|
||||
command line compatibility of your tool since options can no longer be
|
||||
specified before the sub commands, i.e. your tool synopsis moves from:
|
||||
|
||||
```
|
||||
tool cmd [OPTION]… SUBCMD [ARG]…
|
||||
```
|
||||
to
|
||||
```
|
||||
tool cmd SUBCMD [OPTION]… [ARG]…
|
||||
```
|
||||
|
||||
Thanks to Rudi Grinberg for prototyping the feature in #123.
|
||||
|
||||
### UTF-8 manpage support
|
||||
|
||||
It is now possible to write UTF-8 encoded text in your doc strings and
|
||||
man pages.
|
||||
|
||||
The man page renderer used on `--help` defaults to `mandoc` if
|
||||
available, then uses `groff` and then defaults to `nroff`. Starting
|
||||
with `mandoc` catches macOS whose `groff` as of 11.6 still doesn't
|
||||
support UTF-8 input and struggles to render some Unicode characters.
|
||||
|
||||
The invocations were also tweaked to remove the `-P-c` option which
|
||||
entails that the default pager `less` is now invoked with the `-R` option.
|
||||
|
||||
If you install UTF-8 encoded man pages output via `--help=groff`, in
|
||||
`man` directories bear in mind that these pages will look garbled on
|
||||
stock macOS (at least until 11.6). One way to work around is to
|
||||
instruct your users to change the `NROFF` definition in
|
||||
`/private/etc/man.conf` from:
|
||||
|
||||
NROFF /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c
|
||||
|
||||
to:
|
||||
|
||||
NROFF /usr/bin/mandoc -Tutf8 -c
|
||||
|
||||
Thanks to Antonin Décimo for his knowledge and helping with these
|
||||
`man`gnificent intricacies (#27).
|
||||
|
||||
v1.0.4 2019-06-14 Zagreb
|
||||
------------------------
|
||||
|
||||
- Change the way `Error (_, e)` term evaluation results
|
||||
are formatted. Instead of treating `e` as text, treat
|
||||
it as formatted lines.
|
||||
- Fix 4.08 `Pervasives` deprecation.
|
||||
- Fix 4.03 String deprecations.
|
||||
- Fix bootstrap build in absence of dynlink.
|
||||
- Make the `Makefile` bootstrap build reproducible.
|
||||
Thanks to Thomas Leonard for the patch.
|
||||
|
||||
v1.0.3 2018-11-26 Zagreb
|
||||
------------------------
|
||||
|
||||
- Add `Term.with_used_args`. Thanks to Jeremie Dimino for
|
||||
the patch.
|
||||
- Use `Makefile` bootstrap build in opam file.
|
||||
- Drop ocamlbuild requirement for `Makefile` bootstrap build.
|
||||
- Drop support for ocaml < 4.03.0
|
||||
- Dune build support.
|
||||
|
||||
v1.0.2 2017-08-07 Zagreb
|
||||
------------------------
|
||||
|
||||
- Don't remove the `Makefile` from the distribution.
|
||||
|
||||
v1.0.1 2017-08-03 Zagreb
|
||||
------------------------
|
||||
|
||||
- Add a `Makefile` to build and install cmdliner without `topkg` and
|
||||
opam `.install` files. Helps bootstraping opam in OS package
|
||||
managers. Thanks to Hendrik Tews for the patches.
|
||||
|
||||
v1.0.0 2017-03-02 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
**IMPORTANT** The `Arg.converter` type is deprecated in favor of the
|
||||
`Arg.conv` type. For this release both types are equal but the next
|
||||
major release will drop the former and make the latter abstract. All
|
||||
users are kindly requested to migrate to use the new type and **only**
|
||||
via the new `Arg.[p]conv` and `Arg.conv_{parser,printer}` functions.
|
||||
|
||||
- Allow terms to be used more than once in terms without tripping out
|
||||
documentation generation (#77). Thanks to François Bobot and Gabriel
|
||||
Radanne.
|
||||
- Disallow defining the same option (resp. command) name twice via two
|
||||
different arguments (resp. terms). Raises Invalid_argument, used
|
||||
to be undefined behaviour (in practice, an arbitrary one would be
|
||||
ignored).
|
||||
- Improve converter API (see important message above).
|
||||
- Add `Term.exit[_status]` and `Term.exit_status_of[_status]_result`.
|
||||
improves composition with `Pervasives.exit`.
|
||||
- Add `Term.term_result` and `Term.cli_parse_result` improves composition
|
||||
with terms evaluating to `result` types.
|
||||
- Add `Arg.parser_of_kind_of_string`.
|
||||
- Change semantics of `Arg.pos_left` (see #76 for details).
|
||||
- Deprecate `Term.man_format` in favor of `Arg.man_format`.
|
||||
- Reserve the `--cmdliner` option for library use. This is unused for now
|
||||
but will be in the future.
|
||||
- Relicense from BSD3 to ISC.
|
||||
- Safe-string support.
|
||||
- Build depend on topkg.
|
||||
|
||||
### End-user visible changes
|
||||
|
||||
The following changes affect the end-user behaviour of all binaries using
|
||||
cmdliner.
|
||||
|
||||
- Required positional arguments. All missing required position
|
||||
arguments are now reported to the end-user, in the correct
|
||||
order (#39). Thanks to Dmitrii Kashin for the report.
|
||||
- Optional arguments. All unknown and ambiguous optional argument
|
||||
arguments are now reported to the end-user (instead of only
|
||||
the first one).
|
||||
- Change default behaviour of `--help[=FMT]` option. `FMT` no longer
|
||||
defaults to `pager` if unspecified. It defaults to the new value
|
||||
`auto` which prints the help as `pager` or `plain` whenever the
|
||||
`TERM` environment variable is `dumb` or undefined (#43). At the API
|
||||
level this changes the signature of the type `Term.ret` and values
|
||||
`Term.ret`, `Term.man_format` (deprecated) and `Manpage.print` to add the
|
||||
new `` `Auto`` case to manual formats. These are now represented by the
|
||||
`Manpage.format` type rather than inlined polyvars.
|
||||
|
||||
### Doc specification improvements and fixes
|
||||
|
||||
- Add `?envs` optional argument to `Term.info`. Documents environment
|
||||
variables that influence a term's evaluation and automatically
|
||||
integrate them in the manual.
|
||||
- Add `?exits` optional argument to `Term.info`. Documents exit statuses of
|
||||
the program. Use `Term.default_exits` if you are using the new `Term.exit`
|
||||
functions.
|
||||
- Add `?man_xrefs` optional argument to `Term.info`. Documents
|
||||
references to other manpages. Automatically formats a `SEE ALSO` section
|
||||
in the manual.
|
||||
- Add `Manpage.escape` to escape a string from the documentation markup
|
||||
language.
|
||||
- Add `Manpage.s_*` constants for standard man page section names.
|
||||
- Add a `` `Blocks`` case to `Manpage.blocks` to allow block splicing
|
||||
(#69). This avoids having to concatenate block lists at the
|
||||
toplevel of your program.
|
||||
- `Arg.env_var`, change default environment variable section to the
|
||||
standard `ENVIRONMENT` manual section rather than `ENVIRONMENT
|
||||
VARIABLES`. If you previously manually positioned that section in
|
||||
your man page you will have to change the name. See also next point.
|
||||
- Fix automatic placement of default environment variable section (#44)
|
||||
whenever unspecified in the man page.
|
||||
- Better automatic insertions of man page sections (#73). See the API
|
||||
docs about manual specification. As a side effect the `NAME` section
|
||||
can now also be overridden manually.
|
||||
- Fix repeated environment variable printing for flags (#64). Thanks to
|
||||
Thomas Gazagnaire for the report.
|
||||
- Fix rendering of env vars in man pages, bold is standard (#71).
|
||||
- Fix plain help formatting for commands with empty
|
||||
description. Thanks to Maciek Starzyk for the patch.
|
||||
- Fix (implement really) groff man page escaping (#48).
|
||||
- Request `an` macros directly in the man page via `.mso` this
|
||||
makes man pages self-describing and avoids having to call `groff` with
|
||||
the `-man` option.
|
||||
- Document required optional arguments as such (#82). Thanks to Isaac Hodes
|
||||
for the report.
|
||||
|
||||
### Doc language sanitization
|
||||
|
||||
This release tries to bring sanity to the doc language. This may break
|
||||
the rendering of some of your man pages. Thanks to Gabriel Scherer,
|
||||
Ivan Gotovchits and Nicolás Ojeda Bär for the feedback.
|
||||
|
||||
- It is only allowed to use the variables `$(var)` that are mentioned in
|
||||
the docs (`$(docv)`, `$(opt)`, etc.) and the markup directives
|
||||
`$({i,b},text)`. Any other unknown `$(var)` will generate errors
|
||||
on standard error during documentation generation.
|
||||
- Markup directives `$({i,b},text)` treat `text` as is, modulo escapes;
|
||||
see next point.
|
||||
- Characters `$`, `(`, `)` and `\` can respectively be escaped by `\$`,
|
||||
`\(`, `\)` and `\\`. Escaping `$` and `\` is mandatory everywhere.
|
||||
Escaping `)` is mandatory only in markup directives. Escaping `(`
|
||||
is only here for your symmetric pleasure. Any other sequence of
|
||||
character starting with a `\` is an illegal sequence.
|
||||
- Variables `$(mname)` and `$(tname)` are now marked up with bold when
|
||||
substituted. If you used to write `$(b,$(tname))` this will generate
|
||||
an error on standard output, since `$` is not escaped in the markup
|
||||
directive. Simply replace these by `$(tname)`.
|
||||
|
||||
v0.9.8 2015-10-11 Cambridge (UK)
|
||||
--------------------------------
|
||||
|
||||
- Bring back support for OCaml 3.12.0
|
||||
- Support for pre-formatted paragraphs in man pages. This adds a
|
||||
```Pre`` case to the `Manpage.block` type which can break existing
|
||||
programs. Thanks to Guillaume Bury for suggesting and help.
|
||||
- Support for environment variables. If an argument is absent from the
|
||||
command line, its value can be read and parsed from an environment
|
||||
variable. This adds an `env` optional argument to the `Arg.info`
|
||||
function which can break existing programs.
|
||||
- Support for new variables in option documentation strings. `$(opt)`
|
||||
can be used to refer to the name of the option being documented and
|
||||
`$(env)` for the name of the option's the environment variable.
|
||||
- Deprecate `Term.pure` in favor of `Term.const`.
|
||||
- Man page generation. Keep undefined variables untouched. Previously
|
||||
a `$(undef)` would be turned into `undef`.
|
||||
- Turn a few mysterious and spurious `Not_found` exceptions into
|
||||
`Invalid_arg`. These can be triggered by client programming errors
|
||||
(e.g. an unclosed variable in a documentation string).
|
||||
- Positional arguments. Invoke the printer on the default (absent)
|
||||
value only if needed. See Optional arguments in the release notes of
|
||||
v0.9.6.
|
||||
|
||||
v0.9.7 2015-02-06 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- Build system, don't depend on `ocamlfind`. The package no longer
|
||||
depends on ocamlfind. Thanks to Louis Gesbert for the patch.
|
||||
|
||||
v0.9.6 2014-11-18 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- Optional arguments. Invoke the printer on the default (absent) value
|
||||
only if needed, i.e. if help is shown. Strictly speaking an
|
||||
interface breaking change – for example if the absent value was lazy
|
||||
it would be forced on each run. This is no longer the case.
|
||||
- Parsed command line syntax: allow short flags to be specified
|
||||
together under a single dash, possibly ending with a short option.
|
||||
This allows to specify e.g. `tar -xvzf archive.tgz` or `tar
|
||||
-xvzfarchive.tgz`. Previously this resulted in an error, all the
|
||||
short flags had to be specified separately. Backward compatible in
|
||||
the sense that only more command lines are parsed. Thanks to Hugo
|
||||
Heuzard for the patch.
|
||||
- End user error message improvements using heuristics and edit
|
||||
distance search in the optional argument and sub command name
|
||||
spaces. Thanks to Hugo Heuzard for the patch.
|
||||
- Adds `Arg.doc_{quote,alts,alts_enum}`, documentation string
|
||||
helpers.
|
||||
- Adds the `Term.eval_peek_opts` function for advanced usage scenarios.
|
||||
- The function `Arg.enum` now raises `Invalid_argument` if the
|
||||
enumeration is empty.
|
||||
- Improves help paging behaviour on Windows. Thanks to Romain Bardou
|
||||
for the help.
|
||||
|
||||
|
||||
v0.9.5 2014-07-04 Cambridge (UK)
|
||||
--------------------------------
|
||||
|
||||
- Add variance annotation to Term.t. Thanks to Peter Zotov for suggesting.
|
||||
- Fix section name formatting in plain text output. Thanks to Mikhail
|
||||
Sobolev for reporting.
|
||||
|
||||
|
||||
v0.9.4 2014-02-09 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- Remove temporary files created for paged help. Thanks to Kaustuv Chaudhuri
|
||||
for the suggestion.
|
||||
- Avoid linking against `Oo` (was used to get program uuid).
|
||||
- Check the environment for `$MANPAGER` as well. Thanks to Raphaël Proust
|
||||
for the patch.
|
||||
- OPAM friendly workflow and drop OASIS support.
|
||||
|
||||
|
||||
v0.9.3 2013-01-04 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- Allow user specified `SYNOPSIS` sections.
|
||||
|
||||
|
||||
v0.9.2 2012-08-05 Lausanne
|
||||
--------------------------
|
||||
|
||||
- OASIS 0.3.0 support.
|
||||
|
||||
|
||||
v0.9.1 2012-03-17 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
- OASIS support.
|
||||
- Fixed broken `Arg.pos_right`.
|
||||
- Variables `$(tname)` and `$(mname)` can be used in a term's man
|
||||
page to respectively refer to the term's name and the main term
|
||||
name.
|
||||
- Support for custom variable substitution in `Manpage.print`.
|
||||
- Adds `Term.man_format`, to facilitate the definition of help commands.
|
||||
- Rewrote the examples with a better and consistent style.
|
||||
|
||||
Incompatible API changes:
|
||||
|
||||
- The signature of `Term.eval` and `Term.eval_choice` changed to make
|
||||
it more regular: the given term and its info must be tupled together
|
||||
even for the main term and the tuple order was swapped to make it
|
||||
consistent with the one used for arguments.
|
||||
|
||||
|
||||
v0.9.0 2011-05-27 Lausanne
|
||||
--------------------------
|
||||
|
||||
- First release.
|
||||
13
cmdliner/_doc-dir/LICENSE.md
Executable file
13
cmdliner/_doc-dir/LICENSE.md
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
Copyright (c) 2011 The cmdliner programmers
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
49
cmdliner/_doc-dir/README.md
Executable file
49
cmdliner/_doc-dir/README.md
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
Cmdliner — Declarative definition of command line interfaces for OCaml
|
||||
-------------------------------------------------------------------------------
|
||||
v1.2.0
|
||||
|
||||
Cmdliner allows the declarative definition of command line interfaces
|
||||
for OCaml.
|
||||
|
||||
It provides a simple and compositional mechanism to convert command
|
||||
line arguments to OCaml values and pass them to your functions. The
|
||||
module automatically handles syntax errors, help messages and UNIX man
|
||||
page generation. It supports programs with single or multiple commands
|
||||
and respects most of the [POSIX][1] and [GNU][2] conventions.
|
||||
|
||||
Cmdliner has no dependencies and is distributed under the ISC license.
|
||||
|
||||
[1]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
|
||||
[2]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
|
||||
|
||||
Home page: http://erratique.ch/software/cmdliner
|
||||
|
||||
## Installation
|
||||
|
||||
Cmdliner can be installed with `opam`:
|
||||
|
||||
opam install cmdliner
|
||||
|
||||
If you don't use `opam` consult the [`opam`](opam) file for build
|
||||
instructions.
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation and API reference is automatically generated by from
|
||||
the source interfaces. It can be consulted [online][doc] or via
|
||||
`odig doc cmdliner`.
|
||||
|
||||
[doc]: http://erratique.ch/software/cmdliner/doc/Cmdliner
|
||||
|
||||
|
||||
## Sample programs
|
||||
|
||||
If you installed Cmdliner with `opam` sample programs are located in
|
||||
the directory `opam config var cmdliner:doc`. These programs define
|
||||
the command line of some classic programs.
|
||||
|
||||
In the distribution sample programs are located in the `test`
|
||||
directory of the distribution. They can be built and run with:
|
||||
|
||||
topkg build --tests true && topkg test
|
||||
121
cmdliner/_doc-dir/odoc-pages/cli.mld
Executable file
121
cmdliner/_doc-dir/odoc-pages/cli.mld
Executable file
|
|
@ -0,0 +1,121 @@
|
|||
{0:cmdline Command line interface}
|
||||
|
||||
For tools evaluating a command without sub commands the most general
|
||||
form of invocation is:
|
||||
|
||||
{[
|
||||
tool [OPTION]… [ARG]…
|
||||
]}
|
||||
|
||||
The tool automatically reponds to the [--help] option by printing the
|
||||
help. If a version string is provided in the
|
||||
{{!Cmdliner.Cmd.val-info}command information}, it also automatically
|
||||
responds to the [--version] option by printing this string on standard
|
||||
output.
|
||||
|
||||
Command line arguments are either {{!optargs}{e optional}} or
|
||||
{{!posargs}{e positional}}. Both can be freely interleaved but since
|
||||
[Cmdliner] accepts many optional forms this may result in
|
||||
ambiguities. The special {{!posargs} token [--]} can be used to
|
||||
resolve them; anything that follows it is treated as a positional
|
||||
argument.
|
||||
|
||||
Tools evaluating commands with sub commands have this form of invocation
|
||||
|
||||
{[
|
||||
tool [COMMAND]… [OPTION]… [ARG]…
|
||||
]}
|
||||
|
||||
Commands automatically respond to the [--help] option by printing
|
||||
their help. The sequence of [COMMAND] strings must be the first
|
||||
strings following the tool name – as soon as an optional argument is
|
||||
seen the search for a sub command stops. Command names may be specified by
|
||||
a prefixe as long as they are not ambiguous.
|
||||
|
||||
{1:optargs Optional arguments}
|
||||
|
||||
An optional argument is specified on the command line by a {e name}
|
||||
possibly followed by a {e value}.
|
||||
|
||||
The name of an option can be short or long.
|
||||
|
||||
{ul
|
||||
{- A {e short} name is a dash followed by a single alphanumeric
|
||||
character: [-h], [-q], [-I].}
|
||||
{- A {e long} name is two dashes followed by alphanumeric
|
||||
characters and dashes: [--help], [--silent], [--ignore-case].}}
|
||||
|
||||
More than one name may refer to the same optional argument. For
|
||||
example in a given program the names [-q], [--quiet] and [--silent]
|
||||
may all stand for the same boolean argument indicating the program to
|
||||
be quiet. Long names can be specified by any non ambiguous prefix.
|
||||
|
||||
The value of an option can be specified in three different ways.
|
||||
|
||||
{ul
|
||||
{- As the next token on the command line: [-o a.out], [--output a.out].}
|
||||
{- Glued to a short name: [-oa.out].}
|
||||
{- Glued to a long name after an equal character: [--output=a.out].}}
|
||||
|
||||
Glued forms are especially useful if the value itself starts with a
|
||||
dash as is the case for negative numbers, [--min=-10].
|
||||
|
||||
An optional argument without a value is either a {e flag} (see
|
||||
{!Cmdliner.Arg.flag}, {!Cmdliner.Arg.vflag}) or an optional argument with
|
||||
an optional value (see the [~vopt] argument of {!Cmdliner.Arg.opt}).
|
||||
|
||||
Short flags can be grouped together to share a single dash and the
|
||||
group can end with a short option. For example assuming [-v] and
|
||||
[-x] are flags and [-f] is a short option:
|
||||
|
||||
{ul
|
||||
{- [-vx] will be parsed as [-v -x].}
|
||||
{- [-vxfopt] will be parsed as [-v -x -fopt].}
|
||||
{- [-vxf opt] will be parsed as [-v -x -fopt].}
|
||||
{- [-fvx] will be parsed as [-f=vx].}}
|
||||
|
||||
{1:posargs Positional arguments}
|
||||
|
||||
Positional arguments are tokens on the command line that are not
|
||||
option names and are not the value of an optional argument. They are
|
||||
numbered from left to right starting with zero.
|
||||
|
||||
Since positional arguments may be mistaken as the optional value of an
|
||||
optional argument or they may need to look like option names, anything
|
||||
that follows the special token ["--"] on the command line is
|
||||
considered to be a positional argument:
|
||||
|
||||
{[
|
||||
tool --option -- we -are --all positional --argu=ments
|
||||
]}
|
||||
|
||||
{1:envlookup Environment variables}
|
||||
|
||||
Non-required command line arguments can be backed up by an environment
|
||||
variable. If the argument is absent from the command line and that
|
||||
the environment variable is defined, its value is parsed using the
|
||||
argument converter and defines the value of the argument.
|
||||
|
||||
For {!Cmdliner.Arg.flag} and {!Cmdliner.Arg.flag_all} that do not have an
|
||||
argument converter a boolean is parsed from the lowercased variable value
|
||||
as follows:
|
||||
|
||||
{ul
|
||||
{- [""], ["false"], ["no"], ["n"] or ["0"] is [false].}
|
||||
{- ["true"], ["yes"], ["y"] or ["1"] is [true].}
|
||||
{- Any other string is an error.}}
|
||||
|
||||
Note that environment variables are not supported for {!Cmdliner.Arg.vflag} and
|
||||
{!Cmdliner.Arg.vflag_all}.
|
||||
|
||||
{1:reserved Reserved option names}
|
||||
|
||||
Using the cmdliner library puts the following constraints o
|
||||
|
||||
{ul
|
||||
{- The option name [--cmdliner] is reserved by the library.}
|
||||
{- The option name [--help], (and [--version] if you specify a version
|
||||
string) is reserved by the library. Using it as a term or option
|
||||
name may result in undefined behaviour.}
|
||||
{- Defining the same option or command name via two different
|
||||
arguments or terms is illegal and raises [Invalid_argument].}}
|
||||
443
cmdliner/_doc-dir/odoc-pages/examples.mld
Executable file
443
cmdliner/_doc-dir/odoc-pages/examples.mld
Executable file
|
|
@ -0,0 +1,443 @@
|
|||
{0 Examples}
|
||||
|
||||
The examples are self-contained, cut and paste them in a file to play
|
||||
with them.
|
||||
|
||||
{1:exrm A [rm] command}
|
||||
|
||||
We define the command line interface of an [rm] command with the
|
||||
synopsis:
|
||||
|
||||
{v
|
||||
rm [OPTION]… FILE…
|
||||
v}
|
||||
|
||||
The [-f], [-i] and [-I] flags define the prompt behaviour of [rm]. It
|
||||
is represented in our program by the [prompt] type. If more than one
|
||||
of these flags is present on the command line the last one takes
|
||||
precedence.
|
||||
|
||||
To implement this behaviour we map the presence of these flags to
|
||||
values of the [prompt] type by using {!Cmdliner.Arg.vflag_all}.
|
||||
|
||||
This argument will contain all occurrences of the flag on the command
|
||||
line and we just take the {!Cmdliner.Arg.last} one to define our term
|
||||
value. If there is no occurrence the last value of the default list
|
||||
[[Always]] is taken. This means the default prompt behaviour is [Always].
|
||||
|
||||
{[
|
||||
(* Implementation of the command, we just print the args. *)
|
||||
|
||||
type prompt = Always | Once | Never
|
||||
let prompt_str = function
|
||||
| Always -> "always" | Once -> "once" | Never -> "never"
|
||||
|
||||
let rm prompt recurse files =
|
||||
Printf.printf "prompt = %s\nrecurse = %B\nfiles = %s\n"
|
||||
(prompt_str prompt) recurse (String.concat ", " files)
|
||||
|
||||
(* Command line interface *)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
let files = Arg.(non_empty & pos_all file [] & info [] ~docv:"FILE")
|
||||
let prompt =
|
||||
let always =
|
||||
let doc = "Prompt before every removal." in
|
||||
Always, Arg.info ["i"] ~doc
|
||||
in
|
||||
let never =
|
||||
let doc = "Ignore nonexistent files and never prompt." in
|
||||
Never, Arg.info ["f"; "force"] ~doc
|
||||
in
|
||||
let once =
|
||||
let doc = "Prompt once before removing more than three files, or when
|
||||
removing recursively. Less intrusive than $(b,-i), while
|
||||
still giving protection against most mistakes."
|
||||
in
|
||||
Once, Arg.info ["I"] ~doc
|
||||
in
|
||||
Arg.(last & vflag_all [Always] [always; never; once])
|
||||
|
||||
let recursive =
|
||||
let doc = "Remove directories and their contents recursively." in
|
||||
Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
|
||||
|
||||
let cmd =
|
||||
let doc = "Remove files or directories" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "$(tname) removes each specified $(i,FILE). By default it does not
|
||||
remove directories, to also remove them and their contents, use the
|
||||
option $(b,--recursive) ($(b,-r) or $(b,-R)).";
|
||||
`P "To remove a file whose name starts with a $(b,-), for example
|
||||
$(b,-foo), use one of these commands:";
|
||||
`Pre "$(mname) $(b,-- -foo)"; `Noblank;
|
||||
`Pre "$(mname) $(b,./-foo)";
|
||||
`P "$(tname) removes symbolic links, not the files referenced by the
|
||||
links.";
|
||||
`S Manpage.s_bugs; `P "Report bugs to <bugs@example.org>.";
|
||||
`S Manpage.s_see_also; `P "$(b,rmdir)(1), $(b,unlink)(2)" ]
|
||||
in
|
||||
let info = Cmd.info "rm" ~version:"v1.2.0" ~doc ~man in
|
||||
Cmd.v info Term.(const rm $ prompt $ recursive $ files)
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()
|
||||
]}
|
||||
|
||||
{1:excp A [cp] command}
|
||||
|
||||
We define the command line interface of a [cp] command with the synopsis:
|
||||
{v
|
||||
cp [OPTION]… SOURCE… DEST
|
||||
v}
|
||||
|
||||
The [DEST] argument must be a directory if there is more than one
|
||||
[SOURCE]. This constraint is too complex to be expressed by the
|
||||
combinators of {!Cmdliner.Arg}.
|
||||
|
||||
Hence we just give [DEST] the {!Cmdliner.Arg.string} type and verify the
|
||||
constraint at the beginning of the implementation of [cp]. If the
|
||||
constraint is unsatisfied we return an [`Error] result. By using
|
||||
{!Cmdliner.Term.val-ret} on the lifted result [cp_t] of [cp],
|
||||
[Cmdliner] handles the error reporting.
|
||||
|
||||
{[
|
||||
(* Implementation, we check the dest argument and print the args *)
|
||||
|
||||
let cp verbose recurse force srcs dest =
|
||||
let many = List.length srcs > 1 in
|
||||
if many && (not (Sys.file_exists dest) || not (Sys.is_directory dest))
|
||||
then `Error (false, dest ^ ": not a directory") else
|
||||
`Ok (Printf.printf
|
||||
"verbose = %B\nrecurse = %B\nforce = %B\nsrcs = %s\ndest = %s\n"
|
||||
verbose recurse force (String.concat ", " srcs) dest)
|
||||
|
||||
(* Command line interface *)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
let verbose =
|
||||
let doc = "Print file names as they are copied." in
|
||||
Arg.(value & flag & info ["v"; "verbose"] ~doc)
|
||||
|
||||
let recurse =
|
||||
let doc = "Copy directories recursively." in
|
||||
Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
|
||||
|
||||
let force =
|
||||
let doc = "If a destination file cannot be opened, remove it and try again."in
|
||||
Arg.(value & flag & info ["f"; "force"] ~doc)
|
||||
|
||||
let srcs =
|
||||
let doc = "Source file(s) to copy." in
|
||||
Arg.(non_empty & pos_left ~rev:true 0 file [] & info [] ~docv:"SOURCE" ~doc)
|
||||
|
||||
let dest =
|
||||
let doc = "Destination of the copy. Must be a directory if there is more \
|
||||
than one $(i,SOURCE)." in
|
||||
let docv = "DEST" in
|
||||
Arg.(required & pos ~rev:true 0 (some string) None & info [] ~docv ~doc)
|
||||
|
||||
let cmd =
|
||||
let doc = "Copy files" in
|
||||
let man_xrefs =
|
||||
[ `Tool "mv"; `Tool "scp"; `Page ("umask", 2); `Page ("symlink", 7) ]
|
||||
in
|
||||
let man =
|
||||
[ `S Manpage.s_bugs;
|
||||
`P "Email them to <bugs@example.org>."; ]
|
||||
in
|
||||
let info = Cmd.info "cp" ~version:"v1.2.0" ~doc ~man ~man_xrefs in
|
||||
Cmd.v info Term.(ret (const cp $ verbose $ recurse $ force $ srcs $ dest))
|
||||
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()
|
||||
]}
|
||||
|
||||
{1:extail A [tail] command}
|
||||
|
||||
We define the command line interface of a [tail] command with the
|
||||
synopsis:
|
||||
|
||||
{v
|
||||
tail [OPTION]… [FILE]…
|
||||
v}
|
||||
|
||||
The [--lines] option whose value specifies the number of last lines to
|
||||
print has a special syntax where a [+] prefix indicates to start
|
||||
printing from that line number. In the program this is represented by
|
||||
the [loc] type. We define a custom [loc_arg]
|
||||
{{!Cmdliner.Arg.type-conv}argument converter} for this option.
|
||||
|
||||
The [--follow] option has an optional enumerated value. The argument
|
||||
converter [follow], created with {!Cmdliner.Arg.enum} parses the
|
||||
option value into the enumeration. By using {!Cmdliner.Arg.some} and
|
||||
the [~vopt] argument of {!Cmdliner.Arg.opt}, the term corresponding to
|
||||
the option [--follow] evaluates to [None] if [--follow] is absent from
|
||||
the command line, to [Some Descriptor] if present but without a value
|
||||
and to [Some v] if present with a value [v] specified.
|
||||
|
||||
{[
|
||||
(* Implementation of the command, we just print the args. *)
|
||||
|
||||
type loc = bool * int
|
||||
type verb = Verbose | Quiet
|
||||
type follow = Name | Descriptor
|
||||
|
||||
let str = Printf.sprintf
|
||||
let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
|
||||
let loc_str (rev, k) = if rev then str "%d" k else str "+%d" k
|
||||
let follow_str = function Name -> "name" | Descriptor -> "descriptor"
|
||||
let verb_str = function Verbose -> "verbose" | Quiet -> "quiet"
|
||||
|
||||
let tail lines follow verb pid files =
|
||||
Printf.printf
|
||||
"lines = %s\nfollow = %s\nverb = %s\npid = %s\nfiles = %s\n"
|
||||
(loc_str lines) (opt_str follow_str follow) (verb_str verb)
|
||||
(opt_str string_of_int pid) (String.concat ", " files)
|
||||
|
||||
(* Command line interface *)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
let loc_arg =
|
||||
let parse s =
|
||||
try
|
||||
if s <> "" && s.[0] <> '+'
|
||||
then Ok (true, int_of_string s)
|
||||
else Ok (false, int_of_string (String.sub s 1 (String.length s - 1)))
|
||||
with Failure _ -> Error (`Msg "unable to parse integer")
|
||||
in
|
||||
let print ppf p = Format.fprintf ppf "%s" (loc_str p) in
|
||||
Arg.conv ~docv:"N" (parse, print)
|
||||
|
||||
let lines =
|
||||
let doc = "Output the last $(docv) lines or use $(i,+)$(docv) to start \
|
||||
output after the $(i,N)-1th line."
|
||||
in
|
||||
Arg.(value & opt loc_arg (true, 10) & info ["n"; "lines"] ~docv:"N" ~doc)
|
||||
|
||||
let follow =
|
||||
let doc = "Output appended data as the file grows. $(docv) specifies how \
|
||||
the file should be tracked, by its $(b,name) or by its \
|
||||
$(b,descriptor)."
|
||||
in
|
||||
let follow = Arg.enum ["name", Name; "descriptor", Descriptor] in
|
||||
Arg.(value & opt (some follow) ~vopt:(Some Descriptor) None &
|
||||
info ["f"; "follow"] ~docv:"ID" ~doc)
|
||||
|
||||
let verb =
|
||||
let quiet =
|
||||
let doc = "Never output headers giving file names." in
|
||||
Quiet, Arg.info ["q"; "quiet"; "silent"] ~doc
|
||||
in
|
||||
let verbose =
|
||||
let doc = "Always output headers giving file names." in
|
||||
Verbose, Arg.info ["v"; "verbose"] ~doc
|
||||
in
|
||||
Arg.(last & vflag_all [Quiet] [quiet; verbose])
|
||||
|
||||
let pid =
|
||||
let doc = "With -f, terminate after process $(docv) dies." in
|
||||
Arg.(value & opt (some int) None & info ["pid"] ~docv:"PID" ~doc)
|
||||
|
||||
let files = Arg.(value & (pos_all non_dir_file []) & info [] ~docv:"FILE")
|
||||
|
||||
let cmd =
|
||||
let doc = "Display the last part of a file" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "$(tname) prints the last lines of each $(i,FILE) to standard output. If
|
||||
no file is specified reads standard input. The number of printed
|
||||
lines can be specified with the $(b,-n) option.";
|
||||
`S Manpage.s_bugs;
|
||||
`P "Report them to <bugs@example.org>.";
|
||||
`S Manpage.s_see_also;
|
||||
`P "$(b,cat)(1), $(b,head)(1)" ]
|
||||
in
|
||||
let info = Cmd.info "tail" ~version:"v1.2.0" ~doc ~man in
|
||||
Cmd.v info Term.(const tail $ lines $ follow $ verb $ pid $ files)
|
||||
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()
|
||||
]}
|
||||
|
||||
{1:exdarcs A [darcs] command}
|
||||
|
||||
We define the command line interface of a [darcs] command with the
|
||||
synopsis:
|
||||
|
||||
{v
|
||||
darcs [COMMAND] …
|
||||
v}
|
||||
|
||||
The [--debug], [-q], [-v] and [--prehook] options are available in
|
||||
each command. To avoid having to pass them individually to each
|
||||
command we gather them in a record of type [copts]. By lifting the
|
||||
record constructor [copts] into the term [copts_t] we now have a term
|
||||
that we can pass to the commands to stand for an argument of type
|
||||
[copts]. These options are documented in a section called [COMMON
|
||||
OPTIONS], since we also want to put [--help] and [--version] in this
|
||||
section, the term information of commands makes a judicious use of the
|
||||
[sdocs] parameter of {!Cmdliner.Term.val-info}.
|
||||
|
||||
The [help] command shows help about commands or other topics. The help
|
||||
shown for commands is generated by [Cmdliner] by making an appropriate
|
||||
use of {!Cmdliner.Term.val-ret} on the lifted [help] function.
|
||||
|
||||
If the program is invoked without a command we just want to show the
|
||||
help of the program as printed by [Cmdliner] with [--help]. This is
|
||||
done by the [default_cmd] term.
|
||||
|
||||
{[
|
||||
(* Implementations, just print the args. *)
|
||||
|
||||
type verb = Normal | Quiet | Verbose
|
||||
type copts = { debug : bool; verb : verb; prehook : string option }
|
||||
|
||||
let str = Printf.sprintf
|
||||
let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
|
||||
let opt_str_str = opt_str (fun s -> s)
|
||||
let verb_str = function
|
||||
| Normal -> "normal" | Quiet -> "quiet" | Verbose -> "verbose"
|
||||
|
||||
let pr_copts oc copts = Printf.fprintf oc
|
||||
"debug = %B\nverbosity = %s\nprehook = %s\n"
|
||||
copts.debug (verb_str copts.verb) (opt_str_str copts.prehook)
|
||||
|
||||
let initialize copts repodir = Printf.printf
|
||||
"%arepodir = %s\n" pr_copts copts repodir
|
||||
|
||||
let record copts name email all ask_deps files = Printf.printf
|
||||
"%aname = %s\nemail = %s\nall = %B\nask-deps = %B\nfiles = %s\n"
|
||||
pr_copts copts (opt_str_str name) (opt_str_str email) all ask_deps
|
||||
(String.concat ", " files)
|
||||
|
||||
let help copts man_format cmds topic = match topic with
|
||||
| None -> `Help (`Pager, None) (* help about the program. *)
|
||||
| Some topic ->
|
||||
let topics = "topics" :: "patterns" :: "environment" :: cmds in
|
||||
let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
|
||||
match conv topic with
|
||||
| `Error e -> `Error (false, e)
|
||||
| `Ok t when t = "topics" -> List.iter print_endline topics; `Ok ()
|
||||
| `Ok t when List.mem t cmds -> `Help (man_format, Some t)
|
||||
| `Ok t ->
|
||||
let page = (topic, 7, "", "", ""), [`S topic; `P "Say something";] in
|
||||
`Ok (Cmdliner.Manpage.print man_format Format.std_formatter page)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
(* Help sections common to all commands *)
|
||||
|
||||
let help_secs = [
|
||||
`S Manpage.s_common_options;
|
||||
`P "These options are common to all commands.";
|
||||
`S "MORE HELP";
|
||||
`P "Use $(mname) $(i,COMMAND) --help for help on a single command.";`Noblank;
|
||||
`P "Use $(mname) $(b,help patterns) for help on patch matching."; `Noblank;
|
||||
`P "Use $(mname) $(b,help environment) for help on environment variables.";
|
||||
`S Manpage.s_bugs; `P "Check bug reports at http://bugs.example.org.";]
|
||||
|
||||
(* Options common to all commands *)
|
||||
|
||||
let copts debug verb prehook = { debug; verb; prehook }
|
||||
let copts_t =
|
||||
let docs = Manpage.s_common_options in
|
||||
let debug =
|
||||
let doc = "Give only debug output." in
|
||||
Arg.(value & flag & info ["debug"] ~docs ~doc)
|
||||
in
|
||||
let verb =
|
||||
let doc = "Suppress informational output." in
|
||||
let quiet = Quiet, Arg.info ["q"; "quiet"] ~docs ~doc in
|
||||
let doc = "Give verbose output." in
|
||||
let verbose = Verbose, Arg.info ["v"; "verbose"] ~docs ~doc in
|
||||
Arg.(last & vflag_all [Normal] [quiet; verbose])
|
||||
in
|
||||
let prehook =
|
||||
let doc = "Specify command to run before this $(mname) command." in
|
||||
Arg.(value & opt (some string) None & info ["prehook"] ~docs ~doc)
|
||||
in
|
||||
Term.(const copts $ debug $ verb $ prehook)
|
||||
|
||||
(* Commands *)
|
||||
|
||||
let sdocs = Manpage.s_common_options
|
||||
|
||||
let initialize_cmd =
|
||||
let repodir =
|
||||
let doc = "Run the program in repository directory $(docv)." in
|
||||
Arg.(value & opt file Filename.current_dir_name & info ["repodir"]
|
||||
~docv:"DIR" ~doc)
|
||||
in
|
||||
let doc = "make the current directory a repository" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "Turns the current directory into a Darcs repository. Any
|
||||
existing files and subdirectories become …";
|
||||
`Blocks help_secs; ]
|
||||
in
|
||||
let info = Cmd.info "initialize" ~doc ~sdocs ~man in
|
||||
Cmd.v info Term.(const initialize $ copts_t $ repodir)
|
||||
|
||||
let record_cmd =
|
||||
let pname =
|
||||
let doc = "Name of the patch." in
|
||||
Arg.(value & opt (some string) None & info ["m"; "patch-name"] ~docv:"NAME"
|
||||
~doc)
|
||||
in
|
||||
let author =
|
||||
let doc = "Specifies the author's identity." in
|
||||
Arg.(value & opt (some string) None & info ["A"; "author"] ~docv:"EMAIL"
|
||||
~doc)
|
||||
in
|
||||
let all =
|
||||
let doc = "Answer yes to all patches." in
|
||||
Arg.(value & flag & info ["a"; "all"] ~doc)
|
||||
in
|
||||
let ask_deps =
|
||||
let doc = "Ask for extra dependencies." in
|
||||
Arg.(value & flag & info ["ask-deps"] ~doc)
|
||||
in
|
||||
let files = Arg.(value & (pos_all file) [] & info [] ~docv:"FILE or DIR") in
|
||||
let doc = "create a patch from unrecorded changes" in
|
||||
let man =
|
||||
[`S Manpage.s_description;
|
||||
`P "Creates a patch from changes in the working tree. If you specify
|
||||
a set of files …";
|
||||
`Blocks help_secs; ]
|
||||
in
|
||||
let info = Cmd.info "record" ~doc ~sdocs ~man in
|
||||
Cmd.v info
|
||||
Term.(const record $ copts_t $ pname $ author $ all $ ask_deps $ files)
|
||||
|
||||
let help_cmd =
|
||||
let topic =
|
||||
let doc = "The topic to get help on. $(b,topics) lists the topics." in
|
||||
Arg.(value & pos 0 (some string) None & info [] ~docv:"TOPIC" ~doc)
|
||||
in
|
||||
let doc = "display help about darcs and darcs commands" in
|
||||
let man =
|
||||
[`S Manpage.s_description;
|
||||
`P "Prints help about darcs commands and other subjects…";
|
||||
`Blocks help_secs; ]
|
||||
in
|
||||
let info = Cmd.info "help" ~doc ~man in
|
||||
Cmd.v info
|
||||
Term.(ret (const help $ copts_t $ Arg.man_format $ Term.choice_names $
|
||||
topic))
|
||||
|
||||
let main_cmd =
|
||||
let doc = "a revision control system" in
|
||||
let man = help_secs in
|
||||
let info = Cmd.info "darcs" ~version:"v1.2.0" ~doc ~sdocs ~man in
|
||||
let default = Term.(ret (const (fun _ -> `Help (`Pager, None)) $ copts_t)) in
|
||||
Cmd.group info ~default [initialize_cmd; record_cmd; help_cmd]
|
||||
|
||||
let () = exit (Cmd.eval main_cmd)
|
||||
]}
|
||||
34
cmdliner/_doc-dir/odoc-pages/index.mld
Executable file
34
cmdliner/_doc-dir/odoc-pages/index.mld
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
{0 Cmdliner {%html: <span class="version">v1.2.0</span>%}}
|
||||
|
||||
[Cmdliner] provides a simple and compositional mechanism
|
||||
to convert command line arguments to OCaml values and pass them to
|
||||
your functions.
|
||||
|
||||
The library automatically handles syntax errors, help messages and
|
||||
UNIX man page generation. It supports programs with single or multiple
|
||||
commands (like [git]) and respect most of the
|
||||
{{:http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html}
|
||||
POSIX} and
|
||||
{{:http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html}
|
||||
GNU} conventions.
|
||||
|
||||
{1:manuals Manuals}
|
||||
|
||||
The following manuals are available.
|
||||
|
||||
{ul
|
||||
{- The {{!page-tutorial}tutorial} gets you through the steps to write
|
||||
your first command line interface with Cmdliner.}
|
||||
{- The {{!page-cli}Command line interface manual} describes how command
|
||||
lines and environment variables are parsed by Cmdliner.}
|
||||
{- {{!page-tool_man}Tool man pages} describes how Cmdliner generates
|
||||
man pages for your tools and how you can format them.}
|
||||
{- The {{!page-examples}examples page} has a few annoted examples that
|
||||
show to express the command line interface of a few classic tools with
|
||||
Cmdliner}}
|
||||
|
||||
{1:api API}
|
||||
|
||||
{!modules:
|
||||
Cmdliner
|
||||
}
|
||||
70
cmdliner/_doc-dir/odoc-pages/tool_man.mld
Executable file
70
cmdliner/_doc-dir/odoc-pages/tool_man.mld
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
{0:tool_man Tool man pages}
|
||||
|
||||
{1:manual Manual}
|
||||
|
||||
Man page sections for a command are printed in the order specified by
|
||||
manual as given to {!Cmdliner.Cmd.val-info}. Unless specified
|
||||
explicitly in the command's manual the following sections are
|
||||
automatically created and populated for you:
|
||||
|
||||
{ul
|
||||
{- {{!Cmdliner.Manpage.s_name}[NAME]} section.}
|
||||
{- {{!Cmdliner.Manpage.s_synopsis}[SYNOPSIS]} section.}}
|
||||
|
||||
The various [doc] documentation strings specified by the command's
|
||||
term arguments get inserted at the end of the documentation section
|
||||
they respectively mention in their [docs] argument:
|
||||
|
||||
{ol
|
||||
{- For commands, see {!Cmdliner.Cmd.val-info}.}
|
||||
{- For positional arguments, see {!Cmdliner.Arg.type-info}. Those are listed iff
|
||||
both the [docv] and [doc] string is specified by {!Cmdliner.Arg.val-info}.}
|
||||
{- For optional arguments, see {!Cmdliner.Arg.val-info}.}
|
||||
{- For exit statuses, see {!Cmdliner.Cmd.Exit.val-info}.}
|
||||
{- For environment variables, see
|
||||
{!Cmdliner.Arg.val-env_var} and {!Cmdliner.Cmd.Env.val-info}.}}
|
||||
|
||||
If a [docs] section name is mentioned and does not exist in the command's
|
||||
manual, an empty section is created for it, after which the [doc] strings
|
||||
are inserted, possibly prefixed by boilerplate text (e.g. for
|
||||
{!Cmdliner.Manpage.s_environment} and {!Cmdliner.Manpage.s_exit_status}).
|
||||
|
||||
If the created section is:
|
||||
{ul
|
||||
{- {{!Cmdliner.Manpage.standard_sections}standard}, it
|
||||
is inserted at the right place in the order specified
|
||||
{{!Cmdliner.Manpage.standard_sections}here}, but after a
|
||||
possible non-standard
|
||||
section explicitly specified by the command's manual since the latter
|
||||
get the order number of the last previously specified standard section
|
||||
or the order of {!Cmdliner.Manpage.s_synopsis} if there is no such section.}
|
||||
{- non-standard, it is inserted before the {!Cmdliner.Manpage.s_commands}
|
||||
section or the first subsequent existing standard section if it
|
||||
doesn't exist. Taking advantage of this behaviour is discouraged,
|
||||
you should declare manually your non standard section in the command's
|
||||
manual page.}}
|
||||
|
||||
Finally note that the header of empty sections are dropped from the
|
||||
output. This allows you to share section placements among many
|
||||
commands and render them only if something actually gets inserted in
|
||||
it.
|
||||
|
||||
{1:doclang Documentation markup language}
|
||||
|
||||
Manpage {{!Cmdliner.Manpage.block}blocks} and doc strings support the
|
||||
following markup language.
|
||||
|
||||
{ul
|
||||
{- Markup directives [$(i,text)] and [$(b,text)], where [text] is raw
|
||||
text respectively rendered in italics and bold.}
|
||||
{- Outside markup directives, context dependent variables of the form
|
||||
[$(var)] are substituted by marked up data. For example in a term's
|
||||
man page [$(tname)] is substituted by the term name in bold.}
|
||||
{- Characters $, (, ) and \ can respectively be escaped by \$, \(, \)
|
||||
and \\ (in OCaml strings this will be ["\\$"], ["\\("], ["\\)"],
|
||||
["\\\\"]). Escaping $ and \ is mandatory everywhere. Escaping ) is
|
||||
mandatory only in markup directives. Escaping ( is only here for
|
||||
your symmetric pleasure. Any other sequence of characters starting
|
||||
with a \ is an illegal character sequence.}
|
||||
{- Referring to unknown markup directives or variables will generate
|
||||
errors on standard error during documentation generation.}}
|
||||
203
cmdliner/_doc-dir/odoc-pages/tutorial.mld
Executable file
203
cmdliner/_doc-dir/odoc-pages/tutorial.mld
Executable file
|
|
@ -0,0 +1,203 @@
|
|||
{0:tutorial Tutorial}
|
||||
|
||||
{1:started Getting started}
|
||||
|
||||
With [Cmdliner] your tool's [main] function evaluates a command.
|
||||
|
||||
A command is a value of type {!Cmdliner.Cmd.t} which gathers a command
|
||||
name and a term of type {!Cmdliner.Term.t}. A term is an expression to
|
||||
be evaluated. The type parameter of the term (and the command)
|
||||
indicates the type of the result of the evaluation.
|
||||
|
||||
One way to create terms is by lifting regular OCaml values with
|
||||
{!Cmdliner.Term.const}. Terms can be applied to terms evaluating to
|
||||
functional values with {!Cmdliner.Term.($)}.
|
||||
|
||||
For example, in a [revolt.ml] file, for the function:
|
||||
|
||||
{[
|
||||
let revolt () = print_endline "Revolt!"
|
||||
]}
|
||||
|
||||
the term :
|
||||
|
||||
{[
|
||||
open Cmdliner
|
||||
|
||||
let revolt_t = Term.(const revolt $ const ())
|
||||
]}
|
||||
|
||||
is a term that evaluates to the result (and effect) of the [revolt]
|
||||
function. This term can be attached to a command:
|
||||
|
||||
{[
|
||||
let cmd = Cmd.v (Cmd.info "revolt") revolt_t
|
||||
]}
|
||||
|
||||
and evaluated with {!Cmdliner.Cmd.val-eval}:
|
||||
{[
|
||||
let () = exit (Cmd.eval cmd)
|
||||
]}
|
||||
|
||||
This defines a command line tool named ["revolt"] (this name will be
|
||||
used in error reporting and documentation generation), without command
|
||||
line arguments, that just prints ["Revolt!"] on [stdout].
|
||||
|
||||
{[
|
||||
> ocamlfind ocamlopt -linkpkg -package cmdliner -o revolt revolt.ml
|
||||
> ./revolt
|
||||
Revolt!
|
||||
]}
|
||||
|
||||
The combinators in the {!Cmdliner.Arg} module allow to extract command
|
||||
line arguments as terms. These terms can then be applied to lifted
|
||||
OCaml functions to be evaluated.
|
||||
|
||||
Terms corresponding to command line argument data that are part of a
|
||||
term evaluation implicitly define a command line syntax. We show this
|
||||
on an concrete example.
|
||||
|
||||
In a [chorus.ml] file, consider the [chorus] function that prints
|
||||
repeatedly a given message :
|
||||
|
||||
{[
|
||||
let chorus count msg = for i = 1 to count do print_endline msg done
|
||||
]}
|
||||
|
||||
we want to make it available from the command line with the synopsis:
|
||||
|
||||
{[
|
||||
chorus [-c COUNT | --count=COUNT] [MSG]
|
||||
]}
|
||||
|
||||
where [COUNT] defaults to [10] and [MSG] defaults to ["Revolt!"]. We
|
||||
first define a term corresponding to the [--count] option:
|
||||
|
||||
{[
|
||||
let count =
|
||||
let doc = "Repeat the message $(docv) times." in
|
||||
Arg.(value & opt int 10 & info ["c"; "count"] ~docv:"COUNT" ~doc)
|
||||
]}
|
||||
|
||||
This says that [count] is a term that evaluates to the value of an
|
||||
optional argument of type [int] that defaults to [10] if unspecified
|
||||
and whose option name is either [-c] or [--count]. The arguments [doc]
|
||||
and [docv] are used to generate the option's man page information.
|
||||
|
||||
The term for the positional argument [MSG] is:
|
||||
|
||||
{[
|
||||
let msg =
|
||||
let env =
|
||||
let doc = "Overrides the default message to print." in
|
||||
Cmd.Env.info "CHORUS_MSG" ~doc
|
||||
in
|
||||
let doc = "The message to print." in
|
||||
Arg.(value & pos 0 string "Revolt!" & info [] ~env ~docv:"MSG" ~doc)
|
||||
]}
|
||||
|
||||
which says that [msg] is a term whose value is the positional argument
|
||||
at index [0] of type [string] and defaults to ["Revolt!"] or the
|
||||
value of the environment variable [CHORUS_MSG] if the argument is
|
||||
unspecified on the command line. Here again [doc] and [docv] are used
|
||||
for the man page information.
|
||||
|
||||
The term for executing [chorus] with these command line arguments is :
|
||||
|
||||
{[
|
||||
let chorus_t = Term.(const chorus $ count $ msg)
|
||||
]}
|
||||
|
||||
We are now ready to define the [main] function of our tool:
|
||||
|
||||
{[
|
||||
let cmd =
|
||||
let doc = "print a customizable message repeatedly" in
|
||||
let man = [
|
||||
`S Manpage.s_bugs;
|
||||
`P "Email bug reports to <bugs@example.org>." ]
|
||||
in
|
||||
let info = Cmd.info "chorus" ~version:"%%VERSION%%" ~doc ~man in
|
||||
Cmd.v info chorus_t
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()
|
||||
]}
|
||||
|
||||
The [info] value created with {!Cmdliner.Cmd.val-info} gives more
|
||||
information about the term we execute and is used to generate the
|
||||
tool's man page. Since we provided a [~version] string, the tool
|
||||
will automatically respond to the [--version] option by printing this
|
||||
string.
|
||||
|
||||
A tool using {!Cmdliner.Cmd.val-eval} always responds to the [--help]
|
||||
option by showing the tool's man page generated using the information
|
||||
you provided with {!Cmdliner.Cmd.val-info} and
|
||||
{!Cmdliner.Arg.val-info}. Here is the output generated by our
|
||||
example:
|
||||
|
||||
{v
|
||||
> ocamlfind ocamlopt -linkpkg -package cmdliner -o chorus chorus.ml
|
||||
> ./chorus --help
|
||||
NAME
|
||||
chorus - Print a customizable message repeatedly
|
||||
|
||||
SYNOPSIS
|
||||
chorus [--count=COUNT] [OPTION]… [MSG]
|
||||
|
||||
ARGUMENTS
|
||||
MSG (absent=Revolt! or CHORUS_MSG env)
|
||||
The message to print.
|
||||
|
||||
OPTIONS
|
||||
-c COUNT, --count=COUNT (absent=10)
|
||||
Repeat the message COUNT times.
|
||||
|
||||
COMMON OPTIONS
|
||||
--help[=FMT] (default=auto)
|
||||
Show this help in format FMT. The value FMT must be one of auto,
|
||||
pager, groff or plain. With auto, the format is pager or plain
|
||||
whenever the TERM env var is dumb or undefined.
|
||||
|
||||
--version
|
||||
Show version information.
|
||||
|
||||
EXIT STATUS
|
||||
chorus exits with the following status:
|
||||
|
||||
0 on success.
|
||||
|
||||
123 on indiscriminate errors reported on standard error.
|
||||
|
||||
124 on command line parsing errors.
|
||||
|
||||
125 on unexpected internal errors (bugs).
|
||||
|
||||
ENVIRONMENT
|
||||
These environment variables affect the execution of chorus:
|
||||
|
||||
CHORUS_MSG
|
||||
Overrides the default message to print.
|
||||
|
||||
BUGS
|
||||
Email bug reports to <bugs@example.org>.
|
||||
v}
|
||||
|
||||
If a pager is available, this output is written to a pager. This help
|
||||
is also available in plain text or in the
|
||||
{{:http://www.gnu.org/software/groff/groff.html}groff} man page format
|
||||
by invoking the program with the option [--help=plain] or
|
||||
[--help=groff].
|
||||
|
||||
For examples of more complex command line definitions look and run
|
||||
the {{!page-examples}examples}.
|
||||
|
||||
{1:subcommands Sub commands}
|
||||
|
||||
[Cmdliner] also provides support for programs like [git] that have sub
|
||||
commands each with their own command line syntax and manual:
|
||||
|
||||
{[tool [COMMAND]… [OPTION]… ARG…]}
|
||||
|
||||
These sub commands are defined by grouping them under a parent command
|
||||
via the {!Cmdliner.Cmd.group} function.
|
||||
2
cmdliner/cli.html
Normal file
2
cmdliner/cli.html
Normal file
File diff suppressed because one or more lines are too long
337
cmdliner/examples.html
Normal file
337
cmdliner/examples.html
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>examples (cmdliner.examples)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../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">cmdliner</a> » examples</nav><header class="odoc-preamble"><h1 id="examples"><a href="#examples" class="anchor"></a>Examples</h1><p>The examples are self-contained, cut and paste them in a file to play with them.</p></header><nav class="odoc-toc"><ul><li><a href="#exrm">A <code>rm</code> command</a></li><li><a href="#excp">A <code>cp</code> command</a></li><li><a href="#extail">A <code>tail</code> command</a></li><li><a href="#exdarcs">A <code>darcs</code> command</a></li></ul></nav><div class="odoc-content"><h2 id="exrm"><a href="#exrm" class="anchor"></a>A <code>rm</code> command</h2><p>We define the command line interface of an <code>rm</code> command with the synopsis:</p><pre>rm [OPTION]… FILE…</pre><p>The <code>-f</code>, <code>-i</code> and <code>-I</code> flags define the prompt behaviour of <code>rm</code>. It is represented in our program by the <code>prompt</code> type. If more than one of these flags is present on the command line the last one takes precedence.</p><p>To implement this behaviour we map the presence of these flags to values of the <code>prompt</code> type by using <a href="Cmdliner/Arg/index.html#val-vflag_all"><code>Cmdliner.Arg.vflag_all</code></a>.</p><p>This argument will contain all occurrences of the flag on the command line and we just take the <a href="Cmdliner/Arg/index.html#val-last"><code>Cmdliner.Arg.last</code></a> one to define our term value. If there is no occurrence the last value of the default list <code>[Always]</code> is taken. This means the default prompt behaviour is <code>Always</code>.</p><pre class="language-ocaml"><code>(* Implementation of the command, we just print the args. *)
|
||||
|
||||
type prompt = Always | Once | Never
|
||||
let prompt_str = function
|
||||
| Always -> "always" | Once -> "once" | Never -> "never"
|
||||
|
||||
let rm prompt recurse files =
|
||||
Printf.printf "prompt = %s\nrecurse = %B\nfiles = %s\n"
|
||||
(prompt_str prompt) recurse (String.concat ", " files)
|
||||
|
||||
(* Command line interface *)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
let files = Arg.(non_empty & pos_all file [] & info [] ~docv:"FILE")
|
||||
let prompt =
|
||||
let always =
|
||||
let doc = "Prompt before every removal." in
|
||||
Always, Arg.info ["i"] ~doc
|
||||
in
|
||||
let never =
|
||||
let doc = "Ignore nonexistent files and never prompt." in
|
||||
Never, Arg.info ["f"; "force"] ~doc
|
||||
in
|
||||
let once =
|
||||
let doc = "Prompt once before removing more than three files, or when
|
||||
removing recursively. Less intrusive than $(b,-i), while
|
||||
still giving protection against most mistakes."
|
||||
in
|
||||
Once, Arg.info ["I"] ~doc
|
||||
in
|
||||
Arg.(last & vflag_all [Always] [always; never; once])
|
||||
|
||||
let recursive =
|
||||
let doc = "Remove directories and their contents recursively." in
|
||||
Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
|
||||
|
||||
let cmd =
|
||||
let doc = "Remove files or directories" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "$(tname) removes each specified $(i,FILE). By default it does not
|
||||
remove directories, to also remove them and their contents, use the
|
||||
option $(b,--recursive) ($(b,-r) or $(b,-R)).";
|
||||
`P "To remove a file whose name starts with a $(b,-), for example
|
||||
$(b,-foo), use one of these commands:";
|
||||
`Pre "$(mname) $(b,-- -foo)"; `Noblank;
|
||||
`Pre "$(mname) $(b,./-foo)";
|
||||
`P "$(tname) removes symbolic links, not the files referenced by the
|
||||
links.";
|
||||
`S Manpage.s_bugs; `P "Report bugs to <bugs@example.org>.";
|
||||
`S Manpage.s_see_also; `P "$(b,rmdir)(1), $(b,unlink)(2)" ]
|
||||
in
|
||||
let info = Cmd.info "rm" ~version:"v1.2.0" ~doc ~man in
|
||||
Cmd.v info Term.(const rm $ prompt $ recursive $ files)
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()</code></pre><h2 id="excp"><a href="#excp" class="anchor"></a>A <code>cp</code> command</h2><p>We define the command line interface of a <code>cp</code> command with the synopsis:</p><pre>cp [OPTION]… SOURCE… DEST</pre><p>The <code>DEST</code> argument must be a directory if there is more than one <code>SOURCE</code>. This constraint is too complex to be expressed by the combinators of <a href="Cmdliner/Arg/index.html"><code>Cmdliner.Arg</code></a>.</p><p>Hence we just give <code>DEST</code> the <a href="Cmdliner/Arg/index.html#val-string"><code>Cmdliner.Arg.string</code></a> type and verify the constraint at the beginning of the implementation of <code>cp</code>. If the constraint is unsatisfied we return an <code>`Error</code> result. By using <a href="Cmdliner/Term/index.html#val-ret"><code>Cmdliner.Term.ret</code></a> on the lifted result <code>cp_t</code> of <code>cp</code>, <code>Cmdliner</code> handles the error reporting.</p><pre class="language-ocaml"><code>(* Implementation, we check the dest argument and print the args *)
|
||||
|
||||
let cp verbose recurse force srcs dest =
|
||||
let many = List.length srcs > 1 in
|
||||
if many && (not (Sys.file_exists dest) || not (Sys.is_directory dest))
|
||||
then `Error (false, dest ^ ": not a directory") else
|
||||
`Ok (Printf.printf
|
||||
"verbose = %B\nrecurse = %B\nforce = %B\nsrcs = %s\ndest = %s\n"
|
||||
verbose recurse force (String.concat ", " srcs) dest)
|
||||
|
||||
(* Command line interface *)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
let verbose =
|
||||
let doc = "Print file names as they are copied." in
|
||||
Arg.(value & flag & info ["v"; "verbose"] ~doc)
|
||||
|
||||
let recurse =
|
||||
let doc = "Copy directories recursively." in
|
||||
Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)
|
||||
|
||||
let force =
|
||||
let doc = "If a destination file cannot be opened, remove it and try again."in
|
||||
Arg.(value & flag & info ["f"; "force"] ~doc)
|
||||
|
||||
let srcs =
|
||||
let doc = "Source file(s) to copy." in
|
||||
Arg.(non_empty & pos_left ~rev:true 0 file [] & info [] ~docv:"SOURCE" ~doc)
|
||||
|
||||
let dest =
|
||||
let doc = "Destination of the copy. Must be a directory if there is more \
|
||||
than one $(i,SOURCE)." in
|
||||
let docv = "DEST" in
|
||||
Arg.(required & pos ~rev:true 0 (some string) None & info [] ~docv ~doc)
|
||||
|
||||
let cmd =
|
||||
let doc = "Copy files" in
|
||||
let man_xrefs =
|
||||
[ `Tool "mv"; `Tool "scp"; `Page ("umask", 2); `Page ("symlink", 7) ]
|
||||
in
|
||||
let man =
|
||||
[ `S Manpage.s_bugs;
|
||||
`P "Email them to <bugs@example.org>."; ]
|
||||
in
|
||||
let info = Cmd.info "cp" ~version:"v1.2.0" ~doc ~man ~man_xrefs in
|
||||
Cmd.v info Term.(ret (const cp $ verbose $ recurse $ force $ srcs $ dest))
|
||||
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()</code></pre><h2 id="extail"><a href="#extail" class="anchor"></a>A <code>tail</code> command</h2><p>We define the command line interface of a <code>tail</code> command with the synopsis:</p><pre>tail [OPTION]… [FILE]…</pre><p>The <code>--lines</code> option whose value specifies the number of last lines to print has a special syntax where a <code>+</code> prefix indicates to start printing from that line number. In the program this is represented by the <code>loc</code> type. We define a custom <code>loc_arg</code> <a href="Cmdliner/Arg/index.html#type-conv" title="Cmdliner.Arg.conv">argument converter</a> for this option.</p><p>The <code>--follow</code> option has an optional enumerated value. The argument converter <code>follow</code>, created with <a href="Cmdliner/Arg/index.html#val-enum"><code>Cmdliner.Arg.enum</code></a> parses the option value into the enumeration. By using <a href="Cmdliner/Arg/index.html#val-some"><code>Cmdliner.Arg.some</code></a> and the <code>~vopt</code> argument of <a href="Cmdliner/Arg/index.html#val-opt"><code>Cmdliner.Arg.opt</code></a>, the term corresponding to the option <code>--follow</code> evaluates to <code>None</code> if <code>--follow</code> is absent from the command line, to <code>Some Descriptor</code> if present but without a value and to <code>Some v</code> if present with a value <code>v</code> specified.</p><pre class="language-ocaml"><code>(* Implementation of the command, we just print the args. *)
|
||||
|
||||
type loc = bool * int
|
||||
type verb = Verbose | Quiet
|
||||
type follow = Name | Descriptor
|
||||
|
||||
let str = Printf.sprintf
|
||||
let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
|
||||
let loc_str (rev, k) = if rev then str "%d" k else str "+%d" k
|
||||
let follow_str = function Name -> "name" | Descriptor -> "descriptor"
|
||||
let verb_str = function Verbose -> "verbose" | Quiet -> "quiet"
|
||||
|
||||
let tail lines follow verb pid files =
|
||||
Printf.printf
|
||||
"lines = %s\nfollow = %s\nverb = %s\npid = %s\nfiles = %s\n"
|
||||
(loc_str lines) (opt_str follow_str follow) (verb_str verb)
|
||||
(opt_str string_of_int pid) (String.concat ", " files)
|
||||
|
||||
(* Command line interface *)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
let loc_arg =
|
||||
let parse s =
|
||||
try
|
||||
if s <> "" && s.[0] <> '+'
|
||||
then Ok (true, int_of_string s)
|
||||
else Ok (false, int_of_string (String.sub s 1 (String.length s - 1)))
|
||||
with Failure _ -> Error (`Msg "unable to parse integer")
|
||||
in
|
||||
let print ppf p = Format.fprintf ppf "%s" (loc_str p) in
|
||||
Arg.conv ~docv:"N" (parse, print)
|
||||
|
||||
let lines =
|
||||
let doc = "Output the last $(docv) lines or use $(i,+)$(docv) to start \
|
||||
output after the $(i,N)-1th line."
|
||||
in
|
||||
Arg.(value & opt loc_arg (true, 10) & info ["n"; "lines"] ~docv:"N" ~doc)
|
||||
|
||||
let follow =
|
||||
let doc = "Output appended data as the file grows. $(docv) specifies how \
|
||||
the file should be tracked, by its $(b,name) or by its \
|
||||
$(b,descriptor)."
|
||||
in
|
||||
let follow = Arg.enum ["name", Name; "descriptor", Descriptor] in
|
||||
Arg.(value & opt (some follow) ~vopt:(Some Descriptor) None &
|
||||
info ["f"; "follow"] ~docv:"ID" ~doc)
|
||||
|
||||
let verb =
|
||||
let quiet =
|
||||
let doc = "Never output headers giving file names." in
|
||||
Quiet, Arg.info ["q"; "quiet"; "silent"] ~doc
|
||||
in
|
||||
let verbose =
|
||||
let doc = "Always output headers giving file names." in
|
||||
Verbose, Arg.info ["v"; "verbose"] ~doc
|
||||
in
|
||||
Arg.(last & vflag_all [Quiet] [quiet; verbose])
|
||||
|
||||
let pid =
|
||||
let doc = "With -f, terminate after process $(docv) dies." in
|
||||
Arg.(value & opt (some int) None & info ["pid"] ~docv:"PID" ~doc)
|
||||
|
||||
let files = Arg.(value & (pos_all non_dir_file []) & info [] ~docv:"FILE")
|
||||
|
||||
let cmd =
|
||||
let doc = "Display the last part of a file" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "$(tname) prints the last lines of each $(i,FILE) to standard output. If
|
||||
no file is specified reads standard input. The number of printed
|
||||
lines can be specified with the $(b,-n) option.";
|
||||
`S Manpage.s_bugs;
|
||||
`P "Report them to <bugs@example.org>.";
|
||||
`S Manpage.s_see_also;
|
||||
`P "$(b,cat)(1), $(b,head)(1)" ]
|
||||
in
|
||||
let info = Cmd.info "tail" ~version:"v1.2.0" ~doc ~man in
|
||||
Cmd.v info Term.(const tail $ lines $ follow $ verb $ pid $ files)
|
||||
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()</code></pre><h2 id="exdarcs"><a href="#exdarcs" class="anchor"></a>A <code>darcs</code> command</h2><p>We define the command line interface of a <code>darcs</code> command with the synopsis:</p><pre>darcs [COMMAND] …</pre><p>The <code>--debug</code>, <code>-q</code>, <code>-v</code> and <code>--prehook</code> options are available in each command. To avoid having to pass them individually to each command we gather them in a record of type <code>copts</code>. By lifting the record constructor <code>copts</code> into the term <code>copts_t</code> we now have a term that we can pass to the commands to stand for an argument of type <code>copts</code>. These options are documented in a section called <code>COMMON
|
||||
OPTIONS</code>, since we also want to put <code>--help</code> and <code>--version</code> in this section, the term information of commands makes a judicious use of the <code>sdocs</code> parameter of <a href="Cmdliner/Term/index.html#val-info"><code>Cmdliner.Term.info</code></a>.</p><p>The <code>help</code> command shows help about commands or other topics. The help shown for commands is generated by <code>Cmdliner</code> by making an appropriate use of <a href="Cmdliner/Term/index.html#val-ret"><code>Cmdliner.Term.ret</code></a> on the lifted <code>help</code> function.</p><p>If the program is invoked without a command we just want to show the help of the program as printed by <code>Cmdliner</code> with <code>--help</code>. This is done by the <code>default_cmd</code> term.</p><pre class="language-ocaml"><code>(* Implementations, just print the args. *)
|
||||
|
||||
type verb = Normal | Quiet | Verbose
|
||||
type copts = { debug : bool; verb : verb; prehook : string option }
|
||||
|
||||
let str = Printf.sprintf
|
||||
let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
|
||||
let opt_str_str = opt_str (fun s -> s)
|
||||
let verb_str = function
|
||||
| Normal -> "normal" | Quiet -> "quiet" | Verbose -> "verbose"
|
||||
|
||||
let pr_copts oc copts = Printf.fprintf oc
|
||||
"debug = %B\nverbosity = %s\nprehook = %s\n"
|
||||
copts.debug (verb_str copts.verb) (opt_str_str copts.prehook)
|
||||
|
||||
let initialize copts repodir = Printf.printf
|
||||
"%arepodir = %s\n" pr_copts copts repodir
|
||||
|
||||
let record copts name email all ask_deps files = Printf.printf
|
||||
"%aname = %s\nemail = %s\nall = %B\nask-deps = %B\nfiles = %s\n"
|
||||
pr_copts copts (opt_str_str name) (opt_str_str email) all ask_deps
|
||||
(String.concat ", " files)
|
||||
|
||||
let help copts man_format cmds topic = match topic with
|
||||
| None -> `Help (`Pager, None) (* help about the program. *)
|
||||
| Some topic ->
|
||||
let topics = "topics" :: "patterns" :: "environment" :: cmds in
|
||||
let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
|
||||
match conv topic with
|
||||
| `Error e -> `Error (false, e)
|
||||
| `Ok t when t = "topics" -> List.iter print_endline topics; `Ok ()
|
||||
| `Ok t when List.mem t cmds -> `Help (man_format, Some t)
|
||||
| `Ok t ->
|
||||
let page = (topic, 7, "", "", ""), [`S topic; `P "Say something";] in
|
||||
`Ok (Cmdliner.Manpage.print man_format Format.std_formatter page)
|
||||
|
||||
open Cmdliner
|
||||
|
||||
(* Help sections common to all commands *)
|
||||
|
||||
let help_secs = [
|
||||
`S Manpage.s_common_options;
|
||||
`P "These options are common to all commands.";
|
||||
`S "MORE HELP";
|
||||
`P "Use $(mname) $(i,COMMAND) --help for help on a single command.";`Noblank;
|
||||
`P "Use $(mname) $(b,help patterns) for help on patch matching."; `Noblank;
|
||||
`P "Use $(mname) $(b,help environment) for help on environment variables.";
|
||||
`S Manpage.s_bugs; `P "Check bug reports at http://bugs.example.org.";]
|
||||
|
||||
(* Options common to all commands *)
|
||||
|
||||
let copts debug verb prehook = { debug; verb; prehook }
|
||||
let copts_t =
|
||||
let docs = Manpage.s_common_options in
|
||||
let debug =
|
||||
let doc = "Give only debug output." in
|
||||
Arg.(value & flag & info ["debug"] ~docs ~doc)
|
||||
in
|
||||
let verb =
|
||||
let doc = "Suppress informational output." in
|
||||
let quiet = Quiet, Arg.info ["q"; "quiet"] ~docs ~doc in
|
||||
let doc = "Give verbose output." in
|
||||
let verbose = Verbose, Arg.info ["v"; "verbose"] ~docs ~doc in
|
||||
Arg.(last & vflag_all [Normal] [quiet; verbose])
|
||||
in
|
||||
let prehook =
|
||||
let doc = "Specify command to run before this $(mname) command." in
|
||||
Arg.(value & opt (some string) None & info ["prehook"] ~docs ~doc)
|
||||
in
|
||||
Term.(const copts $ debug $ verb $ prehook)
|
||||
|
||||
(* Commands *)
|
||||
|
||||
let sdocs = Manpage.s_common_options
|
||||
|
||||
let initialize_cmd =
|
||||
let repodir =
|
||||
let doc = "Run the program in repository directory $(docv)." in
|
||||
Arg.(value & opt file Filename.current_dir_name & info ["repodir"]
|
||||
~docv:"DIR" ~doc)
|
||||
in
|
||||
let doc = "make the current directory a repository" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "Turns the current directory into a Darcs repository. Any
|
||||
existing files and subdirectories become …";
|
||||
`Blocks help_secs; ]
|
||||
in
|
||||
let info = Cmd.info "initialize" ~doc ~sdocs ~man in
|
||||
Cmd.v info Term.(const initialize $ copts_t $ repodir)
|
||||
|
||||
let record_cmd =
|
||||
let pname =
|
||||
let doc = "Name of the patch." in
|
||||
Arg.(value & opt (some string) None & info ["m"; "patch-name"] ~docv:"NAME"
|
||||
~doc)
|
||||
in
|
||||
let author =
|
||||
let doc = "Specifies the author's identity." in
|
||||
Arg.(value & opt (some string) None & info ["A"; "author"] ~docv:"EMAIL"
|
||||
~doc)
|
||||
in
|
||||
let all =
|
||||
let doc = "Answer yes to all patches." in
|
||||
Arg.(value & flag & info ["a"; "all"] ~doc)
|
||||
in
|
||||
let ask_deps =
|
||||
let doc = "Ask for extra dependencies." in
|
||||
Arg.(value & flag & info ["ask-deps"] ~doc)
|
||||
in
|
||||
let files = Arg.(value & (pos_all file) [] & info [] ~docv:"FILE or DIR") in
|
||||
let doc = "create a patch from unrecorded changes" in
|
||||
let man =
|
||||
[`S Manpage.s_description;
|
||||
`P "Creates a patch from changes in the working tree. If you specify
|
||||
a set of files …";
|
||||
`Blocks help_secs; ]
|
||||
in
|
||||
let info = Cmd.info "record" ~doc ~sdocs ~man in
|
||||
Cmd.v info
|
||||
Term.(const record $ copts_t $ pname $ author $ all $ ask_deps $ files)
|
||||
|
||||
let help_cmd =
|
||||
let topic =
|
||||
let doc = "The topic to get help on. $(b,topics) lists the topics." in
|
||||
Arg.(value & pos 0 (some string) None & info [] ~docv:"TOPIC" ~doc)
|
||||
in
|
||||
let doc = "display help about darcs and darcs commands" in
|
||||
let man =
|
||||
[`S Manpage.s_description;
|
||||
`P "Prints help about darcs commands and other subjects…";
|
||||
`Blocks help_secs; ]
|
||||
in
|
||||
let info = Cmd.info "help" ~doc ~man in
|
||||
Cmd.v info
|
||||
Term.(ret (const help $ copts_t $ Arg.man_format $ Term.choice_names $
|
||||
topic))
|
||||
|
||||
let main_cmd =
|
||||
let doc = "a revision control system" in
|
||||
let man = help_secs in
|
||||
let info = Cmd.info "darcs" ~version:"v1.2.0" ~doc ~sdocs ~man in
|
||||
let default = Term.(ret (const (fun _ -> `Help (`Pager, None)) $ copts_t)) in
|
||||
Cmd.group info ~default [initialize_cmd; record_cmd; help_cmd]
|
||||
|
||||
let () = exit (Cmd.eval main_cmd)</code></pre></div></body></html>
|
||||
2
cmdliner/index.html
Normal file
2
cmdliner/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (cmdliner.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – cmdliner</nav><header class="odoc-preamble"><h1 id="package-cmdliner"><a href="#package-cmdliner" class="anchor"></a>Package cmdliner <nav><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">changes</a> <a href="#package_info">more…</a></nav></h1><p><code>Cmdliner</code> provides a simple and compositional mechanism to convert command line arguments to OCaml values and pass them to your functions.</p><p>The library automatically handles syntax errors, help messages and UNIX man page generation. It supports programs with single or multiple commands (like <code>git</code>) and respect most of the <a href="http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html">POSIX</a> and <a href="http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html">GNU</a> conventions.</p></header><nav class="odoc-toc"><ul><li><a href="#manuals">Manuals</a></li><li><a href="#api">API</a></li><li><a href="#package_info">Package info</a></li></ul></nav><div class="odoc-content"><h2 id="manuals"><a href="#manuals" class="anchor"></a>Manuals</h2><p>The following manuals are available.</p><ul><li>The <a href="tutorial.html" title="tutorial">tutorial</a> gets you through the steps to write your first command line interface with Cmdliner.</li><li>The <a href="cli.html" title="cli">Command line interface manual</a> describes how command lines and environment variables are parsed by Cmdliner.</li><li><a href="tool_man.html" title="tool_man">Tool man pages</a> describes how Cmdliner generates man pages for your tools and how you can format them.</li><li>The <a href="examples.html" title="examples">examples page</a> has a few annoted examples that show to express the command line interface of a few classic tools with Cmdliner</li></ul><h2 id="api"><a href="#api" class="anchor"></a>API</h2><ul class="modules"><li><a href="Cmdliner/index.html"><code>Cmdliner</code></a> <span class="synopsis">Declarative definition of command line interfaces.</span></li></ul><h2 id="package_info"><a href="#package_info" class="anchor"></a>Package info</h2><table class="package info"><tr id="info-changes-files"><td><a href="#info-changes-files" aria-hidden="true" class="anchor"></a>changes-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">CHANGES.md</a></li></ul></td></tr><tr id="info-license-files"><td><a href="#info-license-files" aria-hidden="true" class="anchor"></a>license-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/LICENSE.md">LICENSE.md</a></li></ul></td></tr><tr id="info-readme-files"><td><a href="#info-readme-files" aria-hidden="true" class="anchor"></a>readme-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/README.md">README.md</a></li></ul></td></tr></table></div></body></html>
|
||||
2
cmdliner/tool_man.html
Normal file
2
cmdliner/tool_man.html
Normal file
File diff suppressed because one or more lines are too long
67
cmdliner/tutorial.html
Normal file
67
cmdliner/tutorial.html
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>tutorial (cmdliner.tutorial)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../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">cmdliner</a> » tutorial</nav><header class="odoc-preamble"><h1 id="tutorial"><a href="#tutorial" class="anchor"></a>Tutorial</h1></header><nav class="odoc-toc"><ul><li><a href="#started">Getting started</a></li><li><a href="#subcommands">Sub commands</a></li></ul></nav><div class="odoc-content"><h2 id="started"><a href="#started" class="anchor"></a>Getting started</h2><p>With <code>Cmdliner</code> your tool's <code>main</code> function evaluates a command.</p><p>A command is a value of type <a href="Cmdliner/Cmd/index.html#type-t"><code>Cmdliner.Cmd.t</code></a> which gathers a command name and a term of type <a href="Cmdliner/Term/index.html#type-t"><code>Cmdliner.Term.t</code></a>. A term is an expression to be evaluated. The type parameter of the term (and the command) indicates the type of the result of the evaluation.</p><p>One way to create terms is by lifting regular OCaml values with <a href="Cmdliner/Term/index.html#val-const"><code>Cmdliner.Term.const</code></a>. Terms can be applied to terms evaluating to functional values with <a href="Cmdliner/Term/index.html#val-($)"><code>Cmdliner.Term.($)</code></a>.</p><p>For example, in a <code>revolt.ml</code> file, for the function:</p><pre class="language-ocaml"><code>let revolt () = print_endline "Revolt!"</code></pre><p>the term :</p><pre class="language-ocaml"><code>open Cmdliner
|
||||
|
||||
let revolt_t = Term.(const revolt $ const ())</code></pre><p>is a term that evaluates to the result (and effect) of the <code>revolt</code> function. This term can be attached to a command:</p><pre class="language-ocaml"><code>let cmd = Cmd.v (Cmd.info "revolt") revolt_t</code></pre><p>and evaluated with <a href="Cmdliner/Cmd/index.html#val-eval"><code>Cmdliner.Cmd.eval</code></a>:</p><pre class="language-ocaml"><code>let () = exit (Cmd.eval cmd)</code></pre><p>This defines a command line tool named <code>"revolt"</code> (this name will be used in error reporting and documentation generation), without command line arguments, that just prints <code>"Revolt!"</code> on <code>stdout</code>.</p><pre class="language-ocaml"><code>> ocamlfind ocamlopt -linkpkg -package cmdliner -o revolt revolt.ml
|
||||
> ./revolt
|
||||
Revolt!</code></pre><p>The combinators in the <a href="Cmdliner/Arg/index.html"><code>Cmdliner.Arg</code></a> module allow to extract command line arguments as terms. These terms can then be applied to lifted OCaml functions to be evaluated.</p><p>Terms corresponding to command line argument data that are part of a term evaluation implicitly define a command line syntax. We show this on an concrete example.</p><p>In a <code>chorus.ml</code> file, consider the <code>chorus</code> function that prints repeatedly a given message :</p><pre class="language-ocaml"><code>let chorus count msg = for i = 1 to count do print_endline msg done</code></pre><p>we want to make it available from the command line with the synopsis:</p><pre class="language-ocaml"><code>chorus [-c COUNT | --count=COUNT] [MSG]</code></pre><p>where <code>COUNT</code> defaults to <code>10</code> and <code>MSG</code> defaults to <code>"Revolt!"</code>. We first define a term corresponding to the <code>--count</code> option:</p><pre class="language-ocaml"><code>let count =
|
||||
let doc = "Repeat the message $(docv) times." in
|
||||
Arg.(value & opt int 10 & info ["c"; "count"] ~docv:"COUNT" ~doc)</code></pre><p>This says that <code>count</code> is a term that evaluates to the value of an optional argument of type <code>int</code> that defaults to <code>10</code> if unspecified and whose option name is either <code>-c</code> or <code>--count</code>. The arguments <code>doc</code> and <code>docv</code> are used to generate the option's man page information.</p><p>The term for the positional argument <code>MSG</code> is:</p><pre class="language-ocaml"><code>let msg =
|
||||
let env =
|
||||
let doc = "Overrides the default message to print." in
|
||||
Cmd.Env.info "CHORUS_MSG" ~doc
|
||||
in
|
||||
let doc = "The message to print." in
|
||||
Arg.(value & pos 0 string "Revolt!" & info [] ~env ~docv:"MSG" ~doc)</code></pre><p>which says that <code>msg</code> is a term whose value is the positional argument at index <code>0</code> of type <code>string</code> and defaults to <code>"Revolt!"</code> or the value of the environment variable <code>CHORUS_MSG</code> if the argument is unspecified on the command line. Here again <code>doc</code> and <code>docv</code> are used for the man page information.</p><p>The term for executing <code>chorus</code> with these command line arguments is :</p><pre class="language-ocaml"><code>let chorus_t = Term.(const chorus $ count $ msg)</code></pre><p>We are now ready to define the <code>main</code> function of our tool:</p><pre class="language-ocaml"><code>let cmd =
|
||||
let doc = "print a customizable message repeatedly" in
|
||||
let man = [
|
||||
`S Manpage.s_bugs;
|
||||
`P "Email bug reports to <bugs@example.org>." ]
|
||||
in
|
||||
let info = Cmd.info "chorus" ~version:"%%VERSION%%" ~doc ~man in
|
||||
Cmd.v info chorus_t
|
||||
|
||||
let main () = exit (Cmd.eval cmd)
|
||||
let () = main ()</code></pre><p>The <code>info</code> value created with <a href="Cmdliner/Cmd/index.html#val-info"><code>Cmdliner.Cmd.info</code></a> gives more information about the term we execute and is used to generate the tool's man page. Since we provided a <code>~version</code> string, the tool will automatically respond to the <code>--version</code> option by printing this string.</p><p>A tool using <a href="Cmdliner/Cmd/index.html#val-eval"><code>Cmdliner.Cmd.eval</code></a> always responds to the <code>--help</code> option by showing the tool's man page generated using the information you provided with <a href="Cmdliner/Cmd/index.html#val-info"><code>Cmdliner.Cmd.info</code></a> and <a href="Cmdliner/Arg/index.html#val-info"><code>Cmdliner.Arg.info</code></a>. Here is the output generated by our example:</p><pre>> ocamlfind ocamlopt -linkpkg -package cmdliner -o chorus chorus.ml
|
||||
> ./chorus --help
|
||||
NAME
|
||||
chorus - Print a customizable message repeatedly
|
||||
|
||||
SYNOPSIS
|
||||
chorus [--count=COUNT] [OPTION]… [MSG]
|
||||
|
||||
ARGUMENTS
|
||||
MSG (absent=Revolt! or CHORUS_MSG env)
|
||||
The message to print.
|
||||
|
||||
OPTIONS
|
||||
-c COUNT, --count=COUNT (absent=10)
|
||||
Repeat the message COUNT times.
|
||||
|
||||
COMMON OPTIONS
|
||||
--help[=FMT] (default=auto)
|
||||
Show this help in format FMT. The value FMT must be one of auto,
|
||||
pager, groff or plain. With auto, the format is pager or plain
|
||||
whenever the TERM env var is dumb or undefined.
|
||||
|
||||
--version
|
||||
Show version information.
|
||||
|
||||
EXIT STATUS
|
||||
chorus exits with the following status:
|
||||
|
||||
0 on success.
|
||||
|
||||
123 on indiscriminate errors reported on standard error.
|
||||
|
||||
124 on command line parsing errors.
|
||||
|
||||
125 on unexpected internal errors (bugs).
|
||||
|
||||
ENVIRONMENT
|
||||
These environment variables affect the execution of chorus:
|
||||
|
||||
CHORUS_MSG
|
||||
Overrides the default message to print.
|
||||
|
||||
BUGS
|
||||
Email bug reports to <bugs@example.org>.</pre><p>If a pager is available, this output is written to a pager. This help is also available in plain text or in the <a href="http://www.gnu.org/software/groff/groff.html">groff</a> man page format by invoking the program with the option <code>--help=plain</code> or <code>--help=groff</code>.</p><p>For examples of more complex command line definitions look and run the <a href="examples.html" title="examples">examples</a>.</p><h2 id="subcommands"><a href="#subcommands" class="anchor"></a>Sub commands</h2><p><code>Cmdliner</code> also provides support for programs like <code>git</code> that have sub commands each with their own command line syntax and manual:</p><pre class="language-ocaml"><code>tool [COMMAND]… [OPTION]… ARG…</code></pre><p>These sub commands are defined by grouping them under a parent command via the <a href="Cmdliner/Cmd/index.html#val-group"><code>Cmdliner.Cmd.group</code></a> function.</p></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,20 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>index</title>
|
||||
<link rel="stylesheet" href="./odoc.css"/>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
||||
</head>
|
||||
<body>
|
||||
<main class="content">
|
||||
<div class="by-name">
|
||||
<h2>OCaml package documentation</h2>
|
||||
<ol>
|
||||
<li><a href="linol/index.html">linol</a> <span class="version">0.1</span></li>
|
||||
<li><a href="linol-lwt/index.html">linol-lwt</a> <span class="version">0.1</span></li>
|
||||
</ol>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (linol-lwt.Linol_lwt.Jsonrpc2.IO)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt</a> » <a href="../index.html">Jsonrpc2</a> » IO</nav><h1>Module <code>Jsonrpc2.IO</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code><code> = <span class="type-var">'a</span> <a href="../../Task/index.html#type-m">Task.m</a></code></dt></dl><dl><dt class="spec value" id="val-return"><a href="#val-return" class="anchor"></a><code><span class="keyword">val</span> return : <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-failwith"><a href="#val-failwith" class="anchor"></a><code><span class="keyword">val</span> failwith : string <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-in_channel"><a href="#type-in_channel" class="anchor"></a><code><span class="keyword">type</span> in_channel</code><code> = Lwt_io.input Lwt_io.channel</code></dt><dt class="spec type" id="type-out_channel"><a href="#type-out_channel" class="anchor"></a><code><span class="keyword">type</span> out_channel</code><code> = Lwt_io.output Lwt_io.channel</code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>base_server (linol-lwt.Linol_lwt.Jsonrpc2.base_server)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt</a> » <a href="../index.html">Jsonrpc2</a> » base_server</nav><h1>Class <code>Jsonrpc2.base_server</code></h1></header><dl><dt class="spec method" id="method-must_quit"><a href="#method-must_quit" class="anchor"></a><code><span class="keyword">method</span> must_quit : bool</code></dt><dt class="spec method" id="method-on_notification"><a href="#method-on_notification" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_notification : notify_back:(Lsp.Server_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a>) <span>-></span> Lsp.Client_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-on_request"><a href="#method-on_request" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_request : a. <span class="type-var">'a</span> Lsp.Client_request.t <span>-></span> <span class="type-var">'a</span> <a href="../IO/index.html#type-t">IO.t</a></code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>notify_back (linol-lwt.Linol_lwt.Jsonrpc2.notify_back)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt</a> » <a href="../index.html">Jsonrpc2</a> » notify_back</nav><h1>Class <code>Jsonrpc2.notify_back</code></h1></header><dl><dt class="spec method" id="method-send_diagnostic"><a href="#method-send_diagnostic" class="anchor"></a><code><span class="keyword">method</span> send_diagnostic : Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-send_log_msg"><a href="#method-send_log_msg" class="anchor"></a><code><span class="keyword">method</span> send_log_msg : type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-send_notification"><a href="#method-send_notification" class="anchor"></a><code><span class="keyword">method</span> send_notification : Lsp.Server_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Infix (linol-lwt.Linol_lwt.Task.Infix)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt</a> » <a href="../index.html">Task</a> » Infix</nav><h1>Module <code>Task.Infix</code></h1></header><dl><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-(>|=)"><a href="#val-(>|=)" class="anchor"></a><code><span class="keyword">val</span> (>|=) : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-(>>=)"><a href="#val-(>>=)" class="anchor"></a><code><span class="keyword">val</span> (>>=) : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="../index.html#type-m">m</a></code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Wrapped_error (linol-lwt.Linol_lwt.Task.Wrapped_error)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt</a> » <a href="../index.html">Task</a> » Wrapped_error</nav><h1>Module <code>Task.Wrapped_error</code></h1></header><dl><dt class="spec type" id="type-task"><a href="#type-task" class="anchor"></a><code><span class="keyword">type</span> 'a task</code><code> = <span class="type-var">'a</span> <a href="../index.html#type-t">t</a></code></dt><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = </code><table class="variant"><tr id="type-t.E" class="anchored"><td class="def constructor"><a href="#type-t.E" class="anchor"></a><code>| </code><code><span class="constructor">E</span> : </code><code>{</code><table class="record"><tr id="type-t.task" class="anchored"><td class="def field"><a href="#type-t.task" class="anchor"></a><code>task : <span class="type-var">'a</span> <a href="index.html#type-task">task</a>;</code></td></tr><tr id="type-t.e" class="anchored"><td class="def field"><a href="#type-t.e" class="anchor"></a><code>e : exn;</code></td></tr></table><code>}</code><code> <span>-></span> <a href="index.html#type-t">t</a></code></td></tr></table></dt></dl><dl><dt class="spec exception" id="exception-Wrapped"><a href="#exception-Wrapped" class="anchor"></a><code><span class="keyword">exception</span> </code><code><span class="exception">Wrapped</span> <span class="keyword">of</span> <a href="index.html#type-t">t</a></code></dt><dd><p>An exception caught and re-launched from a task</p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (linol-lwt.Linol_lwt.IO)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol-lwt</a> » <a href="../index.html">Linol_lwt</a> » IO</nav><h1>Module type <code>Linol_lwt.IO</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code></dt></dl><dl><dt class="spec value" id="val-return"><a href="#val-return" class="anchor"></a><code><span class="keyword">val</span> return : <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-failwith"><a href="#val-failwith" class="anchor"></a><code><span class="keyword">val</span> failwith : string <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-in_channel"><a href="#type-in_channel" class="anchor"></a><code><span class="keyword">type</span> in_channel</code></dt><dt class="spec type" id="type-out_channel"><a href="#type-out_channel" class="anchor"></a><code><span class="keyword">type</span> out_channel</code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (linol-lwt.Linol_lwt__.Jsonrpc2.IO)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt__</a> » <a href="../index.html">Jsonrpc2</a> » IO</nav><h1>Module <code>Jsonrpc2.IO</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code><code> = <span class="type-var">'a</span> <a href="../../../Linol_lwt/Task/index.html#type-m">Linol_lwt.Task.m</a></code></dt></dl><dl><dt class="spec value" id="val-return"><a href="#val-return" class="anchor"></a><code><span class="keyword">val</span> return : <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-failwith"><a href="#val-failwith" class="anchor"></a><code><span class="keyword">val</span> failwith : string <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-in_channel"><a href="#type-in_channel" class="anchor"></a><code><span class="keyword">type</span> in_channel</code><code> = Lwt_io.input Lwt_io.channel</code></dt><dt class="spec type" id="type-out_channel"><a href="#type-out_channel" class="anchor"></a><code><span class="keyword">type</span> out_channel</code><code> = Lwt_io.output Lwt_io.channel</code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>base_server (linol-lwt.Linol_lwt__.Jsonrpc2.base_server)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt__</a> » <a href="../index.html">Jsonrpc2</a> » base_server</nav><h1>Class <code>Jsonrpc2.base_server</code></h1></header><dl><dt class="spec method" id="method-must_quit"><a href="#method-must_quit" class="anchor"></a><code><span class="keyword">method</span> must_quit : bool</code></dt><dt class="spec method" id="method-on_notification"><a href="#method-on_notification" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_notification : notify_back:(Lsp.Server_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a>) <span>-></span> Lsp.Client_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-on_request"><a href="#method-on_request" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_request : a. <span class="type-var">'a</span> Lsp.Client_request.t <span>-></span> <span class="type-var">'a</span> <a href="../IO/index.html#type-t">IO.t</a></code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>notify_back (linol-lwt.Linol_lwt__.Jsonrpc2.notify_back)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt__</a> » <a href="../index.html">Jsonrpc2</a> » notify_back</nav><h1>Class <code>Jsonrpc2.notify_back</code></h1></header><dl><dt class="spec method" id="method-send_diagnostic"><a href="#method-send_diagnostic" class="anchor"></a><code><span class="keyword">method</span> send_diagnostic : Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-send_log_msg"><a href="#method-send_log_msg" class="anchor"></a><code><span class="keyword">method</span> send_log_msg : type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-send_notification"><a href="#method-send_notification" class="anchor"></a><code><span class="keyword">method</span> send_notification : Lsp.Server_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Infix (linol-lwt.Linol_lwt__.Task.Infix)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt__</a> » <a href="../index.html">Task</a> » Infix</nav><h1>Module <code>Task.Infix</code></h1></header><dl><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-(>|=)"><a href="#val-(>|=)" class="anchor"></a><code><span class="keyword">val</span> (>|=) : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-(>>=)"><a href="#val-(>>=)" class="anchor"></a><code><span class="keyword">val</span> (>>=) : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="../index.html#type-m">m</a></code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Wrapped_error (linol-lwt.Linol_lwt__.Task.Wrapped_error)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol-lwt</a> » <a href="../../index.html">Linol_lwt__</a> » <a href="../index.html">Task</a> » Wrapped_error</nav><h1>Module <code>Task.Wrapped_error</code></h1></header><dl><dt class="spec type" id="type-task"><a href="#type-task" class="anchor"></a><code><span class="keyword">type</span> 'a task</code><code> = <span class="type-var">'a</span> <a href="../index.html#type-t">t</a></code></dt><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = </code><table class="variant"><tr id="type-t.E" class="anchored"><td class="def constructor"><a href="#type-t.E" class="anchor"></a><code>| </code><code><span class="constructor">E</span> : </code><code>{</code><table class="record"><tr id="type-t.task" class="anchored"><td class="def field"><a href="#type-t.task" class="anchor"></a><code>task : <span class="type-var">'a</span> <a href="index.html#type-task">task</a>;</code></td></tr><tr id="type-t.e" class="anchored"><td class="def field"><a href="#type-t.e" class="anchor"></a><code>e : exn;</code></td></tr></table><code>}</code><code> <span>-></span> <a href="index.html#type-t">t</a></code></td></tr></table></dt></dl><dl><dt class="spec exception" id="exception-Wrapped"><a href="#exception-Wrapped" class="anchor"></a><code><span class="keyword">exception</span> </code><code><span class="exception">Wrapped</span> <span class="keyword">of</span> <a href="index.html#type-t">t</a></code></dt><dd><p>An exception caught and re-launched from a task</p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Linol_lwt__ (linol-lwt.Linol_lwt__)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../index.html">linol-lwt</a> » Linol_lwt__</nav><h1>Module <code>Linol_lwt__</code></h1></header><dl><dt class="spec module" id="module-Jsonrpc2"><a href="#module-Jsonrpc2" class="anchor"></a><code><span class="keyword">module</span> <a href="Jsonrpc2/index.html">Jsonrpc2</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd></dd></dl><dl><dt class="spec module" id="module-Task"><a href="#module-Task" class="anchor"></a><code><span class="keyword">module</span> <a href="Task/index.html">Task</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd></dd></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (linol-lwt.Linol_lwt__Jsonrpc2.IO)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol-lwt</a> » <a href="../index.html">Linol_lwt__Jsonrpc2</a> » IO</nav><h1>Module <code>Linol_lwt__Jsonrpc2.IO</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code><code> = <span class="type-var">'a</span> <a href="../../Linol_lwt/Task/index.html#type-m">Linol_lwt.Task.m</a></code></dt></dl><dl><dt class="spec value" id="val-return"><a href="#val-return" class="anchor"></a><code><span class="keyword">val</span> return : <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-failwith"><a href="#val-failwith" class="anchor"></a><code><span class="keyword">val</span> failwith : string <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-in_channel"><a href="#type-in_channel" class="anchor"></a><code><span class="keyword">type</span> in_channel</code><code> = Lwt_io.input Lwt_io.channel</code></dt><dt class="spec type" id="type-out_channel"><a href="#type-out_channel" class="anchor"></a><code><span class="keyword">type</span> out_channel</code><code> = Lwt_io.output Lwt_io.channel</code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>base_server (linol-lwt.Linol_lwt__Jsonrpc2.base_server)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol-lwt</a> » <a href="../index.html">Linol_lwt__Jsonrpc2</a> » base_server</nav><h1>Class <code>Linol_lwt__Jsonrpc2.base_server</code></h1></header><dl><dt class="spec method" id="method-must_quit"><a href="#method-must_quit" class="anchor"></a><code><span class="keyword">method</span> must_quit : bool</code></dt><dt class="spec method" id="method-on_notification"><a href="#method-on_notification" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_notification : notify_back:(Lsp.Server_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a>) <span>-></span> Lsp.Client_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-on_request"><a href="#method-on_request" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_request : a. <span class="type-var">'a</span> Lsp.Client_request.t <span>-></span> <span class="type-var">'a</span> <a href="../IO/index.html#type-t">IO.t</a></code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>notify_back (linol-lwt.Linol_lwt__Jsonrpc2.notify_back)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol-lwt</a> » <a href="../index.html">Linol_lwt__Jsonrpc2</a> » notify_back</nav><h1>Class <code>Linol_lwt__Jsonrpc2.notify_back</code></h1></header><dl><dt class="spec method" id="method-send_diagnostic"><a href="#method-send_diagnostic" class="anchor"></a><code><span class="keyword">method</span> send_diagnostic : Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-send_log_msg"><a href="#method-send_log_msg" class="anchor"></a><code><span class="keyword">method</span> send_log_msg : type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-send_notification"><a href="#method-send_notification" class="anchor"></a><code><span class="keyword">method</span> send_notification : Lsp.Server_notification.t <span>-></span> unit <a href="../IO/index.html#type-t">IO.t</a></code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Infix (linol-lwt.Linol_lwt__Task.Infix)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol-lwt</a> » <a href="../index.html">Linol_lwt__Task</a> » Infix</nav><h1>Module <code>Linol_lwt__Task.Infix</code></h1></header><dl><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-(>|=)"><a href="#val-(>|=)" class="anchor"></a><code><span class="keyword">val</span> (>|=) : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-(>>=)"><a href="#val-(>>=)" class="anchor"></a><code><span class="keyword">val</span> (>>=) : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a>) <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="../index.html#type-m">m</a> <span>-></span> <span class="type-var">'b</span> <a href="../index.html#type-m">m</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="../index.html#type-m">m</a></code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Wrapped_error (linol-lwt.Linol_lwt__Task.Wrapped_error)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol-lwt</a> » <a href="../index.html">Linol_lwt__Task</a> » Wrapped_error</nav><h1>Module <code>Linol_lwt__Task.Wrapped_error</code></h1></header><dl><dt class="spec type" id="type-task"><a href="#type-task" class="anchor"></a><code><span class="keyword">type</span> 'a task</code><code> = <span class="type-var">'a</span> <a href="../index.html#type-t">t</a></code></dt><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = </code><table class="variant"><tr id="type-t.E" class="anchored"><td class="def constructor"><a href="#type-t.E" class="anchor"></a><code>| </code><code><span class="constructor">E</span> : </code><code>{</code><table class="record"><tr id="type-t.task" class="anchored"><td class="def field"><a href="#type-t.task" class="anchor"></a><code>task : <span class="type-var">'a</span> <a href="index.html#type-task">task</a>;</code></td></tr><tr id="type-t.e" class="anchored"><td class="def field"><a href="#type-t.e" class="anchor"></a><code>e : exn;</code></td></tr></table><code>}</code><code> <span>-></span> <a href="index.html#type-t">t</a></code></td></tr></table></dt></dl><dl><dt class="spec exception" id="exception-Wrapped"><a href="#exception-Wrapped" class="anchor"></a><code><span class="keyword">exception</span> </code><code><span class="exception">Wrapped</span> <span class="keyword">of</span> <a href="index.html#type-t">t</a></code></dt><dd><p>An exception caught and re-launched from a task</p></dd></dl><dl><dt class="spec value" id="val-pp"><a href="#val-pp" class="anchor"></a><code><span class="keyword">val</span> pp : Stdlib.Format.formatter <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> unit</code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (linol-lwt.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – linol-lwt</nav></header><h1 id="linol-lwt-index"><a href="#linol-lwt-index" class="anchor"></a>linol-lwt index</h1><h2 id="library-linol-lwt"><a href="#library-linol-lwt" class="anchor"></a>Library linol-lwt</h2><p>The entry point of this library is the module: <a href="Linol_lwt/index.html"><code>Linol_lwt</code></a>.</p></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>1-IO (linol.Linol.Make.1-IO)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol</a> » <a href="../../index.html">Linol</a> » <a href="../index.html">Make</a> » 1-IO</nav><h1>Parameter <code>Make.1-IO</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code></dt></dl><dl><dt class="spec value" id="val-return"><a href="#val-return" class="anchor"></a><code><span class="keyword">val</span> return : <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-failwith"><a href="#val-failwith" class="anchor"></a><code><span class="keyword">val</span> failwith : string <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-in_channel"><a href="#type-in_channel" class="anchor"></a><code><span class="keyword">type</span> in_channel</code></dt><dt class="spec type" id="type-out_channel"><a href="#type-out_channel" class="anchor"></a><code><span class="keyword">type</span> out_channel</code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>base_server (linol.Linol.Make.base_server)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol</a> » <a href="../../index.html">Linol</a> » <a href="../index.html">Make</a> » base_server</nav><h1>Class <code>Make.base_server</code></h1><p>The server baseclass</p></header><dl><dt class="spec method" id="method-on_notification"><a href="#method-on_notification" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_notification : notify_back:(Lsp.Server_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>) <span>-></span> Lsp.Client_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-on_request"><a href="#method-on_request" class="anchor"></a><code><span class="keyword">method</span> <span class="keyword">virtual</span> on_request : a. <span class="type-var">'a</span> Lsp.Client_request.t <span>-></span> <span class="type-var">'a</span> <a href="../argument-1-IO/index.html#type-t">IO.t</a></code></dt><dt class="spec method" id="method-must_quit"><a href="#method-must_quit" class="anchor"></a><code><span class="keyword">method</span> must_quit : < must_quit : bool; on_notification : notify_back:(Lsp.Server_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>) <span>-></span> Lsp.Client_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; on_request : a. <span class="type-var">'a</span> Lsp.Client_request.t <span>-></span> <span class="type-var">'a</span> <a href="../argument-1-IO/index.html#type-t">IO.t</a>; .. > <span>-></span> bool</code></dt><dd><p>Set to true if the client requested to exit</p></dd></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>notify_back (linol.Linol.Make.notify_back)</title><link rel="stylesheet" href="../../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../../index.html">linol</a> » <a href="../../index.html">Linol</a> » <a href="../index.html">Make</a> » notify_back</nav><h1>Class <code>Make.notify_back</code></h1><p>A wrapper to more easily reply to notifications</p></header><dl><dt class="spec method" id="method-send_log_msg"><a href="#method-send_log_msg" class="anchor"></a><code><span class="keyword">method</span> send_log_msg : < send_diagnostic : Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; send_log_msg : type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; send_notification : Lsp.Server_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; .. > <span>-></span> type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a></code></dt><dd><p>Send a log message to the editor</p></dd></dl><dl><dt class="spec method" id="method-send_diagnostic"><a href="#method-send_diagnostic" class="anchor"></a><code><span class="keyword">method</span> send_diagnostic : < send_diagnostic : Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; send_log_msg : type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; send_notification : Lsp.Server_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; .. > <span>-></span> Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a></code></dt><dd><p>Send diagnostics for the current document</p></dd></dl><dl><dt class="spec method" id="method-send_notification"><a href="#method-send_notification" class="anchor"></a><code><span class="keyword">method</span> send_notification : < send_diagnostic : Lsp.Types.Diagnostic.t list <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; send_log_msg : type_:Lsp__Types.MessageType.t <span>-></span> string <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; send_notification : Lsp.Server_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a>; .. > <span>-></span> Lsp.Server_notification.t <span>-></span> unit <a href="../argument-1-IO/index.html#type-t">IO.t</a></code></dt><dd><p>Send a notification (general purpose method)</p></dd></dl></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (linol.Linol.Make)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol</a> » <a href="../index.html">Linol</a> » Make</nav><h1>Module <code>Linol.Make</code></h1><h3 id="server-interface-for-some-io-substrate"><a href="#server-interface-for-some-io-substrate" class="anchor"></a>Server interface for some IO substrate</h3></header><h3 class="heading">Parameters</h3><ul><li><code><a href="argument-1-IO/index.html">IO</a> : <a href="../index.html#module-type-IO">IO</a></code></li></ul><h3 class="heading">Signature</h3><div class="spec module" id="module-Position"><a href="#module-Position" class="anchor"></a><code><span class="keyword">module</span> Position = Lsp.Types.Position</code></div><div class="spec module" id="module-Range"><a href="#module-Range" class="anchor"></a><code><span class="keyword">module</span> Range = Lsp.Types.Range</code></div><dl><dt class="spec class" id="class-base_server"><a href="#class-base_server" class="anchor"></a><code><span class="keyword">class</span> <span class="keyword">virtual</span> <a href="class-base_server/index.html">base_server</a> : <span class="keyword">object</span> ... <span class="keyword">end</span></code></dt><dd><p>The server baseclass</p></dd></dl><dl><dt class="spec class" id="class-notify_back"><a href="#class-notify_back" class="anchor"></a><code><span class="keyword">class</span> <a href="class-notify_back/index.html">notify_back</a> : notify_back:(Lsp.Server_notification.t <span>-></span> unit <a href="argument-1-IO/index.html#type-t">IO.t</a>) <span>-></span> ?⁠version:int option <span>-></span> uri:Lsp.Types.DocumentUri.t <span>-></span> unit <span>-></span> <span class="keyword">object</span> ... <span class="keyword">end</span></code></dt><dd><p>A wrapper to more easily reply to notifications</p></dd></dl><dl><dt class="spec type" id="type-doc_state"><a href="#type-doc_state" class="anchor"></a><code><span class="keyword">type</span> doc_state</code><code> = </code><code>{</code><table class="record"><tr id="type-doc_state.uri" class="anchored"><td class="def field"><a href="#type-doc_state.uri" class="anchor"></a><code>uri : Lsp.Types.DocumentUri.t;</code></td></tr><tr id="type-doc_state.languageId" class="anchored"><td class="def field"><a href="#type-doc_state.languageId" class="anchor"></a><code>languageId : string;</code></td></tr><tr id="type-doc_state.version" class="anchored"><td class="def field"><a href="#type-doc_state.version" class="anchor"></a><code>version : int;</code></td></tr><tr id="type-doc_state.content" class="anchored"><td class="def field"><a href="#type-doc_state.content" class="anchor"></a><code>content : string;</code></td></tr></table><code>}</code></dt><dd><p>Current state of a document.</p></dd></dl><dl><dt class="spec class" id="class-server"><a href="#class-server" class="anchor"></a><code><span class="keyword">class</span> <span class="keyword">virtual</span> <a href="class-server/index.html">server</a> : <span class="keyword">object</span> ... <span class="keyword">end</span></code></dt><dd><p>An easily overloadable class. Pick the methods you want to support. The user must provide at least the callbacks for document lifecycle: open, close, update. The most basic LSP server should check documents when they're updated and report diagnostics back to the editor.</p></dd></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Linol (linol.Linol)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../index.html">linol</a> » Linol</nav><h1>Module <code>Linol</code></h1><h2 id="linol"><a href="#linol" class="anchor"></a>Linol</h2><p>Abstraction over The "Lsp" library, to make it easier to develop LSP servers in OCaml (but not necessarily <b>for</b> OCaml).</p></header><dl><dt class="spec module-type" id="module-type-IO"><a href="#module-type-IO" class="anchor"></a><code><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-IO/index.html">IO</a> = <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd></dd></dl><dl><dt class="spec module" id="module-Make"><a href="#module-Make" class="anchor"></a><code><span class="keyword">module</span> <a href="Make/index.html">Make</a> : <span class="keyword">functor</span> (<a href="Make/argument-1-IO/index.html">IO</a> : <a href="index.html#module-type-IO">IO</a>) <span>-></span> <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd></dd></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (linol.Linol.IO)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">linol</a> » <a href="../index.html">Linol</a> » IO</nav><h1>Module type <code>Linol.IO</code></h1><h3 id="parametrized-io-interface"><a href="#parametrized-io-interface" class="anchor"></a>Parametrized IO Interface</h3></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> 'a t</code></dt></dl><dl><dt class="spec value" id="val-return"><a href="#val-return" class="anchor"></a><code><span class="keyword">val</span> return : <span class="type-var">'a</span> <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-failwith"><a href="#val-failwith" class="anchor"></a><code><span class="keyword">val</span> failwith : string <span>-></span> <span class="type-var">'a</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let+"><a href="#val-let+" class="anchor"></a><code><span class="keyword">val</span> let+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-let*"><a href="#val-let*" class="anchor"></a><code><span class="keyword">val</span> let* : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a>) <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-and+"><a href="#val-and+" class="anchor"></a><code><span class="keyword">val</span> and+ : <span class="type-var">'a</span> <a href="index.html#type-t">t</a> <span>-></span> <span class="type-var">'b</span> <a href="index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> * <span class="type-var">'b</span>) <a href="index.html#type-t">t</a></code></dt></dl><dl><dt class="spec type" id="type-in_channel"><a href="#type-in_channel" class="anchor"></a><code><span class="keyword">type</span> in_channel</code></dt><dt class="spec type" id="type-out_channel"><a href="#type-out_channel" class="anchor"></a><code><span class="keyword">type</span> out_channel</code></dt></dl></div></body></html>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (linol.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – linol</nav></header><h1 id="linol-index"><a href="#linol-index" class="anchor"></a>linol index</h1><h2 id="library-linol"><a href="#library-linol" class="anchor"></a>Library linol</h2><p>The entry point of this library is the module: <a href="Linol/index.html"><code>Linol</code></a>.</p></div></body></html>
|
||||
764
dev/odoc.css
764
dev/odoc.css
|
|
@ -1,764 +0,0 @@
|
|||
@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 1.4.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');
|
||||
|
||||
|
||||
/* Reset a few things. */
|
||||
|
||||
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: inherit;
|
||||
font: inherit;
|
||||
line-height: inherit;
|
||||
vertical-align: baseline;
|
||||
text-align: inherit;
|
||||
color: inherit;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
*, *:before, *:after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Fira Sans", Helvetica, Arial, sans-serif;
|
||||
text-align: left;
|
||||
color: #333;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: 90ex;
|
||||
margin-left: calc(10vw + 20ex);
|
||||
margin-right: 4ex;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 50px;
|
||||
font-family: "Noticia Text", Georgia, serif;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.content>header {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.content>header nav {
|
||||
font-family: "Fira Sans", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* Basic markup elements */
|
||||
|
||||
b, strong {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
i, em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
sup {
|
||||
vertical-align: super;
|
||||
}
|
||||
|
||||
sub {
|
||||
vertical-align: sub;
|
||||
}
|
||||
|
||||
sup, sub {
|
||||
font-size: 12px;
|
||||
line-height: 0;
|
||||
margin-left: 0.2ex;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
|
||||
p, ul, ol {
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
ul, ol {
|
||||
list-style-position: outside
|
||||
}
|
||||
|
||||
ul>li {
|
||||
margin-left: 22px;
|
||||
}
|
||||
|
||||
ol>li {
|
||||
margin-left: 27.2px;
|
||||
}
|
||||
|
||||
li>*:first-child {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
/* Text alignements, this should be forbidden. */
|
||||
|
||||
.left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Links and anchors */
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #2C5CBD;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
box-shadow: 0 1px 0 0 #2C5CBD;
|
||||
}
|
||||
|
||||
/* Linked highlight */
|
||||
*:target {
|
||||
background-color: rgba(187,239,253,0.3) !important;
|
||||
box-shadow: 0 0px 0 1px rgba(187,239,253,0.8) !important;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
*:hover>a.anchor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
a.anchor:before {
|
||||
content: "#"
|
||||
}
|
||||
|
||||
a.anchor:hover {
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
a.anchor {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
/* top: 0px; */
|
||||
/* margin-left: -3ex; */
|
||||
margin-left: -1.3em;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
padding-right: 0.4em;
|
||||
padding-left: 0.4em;
|
||||
/* To remain selectable */
|
||||
color: #d5d5d5;
|
||||
}
|
||||
|
||||
.spec > a.anchor {
|
||||
margin-left: -2.3em;
|
||||
padding-right: 0.9em;
|
||||
}
|
||||
|
||||
.xref-unresolved {
|
||||
color: #2C5CBD;
|
||||
}
|
||||
.xref-unresolved:hover {
|
||||
box-shadow: 0 1px 0 0 #CC6666;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
|
||||
h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 {
|
||||
font-family: "Fira Sans", Helvetica, Arial, sans-serif;
|
||||
font-weight: 400;
|
||||
margin: 0.5em 0 0.5em 0;
|
||||
padding-top: 0.1em;
|
||||
line-height: 1.2;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: 500;
|
||||
font-size: 2.441em;
|
||||
margin-top: 1.214em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: 500;
|
||||
font-size: 1.953em;
|
||||
box-shadow: 0 1px 0 0 #ddd;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.563em;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
small, .font_small {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
h1 code, h1 tt {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
h2 code, h2 tt {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
h3 code, h3 tt {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
h3 code, h3 tt {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1.12em;
|
||||
}
|
||||
|
||||
|
||||
/* Preformatted and code */
|
||||
|
||||
tt, code, pre {
|
||||
font-family: "Fira Mono", courier;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 0.1em;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
p code, li code {
|
||||
background-color: #f6f8fa;
|
||||
color: #0d2b3e;
|
||||
border-radius: 3px;
|
||||
padding: 0 0.3ex;
|
||||
}
|
||||
|
||||
p a > code {
|
||||
color: #2C5CBD;
|
||||
}
|
||||
|
||||
/* Code blocks (e.g. Examples) */
|
||||
|
||||
pre code {
|
||||
font-size: 0.893rem;
|
||||
}
|
||||
|
||||
/* Code lexemes */
|
||||
|
||||
.keyword {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Module member specification */
|
||||
|
||||
.spec:not(.include), .spec.include details summary {
|
||||
background-color: #f6f8fa;
|
||||
border-radius: 3px;
|
||||
border-left: 4px solid #5c9cf5;
|
||||
border-right: 5px solid transparent;
|
||||
padding: 0.35em 0.5em;
|
||||
}
|
||||
|
||||
.spec.include details summary:hover {
|
||||
background-color: #ebeff2;
|
||||
}
|
||||
|
||||
dl, div.spec, .doc, aside {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
dl > dd {
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
dd> :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
dl:last-child, dd> :last-child, aside:last-child, article:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt+dt {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
section+section, section > header + dl {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.spec.type .variant {
|
||||
margin-left: 2ch;
|
||||
}
|
||||
.spec.type .variant p {
|
||||
margin: 0;
|
||||
font-style: italic;
|
||||
}
|
||||
.spec.type .record {
|
||||
margin-left: 2ch;
|
||||
}
|
||||
.spec.type .record p {
|
||||
margin: 0;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.def {
|
||||
margin-top: 0;
|
||||
text-indent: -2ex;
|
||||
padding-left: 2ex;
|
||||
}
|
||||
|
||||
div.def+div.doc {
|
||||
margin-left: 1ex;
|
||||
margin-top: 2.5px
|
||||
}
|
||||
|
||||
div.doc>*:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* The elements other than heading should be wrapped in <aside> elements. */
|
||||
/* heading, body>p, body>ul, body>ol, h3, h4, body>pre { */
|
||||
/* margin-bottom: 30px; */
|
||||
/* } */
|
||||
|
||||
/* Collapsible inlined include and module */
|
||||
|
||||
.spec.include details {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.spec.include details:after {
|
||||
z-index: -100;
|
||||
display: block;
|
||||
content: " ";
|
||||
position: absolute;
|
||||
border-radius: 0 1ex 1ex 0;
|
||||
right: -20px;
|
||||
top: 1px;
|
||||
bottom: 1px;
|
||||
width: 15px;
|
||||
background: rgba(0, 4, 15, 0.05);
|
||||
box-shadow: 0 0px 0 1px rgba(204, 204, 204, 0.53);
|
||||
}
|
||||
|
||||
.spec.include details summary {
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* FIXME: Does not work in Firefox. */
|
||||
details summary::-webkit-details-marker {
|
||||
color: #888;
|
||||
transform: scaleX(-1);
|
||||
position: absolute;
|
||||
top: calc(50% - 5px);
|
||||
height: 11px;
|
||||
right: -29px;
|
||||
}
|
||||
|
||||
/* Records and variants FIXME */
|
||||
|
||||
div.def table {
|
||||
text-indent: 0em;
|
||||
padding: 0;
|
||||
margin-left: -2ex;
|
||||
}
|
||||
|
||||
td.def {
|
||||
padding-right: 2ex
|
||||
}
|
||||
|
||||
.record td.def {
|
||||
padding-left: 2ex;
|
||||
}
|
||||
|
||||
td.doc *:first-child {
|
||||
margin-top: 0em
|
||||
}
|
||||
|
||||
/* @ tags */
|
||||
|
||||
ul.at-tag {
|
||||
list-style-type: none;
|
||||
margin-left: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.at-tag li {
|
||||
margin-left: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.at-tag li p:first-child {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
/* FIXME remove */
|
||||
|
||||
span.at-tag {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
.at-tag.deprecated {
|
||||
font-weight: normal;
|
||||
color: crimson
|
||||
}
|
||||
|
||||
.at-tag.raise {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* FIXME random other things to review. */
|
||||
|
||||
.heading {
|
||||
margin-top: 10px;
|
||||
border-bottom: solid;
|
||||
border-width: 1px;
|
||||
border-color: #DDD;
|
||||
text-align: right;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.heading+.sig {
|
||||
margin-top: -20px;
|
||||
}
|
||||
|
||||
.heading+.parameters {
|
||||
margin-top: -20px;
|
||||
}
|
||||
|
||||
/* Odig package index */
|
||||
|
||||
.by-name ol, .by-tag ol, .errors ol {
|
||||
list-style-type: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.by-name ol ol, .by-tag ol ol {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0
|
||||
}
|
||||
|
||||
.by-name li, .by-tag li, .errors li {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.by-name .version {
|
||||
font-size: 10px;
|
||||
color: #AAA
|
||||
}
|
||||
|
||||
.by-name nav {
|
||||
margin-bottom: 10px
|
||||
}
|
||||
|
||||
.by-name nav a {
|
||||
text-transform: uppercase;
|
||||
font-size: 18px;
|
||||
margin-right: 1ex;
|
||||
color: #222;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.by-tag nav a {
|
||||
margin-right: 1ex;
|
||||
color: #222;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.by-tag>ol>li {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.by-tag>ol>li>span, .by-tag>ol>li>ol, .by-tag>ol>li>ol>li {
|
||||
display: inline-block;
|
||||
margin-right: 1ex;
|
||||
}
|
||||
|
||||
/* Odig package page */
|
||||
|
||||
.package nav {
|
||||
display: inline;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.package .version {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h1+.modules, h1+.sel {
|
||||
margin-top: 10px
|
||||
}
|
||||
|
||||
.sel {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-size: 14px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.sel+.modules {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
margin-left: 1ex;
|
||||
}
|
||||
|
||||
.modules {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.modules .module {
|
||||
min-width: 8ex;
|
||||
padding-right: 2ex
|
||||
}
|
||||
|
||||
.package.info {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.package.info td:first-child {
|
||||
font-style: italic;
|
||||
padding-right: 2ex;
|
||||
}
|
||||
|
||||
.package.info ul {
|
||||
list-style-type: none;
|
||||
display: inline;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.package.info li {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
margin-right: 1ex;
|
||||
}
|
||||
|
||||
#info-authors li, #info-maintainers li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Sidebar and TOC */
|
||||
|
||||
.toc:before {
|
||||
display: block;
|
||||
content: "Contents";
|
||||
text-transform: uppercase;
|
||||
font-size: 1em;
|
||||
margin: 1.414em 0 0.5em;
|
||||
font-weight: 500;
|
||||
color: #777;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.toc {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
max-width: 30ex;
|
||||
min-width: 26ex;
|
||||
width: 20%;
|
||||
background: #f6f8fa;
|
||||
overflow: auto;
|
||||
color: #1F2D3D;
|
||||
padding-left: 2ex;
|
||||
padding-right: 2ex;
|
||||
}
|
||||
|
||||
.toc ul li a {
|
||||
font-family: "Fira Sans", sans-serif;
|
||||
font-size: 0.95em;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
line-height: 1.6em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.toc ul li a:hover {
|
||||
box-shadow: none;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* First level titles */
|
||||
|
||||
.toc>ul>li>a {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.toc li ul {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.toc ul {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.toc ul li {
|
||||
margin: 0;
|
||||
}
|
||||
.toc>ul>li {
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
.toc ul li li {
|
||||
border-left: 1px solid #ccc;
|
||||
margin-left: 5px;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
/* Mobile adjustements. */
|
||||
|
||||
@media only screen and (max-width: 95ex) {
|
||||
.content {
|
||||
margin: auto;
|
||||
padding: 2.0em;
|
||||
}
|
||||
.toc {
|
||||
position: static;
|
||||
width: auto;
|
||||
min-width: unset;
|
||||
max-width: unset;
|
||||
border: none;
|
||||
padding: 0.2em 1em;
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print adjustements. */
|
||||
|
||||
@media print {
|
||||
body {
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
body nav:first-child {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
/* Syntax highlighting (based on github-gist) */
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-type,
|
||||
.hljs-class .hljs-title {
|
||||
color: #458;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Copyright (c) 2016 The odoc contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
---------------------------------------------------------------------------*/
|
||||
7
fmt/Fmt/Dump/index.html
Normal file
7
fmt/Fmt/Dump/index.html
Normal file
File diff suppressed because one or more lines are too long
51
fmt/Fmt/index.html
Normal file
51
fmt/Fmt/index.html
Normal file
File diff suppressed because one or more lines are too long
6
fmt/Fmt_cli/index.html
Normal file
6
fmt/Fmt_cli/index.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Fmt_cli (fmt.Fmt_cli)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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">fmt</a> » Fmt_cli</nav><header class="odoc-preamble"><h1>Module <code><span>Fmt_cli</span></code></h1><p><a href="../../cmdliner/Cmdliner/index.html"><code>Cmdliner</code></a> support for <code>Fmt</code>.</p></header><nav class="odoc-toc"><ul><li><a href="#option-for-setting-the-style-renderer">Option for setting the style renderer</a></li></ul></nav><div class="odoc-content"><h2 id="option-for-setting-the-style-renderer"><a href="#option-for-setting-the-style-renderer" class="anchor"></a>Option for setting the style renderer</h2><div class="odoc-spec"><div class="spec value anchored" id="val-style_renderer"><a href="#val-style_renderer" class="anchor"></a><code><span><span class="keyword">val</span> style_renderer :
|
||||
<span><span class="optlabel">?env</span>:<a href="../../cmdliner/Cmdliner/Arg/index.html#type-env">Cmdliner.Arg.env</a> <span class="arrow">-></span></span>
|
||||
<span><span class="optlabel">?docs</span>:string <span class="arrow">-></span></span>
|
||||
<span>unit <span class="arrow">-></span></span>
|
||||
<span><span><a href="../Fmt/index.html#type-style_renderer">Fmt.style_renderer</a> option</span> <a href="../../cmdliner/Cmdliner/Term/index.html#type-t">Cmdliner.Term.t</a></span></span></code></div><div class="spec-doc"><p><code>style_renderer ?env ?docs ()</code> is a <a href="../../cmdliner/Cmdliner/index.html"><code>Cmdliner</code></a> option <code>--color</code> that can be directly used with the optional arguments of <a href="../Fmt_tty/index.html#tty_setup" title="tty_setup">TTY setup</a> or to control <a href="../Fmt/index.html#val-set_style_renderer" title="Fmt.set_style_renderer">style rendering</a>. The option is documented under <code>docs</code> (defaults to the default in <a href="../../cmdliner/Cmdliner/Arg/index.html#type-info"><code>Cmdliner.Arg.info</code></a>).</p><p>The option is a tri-state enumerated value that when used with <a href="../Fmt_tty/index.html#tty_setup" title="tty_setup">TTY setup</a> takes over the automatic setup:</p><ul><li><code>--color=never</code>, the value is <code>Some `None</code>, forces no styling.</li><li><code>--color=always</code>, the value is <code>Some `Ansi</code>, forces ANSI styling.</li><li><code>--color=auto</code> or absent, the value is <code>None</code>, automatic setup takes place.</li></ul><p>If <code>env</code> is provided, the option default value (<code>None</code>) can be overridden by the corresponding environment variable.</p></div></div></div></body></html>
|
||||
10
fmt/Fmt_tty/index.html
Normal file
10
fmt/Fmt_tty/index.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Fmt_tty (fmt.Fmt_tty)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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">fmt</a> » Fmt_tty</nav><header class="odoc-preamble"><h1>Module <code><span>Fmt_tty</span></code></h1><p><code>Fmt</code> TTY setup.</p><p><code>Fmt_tty</code> provides simple automatic setup on channel formatters for:</p><ul><li><a href="../Fmt/index.html#val-set_style_renderer"><code>Fmt.set_style_renderer</code></a>. <code>`Ansi_tty</code> is used if the channel <span class="xref-unresolved" title="Unix.isatty">is a tty</span> and the environment variable <code>TERM</code> is defined and its value is not <code>"dumb"</code>. <code>`None</code> is used otherwise.</li><li><a href="../Fmt/index.html#val-set_utf_8"><code>Fmt.set_utf_8</code></a>. <code>true</code> is used if one of the following environment variables has <code>"UTF-8"</code> as a case insensitive substring: <code>LANG</code>, <code>LC_ALL</code>, <code>LC_CTYPE</code>.</li></ul></header><nav class="odoc-toc"><ul><li><a href="#tty_setup">TTY setup</a></li></ul></nav><div class="odoc-content"><h2 id="tty_setup"><a href="#tty_setup" class="anchor"></a>TTY setup</h2><div class="odoc-spec"><div class="spec value anchored" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup :
|
||||
<span><span class="optlabel">?style_renderer</span>:<a href="../Fmt/index.html#type-style_renderer">Fmt.style_renderer</a> <span class="arrow">-></span></span>
|
||||
<span><span class="optlabel">?utf_8</span>:bool <span class="arrow">-></span></span>
|
||||
<span><a href="../../ocaml/Stdlib/index.html#type-out_channel">out_channel</a> <span class="arrow">-></span></span>
|
||||
<a href="../../ocaml/Stdlib/Format/index.html#type-formatter">Stdlib.Format.formatter</a></span></code></div><div class="spec-doc"><p><code>setup ?style_renderer ?utf_8 outc</code> is a formatter for <code>outc</code> with <a href="../Fmt/index.html#val-set_style_renderer"><code>Fmt.set_style_renderer</code></a> and <a href="../Fmt/index.html#val-set_utf_8"><code>Fmt.set_utf_8</code></a> correctly setup. If <code>style_renderer</code> or <code>utf_8</code> are specified they override the automatic setup.</p><p>If <code>outc</code> is <code>stdout</code>, <a href="../Fmt/index.html#val-stdout"><code>Fmt.stdout</code></a> is returned. If <code>outc</code> is <code>stderr</code>, <a href="../Fmt/index.html#val-stderr"><code>Fmt.stderr</code></a> is returned.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-setup_std_outputs"><a href="#val-setup_std_outputs" class="anchor"></a><code><span><span class="keyword">val</span> setup_std_outputs :
|
||||
<span><span class="optlabel">?style_renderer</span>:<a href="../Fmt/index.html#type-style_renderer">Fmt.style_renderer</a> <span class="arrow">-></span></span>
|
||||
<span><span class="optlabel">?utf_8</span>:bool <span class="arrow">-></span></span>
|
||||
<span>unit <span class="arrow">-></span></span>
|
||||
unit</span></code></div><div class="spec-doc"><p><code>setup_std_outputs ?style_renderer ?utf_8 ()</code> applies <a href="#val-setup"><code>setup</code></a> on <code>stdout</code> and <code>stderr</code>.</p></div></div></div></body></html>
|
||||
132
fmt/_doc-dir/CHANGES.md
Normal file
132
fmt/_doc-dir/CHANGES.md
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
v0.9.0 2021-10-22 Zagreb
|
||||
------------------------
|
||||
|
||||
* Add alert messages to deprecation annotations (#47).
|
||||
* The solution using ephemerons introduced in v0.8.7 for attaching
|
||||
custom data to formatters has unreliable performance characteristics
|
||||
in some usage scenarios. Namely use of `Fmt.styled` with
|
||||
`Fmt.[k]str` heavy code as those rely on `Format.{k,a}sprintf` which
|
||||
allocate one formatter per call.
|
||||
|
||||
Hence we subvert again the `Format` tag system to do dirty
|
||||
things. However since as of 4.08 tags became an extensible sum type
|
||||
we can keep our dirty things entirely internal.
|
||||
|
||||
Thanks to Thomas Leonard for reporting and David Kaloper Meršinjak
|
||||
for further investigations (#52).
|
||||
|
||||
v0.8.10 2021-10-04 Zagreb
|
||||
-------------------------
|
||||
|
||||
* Require OCaml >= 4.08. This drops the dependency on the
|
||||
`stdlib-shims` and `seq` packages.
|
||||
* Add the `[@@ocaml.deprecated]` annotation to deprecated
|
||||
functions. Thanks to Antonin Décimo for the patch.
|
||||
|
||||
v0.8.9 2020-09-23 Zagreb
|
||||
------------------------
|
||||
|
||||
* Fix `Dump.{iter_bindings,hashtbl}` which since 0.8.7 no longer
|
||||
prints seperators. Thanks to Edwin Török for the patch.
|
||||
* Open the result of `Fmt.error_msg` to make it easier
|
||||
to compose with other errors. Thanks to Thomas Leonard
|
||||
for the patch.
|
||||
|
||||
v0.8.8 2019-08-01 Zagreb
|
||||
------------------------
|
||||
|
||||
Fix build on 32-bit platforms.
|
||||
|
||||
v0.8.7 2019-07-21 Zagreb
|
||||
------------------------
|
||||
|
||||
* Require OCaml 4.05.
|
||||
* Add `Fmt.hex` and friends. Support for hex dumping.
|
||||
Thanks to David Kaloper Meršinjak for the design and implementation..
|
||||
* Add `Fmt.si_size` to format integer magnitudes using SI prefixes.
|
||||
* Add `Fmt.uint64_ns_span` to format time spans.
|
||||
* Add `Fmt.truncated` to truncate your long strings.
|
||||
* Add `Fmt.flush`, has the effect of `Format.pp_print_flush`.
|
||||
* Add `Fmt.[Dump.]{field,record}` for records (#9).
|
||||
* Add `Fmt.concat` to apply a list of formatters to a value.
|
||||
* Add `Fmt.{semi,sps}`, separators.
|
||||
* Add `Fmt.{error,error_msg}` to format `result` values.
|
||||
* Add `Fmt.failwith_notrace`.
|
||||
* Add `Fmt.( ++ )`, alias for `Fmt.append`.
|
||||
* Add `Fmt.Dump.string`.
|
||||
* Add more ANSI tty formatting styles and make them composable.
|
||||
* Change `Fmt.{const,comma,cut,sp}`, generalize signature.
|
||||
* Change `Fmt.append`, incompatible signature. Use `Fmt.(pair ~sep:nop)` if
|
||||
you were using it (backward compatible with earlier versions of `Fmt`).
|
||||
* Deprecate `Fmt.{strf,kstrf,strf_like}` in favor of `Fmt.{str,kstr,str_like}`.
|
||||
* Deprecate `Fmt.{always,unit}` in favor of `Fmt.any`.
|
||||
* Deprecate `Fmt.{prefix,suffix}` (specializes Fmt.( ++ )).
|
||||
* Deprecate `Fmt.styled_unit`.
|
||||
* No longer subvert the `Format` tag system to do dirty things.
|
||||
Thanks to David Kaloper Meršinjak for the work.
|
||||
|
||||
v0.8.6 2019-04-01 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
* Add `Fmt.{seq,Dump.seq}` to format `'a Seq.t` values. Thanks to
|
||||
Hezekiah M. Carty for the patch.
|
||||
* Handle `Pervasives`'s deprecation via dependency on `stdlib-shims`.
|
||||
* `Fmt.Dump.signal` format signals added in 4.03.
|
||||
* Fix toplevel initialization for omod (#33).
|
||||
* Require at least OCaml 4.03 (drops dependency on `result` and `uchar`
|
||||
compatibility packages).
|
||||
|
||||
v0.8.5 2017-12-27 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
* Fix `Fmt.{kstrf,strf_like}` when they are partially applied
|
||||
and repeatedly called. Thanks to Thomas Gazagnaire for the report.
|
||||
* Add `Fmt.comma`.
|
||||
* Relax the `Fmt.(invalid_arg, failwith)` type signature. Thanks to
|
||||
Hezekiah M. Carty for the patch.
|
||||
|
||||
v0.8.4 2017-07-08 Zagreb
|
||||
------------------------
|
||||
|
||||
* Add `Fmt.{invalid_arg,failwith}`. Thanks to Hezekiah M. Carty for the patch.
|
||||
|
||||
v0.8.3 2017-04-13 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
* Fix `Fmt.exn_backtrace`. Thanks to Thomas Leonard for the report.
|
||||
|
||||
v0.8.2 2017-03-20 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
* Fix `META` file.
|
||||
|
||||
v0.8.1 2017-03-15 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
* `Fmt_tty.setup`, treat empty `TERM` env var as dumb.
|
||||
* Add `Fmt.Dump.uchar` formatter for inspecting `Uchar.t` values.
|
||||
|
||||
v0.8.0 2016-05-23 La Forclaz (VS)
|
||||
---------------------------------
|
||||
|
||||
* Build depend on topkg.
|
||||
* Relicense from BSD3 to ISC.
|
||||
* Tweak `Fmt.Dump.option` to indent like in sources.
|
||||
* Add `Fmt.Dump.signal` formatter for `Sys` signal numbers.
|
||||
* Add `Fmt[.Dump].result`, formatter for `result` values.
|
||||
* Add `Fmt.{words,paragraphs}` formatters on US-ASCII strings.
|
||||
* Add `Fmt.exn[_backtrace]`. Thanks to Edwin Török for suggesting.
|
||||
* Add `Fmt.quote`.
|
||||
* Rename `Fmt.text_range` to `Fmt.text_loc` and simplify output
|
||||
when range is a position.
|
||||
|
||||
v0.7.1 2015-12-03 Cambridge (UK)
|
||||
--------------------------------
|
||||
|
||||
* Add optional cmdliner support. See the `Fmt_cli` module provided
|
||||
by the package `fmt.cli`.
|
||||
|
||||
v0.7.0 2015-09-17 Cambridge (UK)
|
||||
--------------------------------
|
||||
|
||||
First Release.
|
||||
13
fmt/_doc-dir/LICENSE.md
Normal file
13
fmt/_doc-dir/LICENSE.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Copyright (c) 2016 The fmt programmers
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
35
fmt/_doc-dir/README.md
Normal file
35
fmt/_doc-dir/README.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
Fmt — OCaml Format pretty-printer combinators
|
||||
-------------------------------------------------------------------------------
|
||||
v0.9.0
|
||||
|
||||
Fmt exposes combinators to devise `Format` pretty-printing functions.
|
||||
|
||||
Fmt depends only on the OCaml standard library. The optional `Fmt_tty`
|
||||
library that allows to setup formatters for terminal color output
|
||||
depends on the Unix library. The optional `Fmt_cli` library that
|
||||
provides command line support for Fmt depends on [`Cmdliner`][cmdliner].
|
||||
|
||||
Fmt is distributed under the ISC license.
|
||||
|
||||
[cmdliner]: http://erratique.ch/software/cmdliner
|
||||
|
||||
Home page: http://erratique.ch/software/fmt
|
||||
|
||||
## Installation
|
||||
|
||||
Fmt can be installed with `opam`:
|
||||
|
||||
opam install fmt
|
||||
opam install base-unix cmdliner fmt # Install all optional libraries
|
||||
|
||||
If you don't use `opam` consult the [`opam`](opam) file for build
|
||||
instructions.
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation and API reference is automatically generated by
|
||||
`ocamldoc` from the interfaces. It can be consulted [online][doc]
|
||||
and there is a generated version in the `doc` directory of the
|
||||
distribution.
|
||||
|
||||
[doc]: http://erratique.ch/software/fmt/doc/
|
||||
2
fmt/index.html
Normal file
2
fmt/index.html
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (fmt.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – fmt</nav><header class="odoc-preamble"><h1 id="package-fmt"><a href="#package-fmt" class="anchor"></a>Package fmt <nav><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">changes</a> <a href="#package_info">more…</a></nav></h1><ul class="modules"><li><a href="Fmt/index.html"><code>Fmt</code></a> <span class="synopsis"><code>Format</code> pretty-printer combinators.</span></li><li><a href="Fmt_cli/index.html"><code>Fmt_cli</code></a> <span class="synopsis"><a href="../cmdliner/Cmdliner/index.html"><code>Cmdliner</code></a> support for <code>Fmt</code>.</span></li><li><a href="Fmt_tty/index.html"><code>Fmt_tty</code></a> <span class="synopsis"><code>Fmt</code> TTY setup.</span></li></ul></header><nav class="odoc-toc"><ul><li><a href="#package_info">Package info</a></li></ul></nav><div class="odoc-content"><h2 id="package_info"><a href="#package_info" class="anchor"></a>Package info</h2><table class="package info"><tr id="info-changes-files"><td><a href="#info-changes-files" aria-hidden="true" class="anchor"></a>changes-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/CHANGES.md">CHANGES.md</a></li></ul></td></tr><tr id="info-license-files"><td><a href="#info-license-files" aria-hidden="true" class="anchor"></a>license-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/LICENSE.md">LICENSE.md</a></li></ul></td></tr><tr id="info-readme-files"><td><a href="#info-readme-files" aria-hidden="true" class="anchor"></a>readme-files</td><td><ul><li><a type="text/plain; charset=UTF-8" href="_doc-dir/README.md">README.md</a></li></ul></td></tr></table></div></body></html>
|
||||
BIN
fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue