尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Lua gadgets for Nitrogen XML Editor
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Gadgets are small Lua scripts in Nitrogen's Gadgets menu. Put a .lua
file in the gadgets folder next to nitrogenxml.exe, and it shows up in
the menu. Folders become submenus.
n picks a tab: -1 is the one to the left. Lua 5.4 with its full standard
library.
run can call anything on the machine, even Claude:
These come with Nitrogen, and an update overwrites them. Keep your own
gadgets in a folder of your own.查看完整 README ↗Gadgets are small Lua scripts in Nitrogen's Gadgets menu. Put a .lua
file in the gadgets folder next to nitrogenxml.exe, and it shows up in
the menu. Folders become submenus.
nitrogen.message("Hello World!")
nitrogen.text([n]) -- the whole text of the active tab
nitrogen.set_text(s) -- replace it (one undo step; does not save)
nitrogen.open_text(s [, name]) -- show s in a new tab (name: untitled.xml)
nitrogen.message(s) -- one dialog
nitrogen.file_name([n]) -- path of the active tab, or nil when unsaved
nitrogen.project() -- the project tree as XML, or nil when none
nitrogen.run(exe, args, stdin) -- returns stdout, stderr, exit code
nitrogen.temp_file(s [, ext]) -- writes s to a temp file (ext: .tmp), returns its path
nitrogen.dir() -- the folder nitrogenxml.exe is in
n picks a tab: -1 is the one to the left. In project(), every <dir>
and <file> has its name, and the root also has the project folder in
path.
Lua 5.4 with its full standard library.
run can call anything on the machine, even Claude:
local out, err, code = nitrogen.run("claude",
{ "-p", "Add an XSD annotation to every element." }, nitrogen.text())
if code == 0 then nitrogen.open_text(out, "answer.xml") end
These come with Nitrogen, and an update overwrites them. Keep your own gadgets in a folder of your own.
| File | What it does |
|---|---|
csv2xml.lua | CSV to XML |
json2xml.lua | JSON, JSON Lines or NDJSON to XML |
md2pdf.lua | Markdown to PDF, with pandoc and typst |
skelrng.lua | RELAX NG skeleton |
skelsch.lua | Schematron skeleton |
skelxml.lua | XML skeleton |
skelxsd.lua | XSD skeleton |
skelxslt1.lua | XSLT 1.0 skeleton |
charcount.lua | Counts characters, bytes and lines |
encrypt.lua | Encrypts the tab, after its first line, with the first line as the passphrase (repeating-key XOR, as hex) |
decrypt.lua | Decrypts it back, with the passphrase on the first line |
diff.lua | Compares the tab to its left with the active tab, as a unified diff |
encoding.lua | Guesses the encoding of the saved file |
lineends.lua | Counts CRLF, LF and CR in the saved file |
projectxml.lua | Opens the project tree as XML |
transform.lua | Applies the XSLT to the XML in the tab to its left, with xsltproc |
validatedtd.lua | DTD validation, with xmllint |
validaterng.lua | RELAX NG validation (.rng, not .rnc), with xmllint |
validatesch.lua | Schematron validation, with xsltproc and the ISO Schematron XSLT files in an sch folder next to nitrogenxml.exe |
validatexsd.lua | XSD validation, with xmllint |
viewsvg.lua | Opens the SVG in the tab with the default viewer |
viewx3d.lua | Opens the X3D in the tab with Castle Model Viewer |
xmlprettify.lua | Indents XML, with xmllint |