2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-06 19:12:02 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
88dec05bbb
ci: add lua docgen 2025-03-19 22:23:12 -04:00
38b909bb54
fix: add table heading 2025-03-19 22:09:49 -04:00
681d45f892
feat: generate toc for lua modules 2025-03-19 22:06:18 -04:00
5 changed files with 33 additions and 2 deletions

View File

@ -11,8 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Run docgen
- name: Download Task
run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d'
- name: Build
run: ./bin/task
- name: Run docgen (go-written)
run: go run cmd/docgen/docgen.go
- name: Run docgen (lua-written)
run: ./hilbish cmd/docgen/docgen.lua
- name: Commit new docs
uses: stefanzweifel/git-auto-commit-action@v4
with:

View File

@ -116,12 +116,17 @@ for iface, dps in pairs(pieces) do
local newOrNotNature = exists and mod ~= 'nature'
local f <close> = io.open(path, newOrNotNature and 'r+' or 'w+')
local tocPos
if not newOrNotNature then
f:write(string.format(header, 'Module', iface, (descriptions[iface] and #descriptions[iface] > 0) and descriptions[iface][1] or 'No description.', docParent))
if descriptions[iface] and #descriptions[iface] > 0 then
table.remove(descriptions[iface], 1)
f:write(string.format('\n## Introduction\n%s\n\n', table.concat(descriptions[iface], '\n')))
f:write('## Functions\n')
f:write([[|||
|----|----|
]])
tocPos = f:seek()
end
end
print(f)
@ -129,7 +134,6 @@ for iface, dps in pairs(pieces) do
print('mod and path:', mod, path)
local tocSearch = false
local tocPos
for line in f:lines() do
if line:match '^## Functions' then
tocSearch = true

View File

@ -20,6 +20,15 @@ The `hilbish.message` type is a table with the following keys:
`read` (boolean): Whether the full message has been read or not.
## Functions
|||
|----|----|
|<a href="#unreadCount">unreadCount()</a>|Returns the amount of unread messages.|
|<a href="#readAll">readAll()</a>|Marks all messages as read.|
|<a href="#send">send(message)</a>|Sends a message.|
|<a href="#read">read(idx)</a>|Marks a message at `idx` as read.|
|<a href="#delete">delete(idx)</a>|Deletes the message at `idx`.|
|<a href="#clear">clear()</a>|Deletes all messages.|
|<a href="#all">all()</a>|Returns all messages.|
<hr>
<div id='all'>
<h4 class='heading'>

View File

@ -13,6 +13,13 @@ The dirs module defines a small set of functions to store and manage
directories.
## Functions
|||
|----|----|
|<a href="#recent">recent(idx)</a>|Get entry from recent directories list based on index.|
|<a href="#pop">pop(num)</a>|Remove the specified amount of dirs from the recent directories list.|
|<a href="#peak">peak(num)</a>|Look at `num` amount of recent directories, starting from the latest.|
|<a href="#push">push(dir)</a>|Add `dir` to the recent directories list.|
|<a href="#setOld">setOld(d)</a>|Sets the old directory string.|
<hr>
<div id='setOld'>
<h4 class='heading'>

View File

@ -15,6 +15,11 @@ This is only documented for the sake of it. It's only intended use
is by the Greenhouse pager.
## Functions
|||
|----|----|
|<a href="#renderCodeBlock">renderCodeBlock(text)</a>|Assembles and renders a code block. This returns|
|<a href="#highlight">highlight(text)</a>|Performs basic Lua code highlighting.|
|<a href="#renderInfoBlock">renderInfoBlock(type, text)</a>|Renders an info block. An info block is a block of text with|
<hr>
<div id='renderInfoBlock'>
<h4 class='heading'>