better docs

This commit is contained in:
2021-01-19 13:03:03 +01:00
parent 5c3368f953
commit b91b26f586
3 changed files with 21 additions and 42 deletions

View File

@@ -4,13 +4,13 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="../style.css">
</head>
<body>
<div class="content">
<div class="logo">
<a href="http://github.com/carp-lang/Carp">
<img src="logo.png">
<a href="">
<img src="">
</a>
<div class="title">
zlib
@@ -56,25 +56,6 @@ levels are defined in <a href="#ZLevel"><code>ZLib.ZLevel</code></a>, and are <c
default.</p>
</div>
<div class="binder">
<a class="anchor" href="#ZBytes">
<h3 id="ZBytes">
ZBytes
</h3>
</a>
<div class="description">
module
</div>
<p class="sig">
Module
</p>
<span>
</span>
<p class="doc">
</p>
</div>
<div class="binder">
<a class="anchor" href="#ZLevel">
<h3 id="ZLevel">
@@ -108,7 +89,7 @@ default.</p>
defn
</div>
<p class="sig">
(λ [&amp;String] (Result ZBytes String))
(Fn [(Ref String a)] (Result ZBytes String))
</p>
<pre class="args">
(deflate s)
@@ -132,7 +113,7 @@ well, and an <code>Error</code> returning an error message otherwise.</p>
defn
</div>
<p class="sig">
(λ [&amp;String, ZLevel] (Result ZBytes String))
(Fn [(Ref String a), ZLib.ZLevel] (Result ZBytes String))
</p>
<pre class="args">
(deflate-with s level)
@@ -155,7 +136,7 @@ well, and an <code>Error</code> returning an error message otherwise.</p>
defn
</div>
<p class="sig">
(λ [ZBytes] (Result String String))
(Fn [ZBytes] (Result String String))
</p>
<pre class="args">
(inflate s)

View File

@@ -1,13 +1,10 @@
(load "zlib.carp")
(defndynamic gendocs []
(do
(Project.config "title" "zlib")
(Project.config "docs-directory" "./docs/")
(Project.config "docs-logo" "")
(Project.config "docs-styling" "style.css")
(Project.config "docs-generate-index" false)
(save-docs ZLib)))
(Project.config "title" "zlib")
(Project.config "docs-directory" "./docs/")
(Project.config "docs-logo" "")
(Project.config "docs-styling" "../style.css")
(Project.config "docs-generate-index" false)
(save-docs ZLib)
(gendocs)
(quit)

View File

@@ -41,14 +41,13 @@ default.")
; i tried doing this in carp, but its a bit of a pain to wrap the API
; idiomatically, so for now youll only get regular inflation and deflation
(defmodule ZLib
(doc ZBytes "is an opaque bytes type with an associated length.")
(register-type ZBytes [
len Int
bytes String
])
(private ZBytes)
(hidden ZBytes)
(private ZRes)
(hidden ZRes)
(register-type ZRes)
(defmodule ZRes
(register ok? (Fn [&ZRes] Bool) "ZRes_is_ok")
@@ -56,12 +55,9 @@ default.")
(register str (Fn [ZRes] String) "ZRes_str")
(register err (Fn [ZRes] String) "ZRes_err")
)
(private ZRes)
(hidden ZRes)
(doc ZLevel "is a type used in conjunction with
[`deflate-with`](#deflate-with). It controls the compression level.
The constructors are `NoCompression`, `BestSpeed`, `BestCompression`, and
`DefaultCompression`, which is, well, the default.")
(deftype ZLevel
(NoCompression [])
(BestSpeed [])
@@ -76,6 +72,11 @@ The constructors are `NoCompression`, `BestSpeed`, `BestCompression`, and
(BestSpeed) 1
(BestCompression) 9
(DefaultCompression) -1)))
(doc ZLevel "is a type used in conjunction with
[`deflate-with`](#deflate-with). It controls the compression level.
The constructors are `NoCompression`, `BestSpeed`, `BestCompression`, and
`DefaultCompression`, which is, well, the default.")
(private inflate-)
(hidden inflate-)