aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-08-12 00:57:42 +0530
committerAkshay Nair <phenax5@gmail.com>2025-08-12 00:57:42 +0530
commit211e953db7775a1192a5535041e9abb7588bc5fa (patch)
treec902d10ee6985f285b71ac5359bc4e2b7d0816a8
parent0623db559013a321d3d87a064c0defb9e01763dc (diff)
downloadnull-browser-211e953db7775a1192a5535041e9abb7588bc5fa.tar.gz
null-browser-211e953db7775a1192a5535041e9abb7588bc5fa.zip
Move generated api reference dir
-rw-r--r--Makefile7
-rw-r--r--TODO.org3
-rw-r--r--docs/api/index.html (renamed from doc/index.html)84
-rw-r--r--docs/api/ldoc.css (renamed from doc/ldoc.css)0
-rw-r--r--docs/api/symbols.json (renamed from doc/symbols.json)2
-rw-r--r--flake.nix4
-rw-r--r--lua/null-browser/api.lua2
7 files changed, 97 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 1272245..74aea05 100644
--- a/Makefile
+++ b/Makefile
@@ -46,9 +46,16 @@ check: fmt
clang-tidy --config-file=.clang-tidy ./src/**/*.{hpp,cpp}
docs:
+ # API reference pages
ldoc -p null-browser -t "Null browser api" \
--merge --ignore --lls \
+ --dir ./docs/api \
./lua/null-browser/
+ # Symbols json
+ ldoc --merge --ignore --lls \
+ ./lua/null-browser/ \
+ --dir ./docs/api \
+ --filter ldoc_json_filter.lua;
# appimage:
# nix bundle --bundler github:ralismark/nix-appimage
diff --git a/TODO.org b/TODO.org
index c49e456..8ca498b 100644
--- a/TODO.org
+++ b/TODO.org
@@ -19,7 +19,7 @@
- [X] Vertical tabline ui
- [ ] Document events and event opts
- [ ] Update all api to use opts table pattern
-- [ ] Install doc/ in build
+- [ ] Install docs/ and assets/ in build
- [ ] web.keymap.configure_mode(modename, { passthrough = false })
- [ ] Fullscreen
- [ ] Zoom in/out/reset
@@ -27,6 +27,7 @@
- [ ] Api for enabling rpc api in view
- [ ] Make the asset/config/lua paths readable via lua
- [ ] json encode/decode
+- [ ] Fix path to symbols.json in web.help.get_items (use docs path)
** Bugs
- [ ] Closing webview should close devtools window
diff --git a/doc/index.html b/docs/api/index.html
index f357409..fa2ab5a 100644
--- a/doc/index.html
+++ b/docs/api/index.html
@@ -169,6 +169,14 @@
<td class="summary">TODO: Document</td>
</tr>
<tr>
+ <td class="name" nowrap><a href="#web.help.get_items">web.help.get_items ()</a></td>
+ <td class="summary">Get a list of items for help</td>
+ </tr>
+ <tr>
+ <td class="name" nowrap><a href="#web.help.show">web.help.show (item, opts)</a></td>
+ <td class="summary">Open help docs for a given item</td>
+ </tr>
+ <tr>
<td class="name" nowrap><a href="#web.utils.string_trim">web.utils.string_trim (str)</a></td>
<td class="summary">Trim whitespace from start and end of a string</td>
</tr>
@@ -184,6 +192,10 @@
<td class="name" nowrap><a href="#web.utils.equals">web.utils.equals (a, b)</a></td>
<td class="summary">Check if 2 values are deeply equal</td>
</tr>
+ <tr>
+ <td class="name" nowrap><a href="#web.utils.table_contains">web.utils.table_contains (tbl, value)</a></td>
+ <td class="summary">Check if table contains given value</td>
+ </tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
@@ -987,6 +999,47 @@ web.view.<span class="function-name">reload</span>({ view = <span class="number"
</dd>
<dt>
+ <a name = "web.help.get_items"></a>
+ <strong>web.help.get_items ()</strong>
+ </dt>
+ <dd>
+ Get a list of items for help
+
+
+
+
+
+
+
+</dd>
+ <dt>
+ <a name = "web.help.show"></a>
+ <strong>web.help.show (item, opts)</strong>
+ </dt>
+ <dd>
+ Open help docs for a given item
+
+
+ <h3>Parameters:</h3>
+ <ul>
+ <li><span class="parameter">item</span>
+ <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
+
+ </li>
+ <li><span class="parameter">opts</span>
+ <ul>
+ <li><span class="parameter">view</span>
+ number?
+ </li>
+ </li></ul>
+ </ul>
+
+
+
+
+
+</dd>
+ <dt>
<a name = "web.utils.string_trim"></a>
<strong>web.utils.string_trim (str)</strong>
</dt>
@@ -1098,6 +1151,37 @@ web.view.<span class="function-name">reload</span>({ view = <span class="number"
</dd>
+ <dt>
+ <a name = "web.utils.table_contains"></a>
+ <strong>web.utils.table_contains (tbl, value)</strong>
+ </dt>
+ <dd>
+ Check if table contains given value
+
+
+ <h3>Parameters:</h3>
+ <ul>
+ <li><span class="parameter">tbl</span>
+ <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
+
+ </li>
+ <li><span class="parameter">value</span>
+ <span class="types"><span class="type">any</span></span>
+
+ </li>
+ </ul>
+
+ <h3>Returns:</h3>
+ <ol>
+
+ <span class="types"><span class="type">boolean</span></span>
+
+ </ol>
+
+
+
+
+</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
diff --git a/doc/ldoc.css b/docs/api/ldoc.css
index f945ae7..f945ae7 100644
--- a/doc/ldoc.css
+++ b/docs/api/ldoc.css
diff --git a/doc/symbols.json b/docs/api/symbols.json
index 8766314..aa356c5 100644
--- a/doc/symbols.json
+++ b/docs/api/symbols.json
@@ -1 +1 @@
-["_G.__internals","schedule","web.keymap.set","web.keymap.set_mode","web.keymap.get_mode","web.view.close","web.view.create","web.view.current","web.view.list","web.view.select","web.view.set_url","web.view.set_html","web.view.run_js","web.view.reload","web.view.expose","web.view.open_devtools","web.view.current_index","web.event.add_listener","set","get","WebOpts","opts","web.history.back","web.history.forward","web.search.set_text","web.search.reset","web.search.get_text","web.search.next","web.search.previous","web.view.scroll","web.view.scroll_to_top","web.view.scroll_to_bottom","uv","inspect","web.utils.string_trim","web.utils.table_merge","web.utils.table_keys","web.utils.equals","web.utils.table_contains"] \ No newline at end of file
+["_G.__internals","schedule","web.keymap.set","web.keymap.set_mode","web.keymap.get_mode","web.view.close","web.view.create","web.view.current","web.view.list","web.view.select","web.view.set_url","web.view.set_html","web.view.run_js","web.view.reload","web.view.expose","web.view.open_devtools","web.view.current_index","web.event.add_listener","set","get","WebOpts","opts","web.history.back","web.history.forward","web.search.set_text","web.search.reset","web.search.get_text","web.search.next","web.search.previous","web.view.scroll","web.view.scroll_to_top","web.view.scroll_to_bottom","web.help.get_items","web.help.show","uv","inspect","web.utils.string_trim","web.utils.table_merge","web.utils.table_keys","web.utils.equals","web.utils.table_contains"] \ No newline at end of file
diff --git a/flake.nix b/flake.nix
index 95c7cb7..8125465 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,7 +17,7 @@
lua-libluv = pkgs.callPackage (import ./nix/libluv.nix) {
inherit (myPkgs) libuv luajit;
};
- # dkjson = pkgs.luajitPackages.dkjson;
+ dkjson = pkgs.luajitPackages.dkjson;
luassert = pkgs.luajitPackages.luassert;
# lua-busted = pkgs.luajitPackages.busted;
};
@@ -28,7 +28,7 @@
luajit
libuv
lua-libluv
- # dkjson
+ dkjson
luassert
# lua-busted
diff --git a/lua/null-browser/api.lua b/lua/null-browser/api.lua
index 4da1124..e06691e 100644
--- a/lua/null-browser/api.lua
+++ b/lua/null-browser/api.lua
@@ -362,7 +362,7 @@ web.decorations.right = create_decoration_api('right')
--- Get a list of items for help
function web.help.get_items()
-- TODO: Use proper path from build
- local file, _ = io.open('./doc/symbols.json', 'r')
+ local file, _ = io.open('./docs/api/symbols.json', 'r')
if file then
local contents, _ = file:read('a')
return web.json.decode(contents)