finished first version of documentation

This commit is contained in:
2024-12-03 00:33:28 +00:00
parent faabb4651f
commit 2ba8355fb1
18 changed files with 1528 additions and 47 deletions

36
Docs/haskell/P2PRC.html Normal file

File diff suppressed because one or more lines are too long

120
Docs/haskell/P2PRC.md Normal file
View File

@@ -0,0 +1,120 @@
<div id="package-header">
<span class="caption">p2prc-0.1.0.0: P2PRC haskell library</span>
- [Contents](index.html)
- [Index](doc-index.html)
</div>
<div id="content">
<div id="module-header">
| | |
|--------------|-----------------------------------------|
| Copyright | Copyright (C) 2006-2024 John MacFarlane |
| License | GNU GPL, version 2 or above |
| Maintainer | John MacFarlane \<jgm@berkeley.edu\> |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
P2PRC
</div>
<div id="description">
Description
<div class="doc">
This helper module exports the main writers, readers, and data structure
definitions from the Pandoc libraries.
A typical application will chain together a reader and a writer to
convert strings from one format to another. For example, the following
simple program will act as a filter converting markdown fragments to
reStructuredText, using reference-style links instead of inline links:
module Main where
import Text.Pandoc
import Data.Text (Text)
import qualified Data.Text.IO as T
mdToRST :: Text -> IO Text
mdToRST txt = runIOorExplode $
readMarkdown def txt
>>= writeRST def{ writerReferenceLinks = True }
main :: IO ()
main = do
T.getContents >>= mdToRST >>= T.putStrLn
</div>
</div>
<div id="synopsis">
Synopsis
- [runP2PRC](#v:runP2PRC) ::
[MapPortRequest](P2PRC.html#t:MapPortRequest "P2PRC") -\>
[IO]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/System-IO.html#t:IO "System.IO")
()
- <span class="keyword">data</span> [MapPortRequest](#t:MapPortRequest)
= [MkMapPortRequest](#v:MkMapPortRequest)
[Int]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-Int.html#t:Int "Data.Int")
[String]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-String.html#t:String "Data.String")
</div>
<div id="interface">
# Documentation
<div class="top">
<span id="v:runP2PRC" class="def">runP2PRC</span> ::
[MapPortRequest](P2PRC.html#t:MapPortRequest "P2PRC") -\>
[IO]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/System-IO.html#t:IO "System.IO")
() <a href="#v:runP2PRC" class="selflink">#</a>
<div class="doc">
Hello World
</div>
</div>
<div class="top">
<span class="keyword">data</span> <span id="t:MapPortRequest"
class="def">MapPortRequest</span>
<a href="#t:MapPortRequest" class="selflink">#</a>
<div class="subs constructors">
Constructors
| | |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| <span id="v:MkMapPortRequest" class="def">MkMapPortRequest</span> [Int]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-Int.html#t:Int "Data.Int") [String]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-String.html#t:String "Data.String") |   |
</div>
</div>
</div>
</div>
<div id="footer">
Produced by [Haddock](http://www.haskell.org/haddock/) version 2.29.2
</div>

120
Docs/haskell/README.md Normal file
View File

@@ -0,0 +1,120 @@
<div id="package-header">
<span class="caption">p2prc-0.1.0.0: P2PRC haskell library</span>
- [Contents](index.html)
- [Index](doc-index.html)
</div>
<div id="content">
<div id="module-header">
| | |
|--------------|-----------------------------------------|
| Copyright | Copyright (C) 2006-2024 John MacFarlane |
| License | GNU GPL, version 2 or above |
| Maintainer | John MacFarlane \<jgm@berkeley.edu\> |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
P2PRC
</div>
<div id="description">
Description
<div class="doc">
This helper module exports the main writers, readers, and data structure
definitions from the Pandoc libraries.
A typical application will chain together a reader and a writer to
convert strings from one format to another. For example, the following
simple program will act as a filter converting markdown fragments to
reStructuredText, using reference-style links instead of inline links:
module Main where
import Text.Pandoc
import Data.Text (Text)
import qualified Data.Text.IO as T
mdToRST :: Text -> IO Text
mdToRST txt = runIOorExplode $
readMarkdown def txt
>>= writeRST def{ writerReferenceLinks = True }
main :: IO ()
main = do
T.getContents >>= mdToRST >>= T.putStrLn
</div>
</div>
<div id="synopsis">
Synopsis
- [runP2PRC](#v:runP2PRC) ::
[MapPortRequest](P2PRC.html#t:MapPortRequest "P2PRC") -\>
[IO]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/System-IO.html#t:IO "System.IO")
()
- <span class="keyword">data</span> [MapPortRequest](#t:MapPortRequest)
= [MkMapPortRequest](#v:MkMapPortRequest)
[Int]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-Int.html#t:Int "Data.Int")
[String]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-String.html#t:String "Data.String")
</div>
<div id="interface">
# Documentation
<div class="top">
<span id="v:runP2PRC" class="def">runP2PRC</span> ::
[MapPortRequest](P2PRC.html#t:MapPortRequest "P2PRC") -\>
[IO]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/System-IO.html#t:IO "System.IO")
() <a href="#v:runP2PRC" class="selflink">#</a>
<div class="doc">
Hello World
</div>
</div>
<div class="top">
<span class="keyword">data</span> <span id="t:MapPortRequest"
class="def">MapPortRequest</span>
<a href="#t:MapPortRequest" class="selflink">#</a>
<div class="subs constructors">
Constructors
| | |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| <span id="v:MkMapPortRequest" class="def">MkMapPortRequest</span> [Int]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-Int.html#t:Int "Data.Int") [String]($%7Bpkgroot%7D/../../../../dcnyq1a8qi8x59n5p53d0dx42cl8hf8x-ghc-9.6.5-doc/share/doc/ghc/html/libraries/base-4.18.2.1/Data-String.html#t:String "Data.String") |   |
</div>
</div>
</div>
</div>
<div id="footer">
Produced by [Haddock](http://www.haskell.org/haddock/) version 2.29.2
</div>

File diff suppressed because one or more lines are too long

30
Docs/haskell/doc-index.md Normal file
View File

@@ -0,0 +1,30 @@
<div id="package-header">
<span class="caption">p2prc-0.1.0.0: P2PRC haskell library</span>
- [Contents](index.html)
- [Index](doc-index.html)
</div>
<div id="content">
<div id="index">
Index
| | |
|------------------|------------------------------------------------|
| MapPortRequest | [P2PRC](P2PRC.html#t:MapPortRequest "P2PRC") |
| MkMapPortRequest | [P2PRC](P2PRC.html#v:MkMapPortRequest "P2PRC") |
| runP2PRC | [P2PRC](P2PRC.html#v:runP2PRC "P2PRC") |
</div>
</div>
<div id="footer">
Produced by [Haddock](http://www.haskell.org/haddock/) version 2.29.2
</div>

2
Docs/haskell/haddock-bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
Docs/haskell/index.html Normal file
View File

@@ -0,0 +1 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>p2prc-0.1.0.0: P2PRC haskell library</title><link href="linuwial.css" rel="stylesheet" type="text/css" title="Linuwial" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400i,700" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { processClass: "mathjax", ignoreClass: ".*" } });</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><span class="caption">p2prc-0.1.0.0: P2PRC haskell library</span><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul></div><div id="content"><div id="description"><h1>p2prc-0.1.0.0: P2PRC haskell library</h1><div class="doc"><p>Implements a client interface to the P2PRC networking runtime</p></div></div><div id="module-list"><p class="caption">Modules</p><div id="module-list"><p class="caption">p2prc-0.1.0.0</p><ul><li><span class="module"><span class="noexpander">&nbsp;</span><a href="P2PRC.html">P2PRC</a></span></li></ul></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.29.2</p></div></body></html>

44
Docs/haskell/index.md Normal file
View File

@@ -0,0 +1,44 @@
<div id="package-header">
<span class="caption">p2prc-0.1.0.0: P2PRC haskell library</span>
- [Contents](index.html)
- [Index](doc-index.html)
</div>
<div id="content">
<div id="description">
# p2prc-0.1.0.0: P2PRC haskell library
<div class="doc">
Implements a client interface to the P2PRC networking runtime
</div>
</div>
<div id="module-list">
Modules
<div id="module-list">
p2prc-0.1.0.0
- <span class="module"><span class="noexpander"> </span>[P2PRC](P2PRC.html)</span>
</div>
</div>
</div>
<div id="footer">
Produced by [Haddock](http://www.haskell.org/haddock/) version 2.29.2
</div>

881
Docs/haskell/linuwial.css Normal file
View File

@@ -0,0 +1,881 @@
/* @group Fundamentals */
* { margin: 0; padding: 0 }
/* Is this portable? */
html {
background-color: white;
width: 100%;
height: 100%;
}
body {
background: #fefefe;
color: #111;
text-align: left;
min-height: 100vh;
position: relative;
-webkit-text-size-adjust: 100%;
-webkit-font-feature-settings: "kern" 1, "liga" 0;
-moz-font-feature-settings: "kern" 1, "liga" 0;
-o-font-feature-settings: "kern" 1, "liga" 0;
font-feature-settings: "kern" 1, "liga" 0;
letter-spacing: 0.0015rem;
}
#content a {
overflow-wrap: break-word;
}
p {
margin: 0.8em 0;
}
ul, ol {
margin: 0.8em 0 0.8em 2em;
}
dl {
margin: 0.8em 0;
}
dt {
font-weight: bold;
}
dd {
margin-left: 2em;
}
a { text-decoration: none; }
a[href]:link { color: #9E358F; }
a[href]:visited {color: #6F5F9C; }
a[href]:hover { text-decoration:underline; }
a[href].def:link, a[href].def:visited { color: rgba(69, 59, 97, 0.8); }
a[href].def:hover { color: rgb(78, 98, 114); }
/* @end */
/* @group Show and hide with JS */
body.js-enabled .hide-when-js-enabled {
display: none;
}
/* @end */
/* @group responsive */
#package-header .caption {
margin: 0px 1em 0 2em;
}
@media only screen and (min-width: 1280px) {
#content {
width: 63vw;
max-width: 1450px;
}
#table-of-contents {
position: fixed;
max-width: 10vw;
top: 10.2em;
left: 2em;
bottom: 1em;
overflow-y: auto;
}
#synopsis {
display: block;
position: fixed;
float: left;
top: 5em;
bottom: 1em;
right: 0;
max-width: 65vw;
overflow-y: auto;
/* Ensure that synopsis covers everything (including MathJAX markup) */
z-index: 1;
}
#synopsis .show {
border: 1px solid #5E5184;
padding: 0.7em;
max-height: 65vh;
}
}
@media only screen and (max-width: 1279px) {
#content {
width: 80vw;
}
#synopsis {
display: block;
padding: 0;
position: relative;
margin: 0;
width: 100%;
}
}
@media only screen and (max-width: 999px) {
#content {
width: 93vw;
}
}
/* menu for wider screens
Display the package name at the left and the menu links at the right,
inline with each other:
The package name Source . Contents . Index
*/
@media only screen and (min-width: 1000px) {
#package-header {
text-align: left;
white-space: nowrap;
height: 40px;
padding: 4px 1.5em 0px 1.5em;
overflow: visible;
display: flex;
justify-content: space-between;
align-items: center;
}
#package-header .caption {
display: inline-block;
margin: 0;
}
#package-header ul.links {
margin: 0;
display: inline-table;
}
#package-header .caption + ul.links {
margin-left: 1em;
}
}
/* menu for smaller screens
Display the package name on top of the menu links and center both elements:
The package name
Source . Contents . Index
*/
@media only screen and (max-width: 999px) {
#package-header {
text-align: center;
padding: 6px 0 4px 0;
overflow: hidden;
}
#package-header ul.links {
display: block;
text-align: center;
margin: 0;
/* Hide scrollbar but allow scrolling menu links horizontally */
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
margin-bottom: -17px;
height: 50px;
}
#package-header .caption {
display: block;
margin: 4px 0;
text-align: center;
}
#package-header ul.links::-webkit-scrollbar {
display: none;
}
#package-header ul.links li:first-of-type {
padding-left: 1em;
}
#package-header ul.links li:last-of-type {
/*
The last link of the menu should offer the same distance to the right
as the #package-header enforces at the left.
*/
padding-right: 1em;
}
#package-header .caption + ul.links {
padding-top: 9px;
}
#module-header table.info {
float: none;
top: 0;
margin: 0 auto;
overflow: hidden;
max-width: 80vw;
}
}
/* @end */
/* @group Fonts & Sizes */
/* Basic technique & IE workarounds from YUI 3
For reasons, see:
http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css
*/
body, button {
font: 400 14px/1.4 'PT Sans',
/* Fallback Font Stack */
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen-Sans,
Cantarell,
'Helvetica Neue',
sans-serif;
*font-size: medium; /* for IE */
*font:x-small; /* for IE in quirks mode */
}
h1 { font-size: 146.5%; /* 19pt */ }
h2 { font-size: 131%; /* 17pt */ }
h3 { font-size: 116%; /* 15pt */ }
h4 { font-size: 100%; /* 13pt */ }
h5 { font-size: 100%; /* 13pt */ }
table {
font-size:inherit;
font:100%;
}
pre, code, kbd, samp, tt, .src {
font-family:monospace;
}
.links, .link {
font-size: 85%; /* 11pt */
}
#module-header .caption {
font-size: 182%; /* 24pt */
}
#module-header .caption sup {
font-size: 80%;
font-weight: normal;
}
#package-header #page-menu a:link, #package-header #page-menu a:visited { color: white; }
.info {
font-size: 90%;
}
/* @end */
/* @group Common */
.caption, h1, h2, h3, h4, h5, h6, summary {
font-weight: bold;
color: #5E5184;
margin: 1.5em 0 1em 0;
}
* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 {
margin-top: 2em;
}
h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 {
margin-top: inherit;
}
ul li + li {
margin-top: 0.2rem;
}
ul + p {
margin-top: 0.93em;
}
p + ul {
margin-top: 0.5em;
}
p {
margin-top: 0.7rem;
}
ul, ol {
margin: 0.8em 0 0.8em 2em;
}
ul.links {
list-style: none;
text-align: left;
font-size: 0.95em;
}
#package-header ul.links, #package-header ul.links button {
font-size: 1rem;
}
ul.links li {
display: inline;
white-space: nowrap;
padding: 0;
}
ul.links > li + li:before {
content: '\00B7';
}
ul.links li a {
padding: 0.2em 0.5em;
}
.hide { display: none; }
.show { display: inherit; }
.clear { clear: both; }
.collapser:before, .expander:before, .noexpander:before {
font-size: 1.2em;
color: #9C5791;
display: inline-block;
padding-right: 7px;
}
.collapser:before {
content: '▿';
}
.expander:before {
content: '▹';
}
.noexpander:before {
content: '▿';
visibility: hidden;
}
.collapser, .expander {
cursor: pointer;
}
.instance.collapser, .instance.expander {
margin-left: 0px;
background-position: left center;
min-width: 9px;
min-height: 9px;
}
summary {
cursor: pointer;
outline: none;
}
pre {
padding: 0.5rem 1rem;
margin: 1em 0 0 0;
background-color: #f7f7f7;
overflow: auto;
border: 1px solid #ddd;
border-radius: 0.3em;
}
pre + p {
margin-top: 1em;
}
pre + pre {
margin-top: 0.5em;
}
blockquote {
border-left: 3px solid #c7a5d3;
background-color: #eee4f1;
margin: 0.5em;
padding: 0.0005em 0.3em 0.5em 0.5em;
}
.src {
background: #f2f2f2;
padding: 0.2em 0.5em;
}
.keyword { font-weight: normal; }
.def { font-weight: bold; }
@media print {
#footer { display: none; }
}
/* @end */
/* @group Page Structure */
#content {
margin: 3em auto 6em auto;
padding: 0;
}
#package-header {
background: #5E5184;
border-bottom: 5px solid rgba(69, 59, 97, 0.5);
color: #ddd;
position: relative;
font-size: 1.2em;
text-align: left;
margin: 0 auto;
}
#package-header .caption {
color: white;
font-style: normal;
font-size: 1rem;
font-weight: bold;
}
#module-header .caption {
font-weight: bold;
border-bottom: 1px solid #ddd;
}
table.info {
float: right;
padding: 0.5em 1em;
border: 1px solid #ddd;
color: rgb(78,98,114);
background-color: #fff;
max-width: 60%;
border-spacing: 0;
position: relative;
top: -0.78em;
margin: 0 0 0 2em;
}
.info th {
padding: 0 1em 0 0;
text-align: right;
}
#style-menu li {
display: block;
border-style: none;
list-style-type: none;
}
#footer {
background: #ededed;
border-top: 1px solid #aaa;
padding: 0.5em 0;
color: #222;
text-align: center;
width: 100%;
height: 3em;
margin-top: 3em;
position: relative;
clear: both;
}
/* @end */
/* @group Front Matter */
#synopsis .caption,
#contents-list .caption {
font-size: 1rem;
}
#synopsis, #table-of-contents {
font-size: 16px;
}
#contents-list {
background: #f4f4f4;
padding: 1em;
margin: 0;
}
#contents-list .caption {
text-align: left;
margin: 0;
}
#contents-list ul {
list-style: none;
margin: 0;
margin-top: 10px;
font-size: 14px;
}
#contents-list ul ul {
margin-left: 1.5em;
}
#description .caption {
display: none;
}
#synopsis summary {
display: block;
float: right;
width: 29px;
color: rgba(255,255,255,0);
height: 110px;
margin: 0;
font-size: 1px;
padding: 0;
background: url(synopsis.png) no-repeat 0px -8px;
}
#synopsis details[open] > summary {
background: url(synopsis.png) no-repeat -75px -8px;
}
#synopsis details:not([open]) > ul {
visibility: hidden;
}
#synopsis ul {
height: 100%;
overflow: auto;
padding: 0.5em;
margin: 0;
}
#synopsis ul ul {
overflow: hidden;
}
#synopsis ul,
#synopsis ul li.src {
background-color: rgb(250,247,224);
white-space: nowrap;
list-style: none;
margin-left: 0;
}
#interface td.src {
white-space: nowrap;
}
/* @end */
/* @group Main Content */
#interface div.top + div.top {
margin-top: 1.5em;
}
#interface p + div.top,
#interface h1 + div.top,
#interface h2 + div.top,
#interface h3 + div.top,
#interface h4 + div.top,
#interface h5 + div.top {
margin-top: 1em;
}
#interface .src .selflink,
#interface .src .link {
float: right;
color: #888;
padding: 0 7px;
-moz-user-select: none;
font-weight: bold;
line-height: 30px;
}
#interface .src .selflink {
margin: 0 -0.5em 0 0.5em;
}
#interface span.fixity {
color: #919191;
border-left: 1px solid #919191;
padding: 0.2em 0.5em 0.2em 0.5em;
margin: 0 -1em 0 1em;
}
#interface span.rightedge {
border-left: 1px solid #919191;
padding: 0.2em 0 0.2em 0;
margin: 0 0 0 1em;
}
#interface table { border-spacing: 2px; }
#interface td {
vertical-align: top;
padding-left: 0.5em;
}
#interface td.doc p {
margin: 0;
}
#interface td.doc p + p {
margin-top: 0.8em;
}
.doc table {
border-collapse: collapse;
border-spacing: 0px;
}
.doc th,
.doc td {
padding: 5px;
border: 1px solid #ddd;
}
.doc th {
background-color: #f0f0f0;
}
.clearfix:after {
clear: both;
content: " ";
display: block;
height: 0;
visibility: hidden;
}
.subs, .top > .doc, .subs > .doc {
padding-left: 1em;
border-left: 1px solid gainsboro;
margin-bottom: 1em;
}
.top .subs {
margin-bottom: 0.6em;
}
.subs.fields ul {
list-style: none;
display: table;
margin: 0;
}
.subs.fields ul li {
display: table-row;
}
.subs ul li dfn {
display: table-cell;
font-style: normal;
font-weight: bold;
margin: 1px 0;
white-space: nowrap;
}
.subs ul li > .doc {
display: table-cell;
padding-left: 0.5em;
margin-bottom: 0.5em;
}
.subs ul li > .doc p {
margin: 0;
}
.subs .subs p.src {
border: none;
background-color: #f8f8f8;
}
.subs .subs .caption {
margin-top: 1em ;
margin-bottom: 0px;
}
.subs p.caption {
margin-top: 0;
}
.subs .subs .caption + .src {
margin: 0px;
margin-top: 8px;
}
.subs .subs .src + .src {
margin: 7px 0 0 0;
}
/* Render short-style data instances */
.inst ul {
height: 100%;
padding: 0.5em;
margin: 0;
}
.inst, .inst li {
list-style: none;
margin-left: 1em;
}
/* Workaround for bug in Firefox (issue #384) */
.inst-left {
float: left;
}
.top p.src {
border-bottom: 3px solid #e5e5e5;
line-height: 2rem;
margin-bottom: 1em;
}
.warning {
color: red;
}
.arguments {
margin-top: -0.4em;
}
.arguments .caption {
display: none;
}
.fields { padding-left: 1em; }
.fields .caption { display: none; }
.fields p { margin: 0 0; }
/* this seems bulky to me
.methods, .constructors {
background: #f8f8f8;
border: 1px solid #eee;
}
*/
/* @end */
/* @group Auxillary Pages */
.extension-list {
list-style-type: none;
margin-left: 0;
}
#mini {
margin: 0 auto;
padding: 0 1em 1em;
}
#mini > * {
font-size: 93%; /* 12pt */
}
#mini #module-list .caption,
#mini #module-header .caption {
font-size: 125%; /* 15pt */
}
#mini #interface h1,
#mini #interface h2,
#mini #interface h3,
#mini #interface h4 {
font-size: 109%; /* 13pt */
margin: 1em 0 0;
}
#mini #interface .top,
#mini #interface .src {
margin: 0;
}
#mini #module-list ul {
list-style: none;
margin: 0;
}
#alphabet ul {
list-style: none;
padding: 0;
margin: 0.5em 0 0;
text-align: center;
}
#alphabet li {
display: inline;
margin: 0 0.25em;
}
#alphabet a {
font-weight: bold;
}
#index .caption,
#module-list .caption { font-size: 131%; /* 17pt */ }
#index table {
margin-left: 2em;
}
#index .src {
font-weight: bold;
}
#index .alt {
font-size: 77%; /* 10pt */
font-style: italic;
padding-left: 2em;
}
#index td + td {
padding-left: 1em;
}
#module-list ul {
list-style: none;
margin: 0 0 0 2em;
}
#module-list li {
clear: right;
}
#module-list span.collapser,
#module-list span.expander {
background-position: 0 0.3em;
}
#module-list .package {
float: right;
}
:target {
background: -webkit-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%);
background: -moz-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%);
background: -o-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%);
background: -ms-linear-gradient(top, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%);
background: linear-gradient(to bottom, transparent 0%, transparent 65%, #fbf36d 60%, #fbf36d 100%);
}
:target:hover {
background: -webkit-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%);
background: -moz-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%);
background: -o-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%);
background: -ms-linear-gradient(top, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%);
background: linear-gradient(to bottom, transparent 0%, transparent 0%, #fbf36d 0%, #fbf36d 100%);
}
/* @end */
/* @group Dropdown menus */
#preferences-menu, #style-menu {
width: 25em;
overflow-y: auto;
}
/* @end */

1
Docs/haskell/meta.json Normal file
View File

@@ -0,0 +1 @@
{"haddock_version":"2.29.2"}

BIN
Docs/haskell/p2prc.haddock Normal file

Binary file not shown.

221
Docs/haskell/quick-jump.css Normal file
View File

@@ -0,0 +1,221 @@
/* @group Fundamentals */
.hidden {
display: none;
}
/* @end */
/* @group Search box layout */
#search {
position: fixed;
top: 3.2em;
bottom: 0;
left: calc(50% - 22em);
width: 44em;
z-index: 1000;
overflow-y: auto;
}
@media only screen and (max-width: 999px) {
#search {
top: 5.7em;
}
}
#search-form, #search-results {
box-shadow: 2px 2px 6px rgb(199, 204, 208);
pointer-events: all;
}
#search-form input {
font-size: 1.25em; line-height: 2.3em; height: 2.4em;
display: block;
box-sizing: border-box;
width: 100%;
margin: 0;
padding: 0 0.75em;
border: 0.05em solid rgb(151, 179, 202);
}
#search input:focus {
outline: none;
}
#search p.error {
color: rgb(107, 24, 24);
font-weight: bold;
}
#search-results {
box-sizing: border-box;
border: 0.05em solid #b2d5fb;
background: #e8f3ff;
max-height: 80%;
overflow: scroll;
}
#search-form input + #search-results {
border-top: none;
top: 3em;
max-height: calc(100% - 3em);
}
/* @end */
/* @group search results */
#search-results > ul {
margin: 0;
list-style: none;
}
#search-results > ul > li,
#search-results > p,
#search-results > table {
padding: 0.5em 1em;
margin: 0;
}
#search-results > ul > li {
border-bottom: 1px solid #b2d5fb;
}
#search-results > ul > li > ul {
list-style: none;
}
.search-module h4 {
margin: 0;
}
.search-module > ul {
margin: 0.5em 0 0.5em 2em;
}
.search-module > ul > li > a[href] {
display: block;
color: inherit;
padding: 0.25em 0.5em;
}
.search-module > ul > li > a[href].active-link {
background: #faf9dc;
}
.search-module a[href]:hover {
text-decoration: none;
}
.search-result a a {
pointer-events: none;
}
.search-result ul.subs {
display: inline-block;
margin: 0; padding: 0;
}
.search-result ul.subs li {
display: none;
}
.search-result ul.subs::after {
display: inline-block;
content: "...";
color: rgb(78,98,114);
margin: 0 0.25em;
}
.more-results {
color: rgb(99, 141, 173);
position: relative;
}
.more-results::before {
content: "+";
display: inline-block;
color: #b2d5fb;
font-weight: bold;
font-size: 1.25em; line-height: inherit;
position: absolute;
left: -1em;
}
/* @end */
/* @group Keyboard shortcuts table */
.keyboard-shortcuts {
line-height: 1.6em;
}
.keyboard-shortcuts th {
color: rgb(78,98,114);
}
.keyboard-shortcuts td:first-child,
.keyboard-shortcuts th:first-child {
text-align: right;
padding-right: 0.6em;
}
.key {
display: inline-block;
font-size: 0.9em;
min-width: 0.8em; line-height: 1.2em;
text-align: center;
background: #b2d5fb;
border: 1px solid #74a3d6;
padding: 0 0.2em;
margin: 0 0.1em;
}
/* @end */
/* @group Dropdown menus */
/* Based on #search styling above. */
.dropdown-menu {
position: fixed;
/* Not robust to window size changes. */
top: 3.2em;
right: 0;
/* To display on top of synopsis menu on right side. */
z-index: 1000;
border: 0.05em solid #b2d5fb;
background: #e8f3ff;
}
@media only screen and (max-width: 999px) {
.dropdown-menu {
top: 5.7em;
}
}
.dropdown-menu * {
margin: 0.1em;
}
.dropdown-menu button {
border: 1px #5E5184 solid;
border-radius: 3px;
background: #5E5184;
padding: 3px;
color: #f4f4f4;
min-width: 6em;
}
.dropdown-menu button:hover {
color: #5E5184;
background: #f4f4f4;
}
.dropdown-menu button:active {
color: #f4f4f4;
background: #5E5184;
}
/* @end */

BIN
Docs/haskell/synopsis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

9
haskell/gen_docs.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
cabal haddock
rm -rf ../Docs/haskell
cp -r ./dist-newstyle/build/x86_64-linux/ghc-9.6.5/p2prc-0.1.0.0/doc/html/p2prc/ ../Docs/haskell

View File

@@ -15,7 +15,7 @@ import Error
)
import JSON
( IPAdressTable(..)
( IPAddressTable(..)
, MapPortResponse(..)
, P2prcConfig
)
@@ -33,12 +33,18 @@ import CLI
import Environment ( cleanEnvironment )
data P2PRCapi -- ^ Haskell API
= MkP2PRCapi -- ^ Main Constructor
{ startServer :: IOEitherError ProcessHandle -- ^ start server
-- | Lower level P2PRC Haskell api that exposes basic functionality necessary to joint the network.
data P2PRCapi
= MkP2PRCapi
{ startServer :: IOEitherError ProcessHandle
-- ^ Start server
, execInitConfig :: IOEitherError P2prcConfig
, execListServers :: IOEitherError IPAdressTable
-- ^ Instantiate server configuration
, execListServers :: IOEitherError IPAddressTable
-- ^ List servers in network
, execMapPort :: MapPortRequest -> IOEitherError MapPortResponse
-- ^ Exposes and associates a local TCP port with a remote DNS address
}
@@ -52,7 +58,9 @@ data MapPortRequest =
{-|
This function cleans the previous running state (ensuring a pure P2PRC runtime state) and builds up a conditional 'P2PRCapi' instance.
__The following example show how this function can be used to expose the runtime functionalities:__
==== __Example__
The following example show how this function can be used to expose the runtime functionalities:
@
example :: IOEitherError P2PRCapi

View File

@@ -45,7 +45,9 @@ import API
{-|
This function starts and bootstraps the P2PRC runtime that associates the a specific host's machine port to a DNS address to expose a certain application to the P2PRC network. You will only need to also import the 'MkMapPortRequest' data constructor to represent the this port request.
__This example demonstrates how it can be ran on the IO context:__
==== __Example__
This example demonstrates how it can be ran on the IO context:
@
example :: IO ()

View File

@@ -2,7 +2,7 @@
module JSON
( P2prcConfig(..)
, IPAdressTable(..)
, IPAddressTable(..)
, IPAddress(..)
, ServerInfo(..)
, MapPortResponse(..)
@@ -17,7 +17,7 @@ import qualified Data.Text as T
import Data.Aeson
-- {-# WARNING MapPortResponse "This newtype is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-}
{-# WARNING MapPortResponse "This newtype is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-}
-- ^ This represents P2PRC's response to the TCP port and DNS address allocation. This value will confirm the successful allocation and return information about it.
newtype MapPortResponse
@@ -39,31 +39,34 @@ instance FromJSON MapPortResponse where
{-# WARNING P2prcConfig "This type is unstable at the moment due to the P2PRC's library error handling bug. For more information visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114#issuecomment-2474737015" #-}
newtype P2prcConfig -- ^ Host P2prc configuration
= MkP2prConfig -- ^ Unique Constructor
-- | This represents the server configuration that defines its attributes and behaviours in the network, as well as, the location of the runtime persistence artifacts.
newtype P2prcConfig
= MkP2prConfig
{ machineName :: String -- ^ Machine Name
}
deriving Show
} deriving Show
-- , hostServerPort :: Int
-- , iPV6Address :: Maybe String
-- , proxyPort :: Maybe Int
-- , fRPServerPort :: Bool
-- , behindNAT :: Bool
-- , iPTableKey :: String
-- , bareMetal :: Bool
-- , customConfig :: String
--
-- , iPTable :: String -- File
-- , dockerContainers :: String -- Directory
-- , defaultDockerFile :: String -- Directory
-- , dockerRunLogs :: String -- Directory
-- , speedTestFile :: String -- File
-- , iPV6Address :: Maybe String
-- , pluginPath :: String -- Directory
-- , trackContainersPath :: String -- File
-- , hostServerPort :: Int
-- , proxyPort :: Maybe Int
-- , groupTrackContainersPath :: File
-- , fRPServerPort :: Bool
-- , behindNAT :: Bool
-- , iPTableKey :: String
-- , publicKeyFile :: String -- File
-- , privateKeyFile :: String -- File
-- , pemFile :: String -- File
-- , keyFile :: String -- File
-- , bareMetal :: Bool
-- , customConfig
-- , groupTrackContainersPath :: String -- File
-- TODO: p2prc API
@@ -106,42 +109,44 @@ instance FromJSON P2prcConfig where
parseJSON _ = mzero
{-# WARNING IPAdressTable "This newtype is highly unstable due to undergoing work on improving P2PRC's server api. For more information, visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114" #-}
{-# WARNING IPAddressTable "This newtype is highly unstable due to undergoing work on improving P2PRC's server api. For more information, visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114" #-}
-- | IP Table
newtype IPAdressTable
= MkIPAdressTable -- ^ Constructor
[ServerInfo] -- ^ List Servers
-- | This is a wrapper value that parses a json key value from the list of ip addresses in the network.
newtype IPAddressTable
= MkIPAddressTable -- ^ Wrapping constructor
[ServerInfo] -- ^ List current network servers
deriving Show
instance FromJSON IPAdressTable where
instance FromJSON IPAddressTable where
parseJSON = withObject "IPAdressTable" $
\ v ->
MkIPAdressTable <$> v .: "ip_address"
MkIPAddressTable <$> v .: "ip_address"
{-# WARNING ServerInfo "This type is highly unstable due to undergoing work on improving P2PRC's server api. For more information, visit: https://github.com/Akilan1999/p2p-rendering-computation/issues/114" #-}
{- |
This is a record that keeps track of the current state of every node in the network. It is crucial information required for orchestration strategies.
-}
data ServerInfo =
MkServerInfo
{ name :: T.Text
, ip :: IPAddress
, latency :: Int
, download :: Int
, upload :: Int
, serverPort :: Int
, bareMetalSSHPort :: Maybe Int
, nat :: Bool
, escapeImplementation :: Maybe T.Text
, customInformation :: Maybe T.Text
{ name :: T.Text -- ^ Machine name
, ip :: IPAddress -- ^ Machine IP address
, latency :: Int -- ^ Response latency
, download :: Int -- ^ Download speed
, upload :: Int -- ^ Upload speed
, serverPort :: Int -- ^ Server port number
, bareMetalSSHPort :: Maybe Int -- ^ SSH machine port number
, nat :: Bool -- ^ Checking if node is behind a NAT
, escapeImplementation :: Maybe T.Text -- ^ Type of NAT trasversal technique
, customInformation :: Maybe T.Text -- ^ Custom String information
}
deriving Show
-- | This is a simple representation of the IP address of nodes in the network.
data IPAddress
= MkIPv4 String
| MkIPv6 String
= MkIPv4 String -- ^ IP version 4 address
| MkIPv6 String -- ^ IP version 6 address
deriving Show

View File

@@ -50,14 +50,14 @@ module P2PRC
-- | This section gives an overview on the runtime and host machine interfaces.
, P2PRCapi(..)
, P2prcConfig(..)
, MapPortRequest(..)
, MapPortResponse(..)
-- ** Primitive data types
-- | These types represent the core data that is communicated between requests and the runtime.
, IPAdressTable(..)
, IPAddressTable(..)
, ServerInfo(..)
, IPAddress(..)
, MapPortRequest(..)
, MapPortResponse(..)
, Error(..)
-- ** Type Synonyms
@@ -72,7 +72,7 @@ import Engine
)
import JSON
( IPAdressTable(..)
( IPAddressTable(..)
, ServerInfo(..)
, IPAddress(..)
, MapPortResponse(..)