mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-05 18:42:04 +00:00
Compare commits
3 Commits
6514c8c937
...
88dec05bbb
Author | SHA1 | Date | |
---|---|---|---|
88dec05bbb | |||
38b909bb54 | |||
681d45f892 |
8
.github/workflows/docs.yml
vendored
8
.github/workflows/docs.yml
vendored
@ -11,8 +11,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-go@v5
|
- 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
|
run: go run cmd/docgen/docgen.go
|
||||||
|
- name: Run docgen (lua-written)
|
||||||
|
run: ./hilbish cmd/docgen/docgen.lua
|
||||||
- name: Commit new docs
|
- name: Commit new docs
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
with:
|
with:
|
||||||
|
@ -116,12 +116,17 @@ for iface, dps in pairs(pieces) do
|
|||||||
local newOrNotNature = exists and mod ~= 'nature'
|
local newOrNotNature = exists and mod ~= 'nature'
|
||||||
|
|
||||||
local f <close> = io.open(path, newOrNotNature and 'r+' or 'w+')
|
local f <close> = io.open(path, newOrNotNature and 'r+' or 'w+')
|
||||||
|
local tocPos
|
||||||
if not newOrNotNature then
|
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))
|
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
|
if descriptions[iface] and #descriptions[iface] > 0 then
|
||||||
table.remove(descriptions[iface], 1)
|
table.remove(descriptions[iface], 1)
|
||||||
f:write(string.format('\n## Introduction\n%s\n\n', table.concat(descriptions[iface], '\n')))
|
f:write(string.format('\n## Introduction\n%s\n\n', table.concat(descriptions[iface], '\n')))
|
||||||
f:write('## Functions\n')
|
f:write('## Functions\n')
|
||||||
|
f:write([[|||
|
||||||
|
|----|----|
|
||||||
|
]])
|
||||||
|
tocPos = f:seek()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
print(f)
|
print(f)
|
||||||
@ -129,7 +134,6 @@ for iface, dps in pairs(pieces) do
|
|||||||
print('mod and path:', mod, path)
|
print('mod and path:', mod, path)
|
||||||
|
|
||||||
local tocSearch = false
|
local tocSearch = false
|
||||||
local tocPos
|
|
||||||
for line in f:lines() do
|
for line in f:lines() do
|
||||||
if line:match '^## Functions' then
|
if line:match '^## Functions' then
|
||||||
tocSearch = true
|
tocSearch = true
|
||||||
|
@ -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.
|
`read` (boolean): Whether the full message has been read or not.
|
||||||
|
|
||||||
## Functions
|
## 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>
|
<hr>
|
||||||
<div id='all'>
|
<div id='all'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
|
@ -13,6 +13,13 @@ The dirs module defines a small set of functions to store and manage
|
|||||||
directories.
|
directories.
|
||||||
|
|
||||||
## Functions
|
## 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>
|
<hr>
|
||||||
<div id='setOld'>
|
<div id='setOld'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
|
@ -15,6 +15,11 @@ This is only documented for the sake of it. It's only intended use
|
|||||||
is by the Greenhouse pager.
|
is by the Greenhouse pager.
|
||||||
|
|
||||||
## Functions
|
## 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>
|
<hr>
|
||||||
<div id='renderInfoBlock'>
|
<div id='renderInfoBlock'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user