mirror of
https://github.com/janet-lang/janet
synced 2025-02-02 18:29:10 +00:00
Update documentation.
This commit is contained in:
parent
131ee29190
commit
003472354d
@ -55,7 +55,12 @@ Documentation can be found in the doc directory of
|
||||
the repository. There is an introduction
|
||||
section contains a good overview of the language.
|
||||
|
||||
For individual bindings, use the `(doc symbol-name)` macro to get API
|
||||
API documentation for all bindings can also be generated
|
||||
with `make docs`, which will create `build/doc.html`, which
|
||||
can be viewed with any web browser. This
|
||||
includes all forms in the core library except special forms.
|
||||
|
||||
For individual bindings from within the REPL, use the `(doc symbol-name)` macro to get API
|
||||
documentation for the core library. For example,
|
||||
```
|
||||
(doc doc)
|
||||
|
@ -48,6 +48,16 @@ p {
|
||||
(buffer/push-byte buf byte)))
|
||||
buf)
|
||||
|
||||
(defn- make-title
|
||||
"Generate title"
|
||||
[]
|
||||
(string "<h1>Janet Core API</h1>"
|
||||
"<p>Version " janet/version "-" janet/build "</p>"
|
||||
"<p>Generated "
|
||||
(string/number (os/time) :f 0 20)
|
||||
" seconds after epoch</p>"
|
||||
"<hr>"))
|
||||
|
||||
(defn- emit-item
|
||||
"Generate documentation for one entry."
|
||||
[key env-entry]
|
||||
@ -68,4 +78,8 @@ p {
|
||||
:in (sort (pairs (table/getproto _env)))
|
||||
:when (and entry:doc (not entry:private))]
|
||||
(emit-item k entry)))
|
||||
(print prelude ;(interpose "<hr>" parts) postlude)
|
||||
(print
|
||||
prelude
|
||||
(make-title)
|
||||
;(interpose "<hr>" parts)
|
||||
postlude)
|
||||
|
Loading…
Reference in New Issue
Block a user