1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-24 23:40:27 +00:00

Fix gendoc.

This commit is contained in:
Calvin Rose 2019-02-16 18:35:29 -05:00
parent c6f032340a
commit 53cc7ebd29

View File

@ -1,7 +1,5 @@
# Generate documentation
# TODO - make tool reusable
(def- prelude
```
<!doctype html>
@ -57,13 +55,28 @@
(buffer/push-byte buf byte)))
buf)
(def- months '("January" "February" "March" "April" "May" "June" "July" "August" "September"
"October" "November" "December"))
(defn nice-date
"Get the current date nicely formatted"
[]
(let [date (os/date)
M (months (date :month))
D (+ (date :month-day) 1)
Y (date :year)
HH (date :hours)
MM (date :minutes)
SS (date :seconds)]
(string/format "%s %d, %d at %.2d:%.2d:%.2d"
M D Y HH MM SS)))
(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)
"<p>Generated at "
(nice-date)
" seconds after epoch</p>"
"<hr>"))