Updated docs

This commit is contained in:
rasmus-kirk
2024-03-04 13:37:51 +01:00
parent 324e23f527
commit f76b9bf1ca
3 changed files with 165 additions and 121 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ nixarr = {
# Setup SSH service that runs through VPN.
# Lets you connect through ssh from the internet without having access to
# port forwarding
openssh.vpn.enable = true;
openssh.expose.vpn.enable = true;
transmission = {
enable = true;
+39
View File
@@ -0,0 +1,39 @@
-- pandoc_indent_nix_blocks.lua
-- This Pandoc Lua filter indents all lines in code blocks by 2 spaces
-- TODO: This indents _all_ code blocks, not just example and default...
--if dump_debug then
-- local debug_file = io.open("pandoc_debug.log", "a")
--end
--
--function debug(msg)
-- if debug_file then
-- debug_file:write(msg .. "\n")
-- end
--end
function CodeBlock(block)
-- Check if the code block language is unmarked
if #block.classes == 0 then
-- Split the block text into lines
local lines = {}
for line in block.text:gmatch("[^\r\n]+") do
table.insert(lines, line)
end
-- Indent each line by 2 spaces
for i, line in ipairs(lines) do
lines[i] = " " .. line
end
-- Join the lines back together and update the block text
block.text = table.concat(lines, '\n')
-- Return the modified block
return block
end
end
return {
{CodeBlock = CodeBlock}
}
+17 -12
View File
@@ -53,10 +53,26 @@ in
"$file_path"
}
# Make home page
pandoc \
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
--standalone \
--highlight-style docs/pandoc/gruvbox.theme \
--template docs/pandoc/template.html \
--css docs/pandoc/style.css \
-V lang=en \
-V --mathjax \
-f markdown+smart \
-o $out/index.html \
README.md
# Make wiki pages
find docs/wiki -type f -name "*.md" | while IFS= read -r file; do
buildwiki "$file"
done
# Make options
cd $out
pandoc \
--standalone \
--metadata title="Nixarr - Option Documentation" \
@@ -64,6 +80,7 @@ in
--highlight-style docs/pandoc/gruvbox.theme \
--template docs/pandoc/template.html \
--css docs/pandoc/style.css \
--lua-filter docs/pandoc/lua/indent-code-blocks.lua \
--lua-filter docs/pandoc/lua/anchor-links.lua \
--lua-filter docs/pandoc/lua/code-default-to-nix.lua \
--lua-filter docs/pandoc/lua/remove-utils.lua \
@@ -76,17 +93,5 @@ in
-f markdown+smart \
-o $out/options.html \
"$tmpdir"/nixos-options.md
pandoc \
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
--standalone \
--highlight-style docs/pandoc/gruvbox.theme \
--template docs/pandoc/template.html \
--css docs/pandoc/style.css \
-V lang=en \
-V --mathjax \
-f markdown+smart \
-o $out/index.html \
README.md
'';
}