diff options
| author | 2024-08-31 21:28:42 -0500 | |
|---|---|---|
| committer | 2024-09-01 09:01:58 -0500 | |
| commit | 032fff5ad319b46a3dfaadfb56cdbe8bdc9f1a91 (patch) | |
| tree | a8212903dc6bab5b1f7329d49f8acd2e061dc31d /doc | |
| parent | Merge pull request #195 from CFiggers/patch-1 (diff) | |
Restructure existing docs
- Add `doc/api/`
- Add `doc/api/index.mdz`
- Move module pages into `doc/api/`
- Add `# Reference` and `@api-docs[../../spork/{{foo}}]` to bottom of
each module page
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/api/argparse.mdz (renamed from doc/argparse.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/base64.mdz (renamed from doc/base64.mdz) | 0 | ||||
| -rw-r--r-- | doc/api/data.mdz (renamed from doc/data.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/formatting.mdz (renamed from doc/formatting.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/generators.mdz (renamed from doc/generators.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/htmlgen.mdz (renamed from doc/htmlgen.mdz) | 3 | ||||
| -rw-r--r-- | doc/api/http.mdz (renamed from doc/http.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/index.mdz | 13 | ||||
| -rw-r--r-- | doc/api/math.mdz (renamed from doc/math.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/message-protocol.mdz (renamed from doc/message-protocol.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/misc.mdz (renamed from doc/misc.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/networked-repl.mdz (renamed from doc/networked-repl.mdz) | 5 | ||||
| -rw-r--r-- | doc/api/path.mdz (renamed from doc/path.mdz) | 1 | ||||
| -rw-r--r-- | doc/api/pgp.mdz (renamed from doc/pgp.mdz) | 4 | ||||
| -rw-r--r-- | doc/api/randgen.mdz (renamed from doc/randgen.mdz) | 6 | ||||
| -rw-r--r-- | doc/api/regex.mdz (renamed from doc/regex.mdz) | 6 | ||||
| -rw-r--r-- | doc/api/rpc-protocol.mdz (renamed from doc/rpc-protocol.mdz) | 5 | ||||
| -rw-r--r-- | doc/api/temple.mdz (renamed from doc/temple.mdz) | 5 | ||||
| -rw-r--r-- | doc/api/test.mdz (renamed from doc/test.mdz) | 4 | ||||
| -rw-r--r-- | doc/index.mdz | 11 |
20 files changed, 85 insertions, 10 deletions
diff --git a/doc/argparse.mdz b/doc/api/argparse.mdz index bb97e7b..87c6a0c 100644 --- a/doc/argparse.mdz +++ b/doc/api/argparse.mdz @@ -59,3 +59,7 @@ into an array, include @code`:default {:kind :accumulate}` in your arguments to @code`argparse`. Run @code`(doc argparse/argparse)` after importing for more information. + +## Reference + +@api-docs[../../spork/argparse] diff --git a/doc/base64.mdz b/doc/api/base64.mdz index ae0b8ee..ae0b8ee 100644 --- a/doc/base64.mdz +++ b/doc/api/base64.mdz diff --git a/doc/data.mdz b/doc/api/data.mdz index 0038e73..13f9bde 100644 --- a/doc/data.mdz +++ b/doc/api/data.mdz @@ -36,3 +36,7 @@ The return is @code`@[@{:a 1 :c @{:e 4}} @{:a 4 :c @{:e 5 :f 6}} @{:b 2 :c @{:d @li{the nested value of @code`:e` appears in both and is different in each one (so @code`:c` is a key in both the first and second returned table, containing the value @code`:e` with with each value set as seen in the first and second original structs), and} @li{the key/value pair @code`:f` 6 only appears in the latter original struct (so only the second returned table contains @code`:f` and its value).} } + +## Reference + +@api-docs[../../spork/data] diff --git a/doc/formatting.mdz b/doc/api/formatting.mdz index f5842a4..bd6821e 100644 --- a/doc/formatting.mdz +++ b/doc/api/formatting.mdz @@ -22,3 +22,7 @@ Provides a way to format Janet code strings and files. (fmt/format-file "main.janet") ``` + +## Reference + +@api-docs[../../spork/fmt] diff --git a/doc/generators.mdz b/doc/api/generators.mdz index 0817e26..30b2d67 100644 --- a/doc/generators.mdz +++ b/doc/api/generators.mdz @@ -134,3 +134,7 @@ Consume `s` into a new array. NB: this will create an infinite loop if `s` is an infinite generator! +## Reference + +@api-docs[../../spork/generators] + diff --git a/doc/htmlgen.mdz b/doc/api/htmlgen.mdz index 1c989ad..896ebe6 100644 --- a/doc/htmlgen.mdz +++ b/doc/api/htmlgen.mdz @@ -59,3 +59,6 @@ As you may see, the rules are straightforward, yet with the `fiber` and `function` types you have pretty endless possibilities when constructing the HTML code from data structures +## Reference + +@api-docs[../../spork/htmlgen] diff --git a/doc/http.mdz b/doc/api/http.mdz index b677e4e..2808fc2 100644 --- a/doc/http.mdz +++ b/doc/api/http.mdz @@ -34,3 +34,7 @@ many clients, servers, and connections at once. (def body (http/read-body response)) (print body) ``` + +## Reference + +@api-docs[../../spork/http] diff --git a/doc/api/index.mdz b/doc/api/index.mdz new file mode 100644 index 0000000..efa3cfe --- /dev/null +++ b/doc/api/index.mdz @@ -0,0 +1,13 @@ +{:title "Spork API" + :nav-title "API" + :template "mdzdoc/main.html"} +--- + +## Index + +@api-index[../../spork] + +## Reference + +@api-docs[../../spork] + diff --git a/doc/math.mdz b/doc/api/math.mdz index 9e06e7b..5bd09a1 100644 --- a/doc/math.mdz +++ b/doc/api/math.mdz @@ -340,3 +340,7 @@ and standard deviation `d`. Creates vector of length `c`, or matrix if `r` is provided, and fills it with zeros. +## Reference + +@api-docs[../../spork/math] + diff --git a/doc/message-protocol.mdz b/doc/api/message-protocol.mdz index b1b0884..3e87b63 100644 --- a/doc/message-protocol.mdz +++ b/doc/api/message-protocol.mdz @@ -20,3 +20,7 @@ level protocols on top of TCP. (send "blob1") (def blob-respose (recv)) ``` + +## Reference + +@api-docs[../../spork/msg] diff --git a/doc/misc.mdz b/doc/api/misc.mdz index 1af3694..f6b33be 100644 --- a/doc/misc.mdz +++ b/doc/api/misc.mdz @@ -322,3 +322,7 @@ array is not sorted beforehand, the results are undefined. Returns the array. (misc/insert-sorted-by @[1 2 3 5] identity 4) # => @[1 2 3 4 5] ``` + +## Reference + +@api-docs[../../spork/misc] diff --git a/doc/networked-repl.mdz b/doc/api/networked-repl.mdz index 87f2083..0305353 100644 --- a/doc/networked-repl.mdz +++ b/doc/api/networked-repl.mdz @@ -27,3 +27,8 @@ another machine or process. # Starts a nice terminal repl. (netrepl/client "127.0.0.1" "9000" "bob") ``` + +## Reference + +@api-docs[../../spork/netrepl] + diff --git a/doc/path.mdz b/doc/api/path.mdz index 2a74ce8..4284502 100644 --- a/doc/path.mdz +++ b/doc/api/path.mdz @@ -33,3 +33,4 @@ path/delim # -> ":" on posix, ";" on windows "a/nested/directory/with/a/few/children" "a/nested/directory/with/different/children") # -> "../../../different/children" ``` + diff --git a/doc/pgp.mdz b/doc/api/pgp.mdz index 35f430f..d448b96 100644 --- a/doc/pgp.mdz +++ b/doc/api/pgp.mdz @@ -47,3 +47,7 @@ Returns an array of hexs from the string with pgp words. # => @["01" "D1" "02" "EE" "F4" "F6"] ``` +## Reference + +@api-docs[../../spork/pgp] + diff --git a/doc/randgen.mdz b/doc/api/randgen.mdz index 903139e..429d113 100644 --- a/doc/randgen.mdz +++ b/doc/api/randgen.mdz @@ -18,3 +18,9 @@ randomly, and another is taken otherwise. (print "b") (print "c")) ``` + +## Reference + +@api-docs[../../spork/randgen] + + diff --git a/doc/regex.mdz b/doc/api/regex.mdz index c046a33..f21cacd 100644 --- a/doc/regex.mdz +++ b/doc/api/regex.mdz @@ -24,3 +24,9 @@ Supported regex features: Features found in other regex may never be added - for more complex usage, use Janet's native PEG library. + +## Reference + +@api-docs[../../spork/regex] + + diff --git a/doc/rpc-protocol.mdz b/doc/api/rpc-protocol.mdz index fe28bd3..ad413a2 100644 --- a/doc/rpc-protocol.mdz +++ b/doc/api/rpc-protocol.mdz @@ -36,3 +36,8 @@ A simple remote procedure call tool for Janet. # Close the underlying connection (:close c) ``` + +## Reference + +@api-docs[../../spork/rpc] + diff --git a/doc/temple.mdz b/doc/api/temple.mdz index 534a3e8..83ebfa4 100644 --- a/doc/temple.mdz +++ b/doc/api/temple.mdz @@ -48,3 +48,8 @@ output. There is one more involved example in /janet-lang/spork/examples/temple/. You can run it with @code`janet examples/temple/example.janet`. + +## Reference + +@api-docs[../../spork/temple] + diff --git a/doc/test.mdz b/doc/api/test.mdz index a57efb4..44f61b6 100644 --- a/doc/test.mdz +++ b/doc/api/test.mdz @@ -150,3 +150,7 @@ when the `path` is required. ✘ suppress-stderr does not have proper doc ``` +## Reference + +@api-docs[../../spork/test] + diff --git a/doc/index.mdz b/doc/index.mdz index 0759cc8..b4bfd57 100644 --- a/doc/index.mdz +++ b/doc/index.mdz @@ -1,8 +1,7 @@ {:title "Spork" :author "Calvin Rose" :license "MIT" - :template "mdzdoc/main.html" - :order 6} + :template "mdzdoc/main.html" } --- Spork is a utility library for Janet. It contains a number of small @@ -23,11 +22,3 @@ think of spork as a sort of extended standard library for Janet. ``` -## Index - -@api-index[../spork] - - -## Reference - -@api-docs[../spork] |
