From e43eb1177872f52e949fb5f0f93396ed94b0d093 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 2 Aug 2026 14:48:29 +0200 Subject: move to chezmoi --- home/dot_local/share/bin/executable_dox-open | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 home/dot_local/share/bin/executable_dox-open (limited to 'home/dot_local/share/bin/executable_dox-open') diff --git a/home/dot_local/share/bin/executable_dox-open b/home/dot_local/share/bin/executable_dox-open new file mode 100644 index 0000000..493c435 --- /dev/null +++ b/home/dot_local/share/bin/executable_dox-open @@ -0,0 +1,31 @@ +#!/bin/node + +import { glob, readFile } from 'node:fs/promises'; +import { spawn } from 'node:child_process'; +import { argv, chdir, cwd } from 'node:process'; +import { join } from 'node:path'; + +argv.shift(); +argv.shift(); +chdir("search"); + +var symbols = {}; +for await (const chunk of glob('all_*.js')) { + const contents = await readFile(chunk); + const searchData = eval(`${contents}; searchData`); + const here = cwd(); + + for (const [ _id, [ symbol, ...entry ] ] of searchData) { + symbols[symbol] = entry.map(e => `file://${join(here, e[0])}`); + } +} + +for (const symbol of argv) { + if (!(symbol in symbols)) { + console.error(`No doxygen index for symbol \`${symbol}\``); + continue; + } + const urls = symbols[symbol]; + spawn('xdg-open', [ urls[0], ]); +} + -- cgit v1.2.3