Fix: lit won't be a rock, but nat would be
This commit is contained in:
parent
eac9b36409
commit
1d6918d927
|
@ -7,14 +7,7 @@ Computable Pandoc:
|
||||||
|
|
||||||
require "fennel"
|
require "fennel"
|
||||||
require "dog"
|
require "dog"
|
||||||
|
require "nat"
|
||||||
----------------------------------- NATURAL -----------------------------------
|
|
||||||
|
|
||||||
local nat = {}
|
|
||||||
|
|
||||||
function nat.get(str)
|
|
||||||
return str
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------- LITERATE ----------------------------------
|
---------------------------------- LITERATE ----------------------------------
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,11 @@ local function make_dist(name, bundle)
|
||||||
-- Variables
|
-- Variables
|
||||||
local bundle = (bundle == nil or bundle == true)
|
local bundle = (bundle == nil or bundle == true)
|
||||||
local dist = pandoc.path.join({"dist", name})
|
local dist = pandoc.path.join({"dist", name})
|
||||||
local ext = chomp(optpath .. "dog.lua")
|
local fnl = chomp(optpath .. "fennel.lua"):gsub("\nreturn mod\n", "\nlocal fnl = mod\n")
|
||||||
local fnl = chomp(optpath .. "fennel.lua")
|
local dog = chomp(optpath .. "dog.lua")
|
||||||
local fnl = fnl:gsub("\nreturn mod\n", "\nlocal fnl = mod\n")
|
|
||||||
local pan = chomp("src/pandoc.lua")
|
|
||||||
local nat = chomp("src/natural.lua"):gsub("\nreturn nat\n", "")
|
local nat = chomp("src/natural.lua"):gsub("\nreturn nat\n", "")
|
||||||
local msg = ("src/locale.yaml"):readtext()
|
local lit = chomp("src/literate.lua"):gsub("#locale%(%)", ("src/locale.yaml"):readtext())
|
||||||
local lit = chomp("src/literate.lua"):gsub("\nreturn lit\n", "")
|
local pan = chomp("src/pandoc.lua")
|
||||||
local lit = lit:gsub("#locale%(%)", msg)
|
|
||||||
local license = string.strip([[
|
local license = string.strip([[
|
||||||
Computable Pandoc:
|
Computable Pandoc:
|
||||||
(C) 2023 perro hi@perrotuerto.blog
|
(C) 2023 perro hi@perrotuerto.blog
|
||||||
|
@ -46,18 +43,15 @@ Fennel:
|
||||||
]])
|
]])
|
||||||
|
|
||||||
-- Bundles Fennel and Computable Pandoc
|
-- Bundles Fennel and Computable Pandoc
|
||||||
-- TODO: lit and nat should be rocks and, therefore, should be:
|
|
||||||
-- added only in bundle
|
|
||||||
-- use 'require' in minimal
|
|
||||||
file = io.open(dist, "w")
|
file = io.open(dist, "w")
|
||||||
if bundle then
|
if bundle then
|
||||||
file:write("--[[\n", extralicense, "\n]]--\n")
|
file:write("--[[\n", extralicense, "\n]]--\n")
|
||||||
file:write(fnl, ext)
|
file:write(fnl, dog, nat)
|
||||||
else
|
else
|
||||||
file:write("--[[\n", license, "\n]]--\n")
|
file:write("--[[\n", license, "\n]]--\n")
|
||||||
file:write('\nrequire "fennel"\nrequire "dog"\n')
|
file:write('\nrequire "fennel"\nrequire "dog"\nrequire "nat"\n')
|
||||||
end
|
end
|
||||||
file:write(nat, lit, pan)
|
file:write(lit, pan)
|
||||||
file:close()
|
file:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -286,5 +286,3 @@ function lit.exam(doc)
|
||||||
:walk { Code = function(inline) return insert(inline) end }
|
:walk { Code = function(inline) return insert(inline) end }
|
||||||
:walk { Pandoc = function(_) assert() end }
|
:walk { Pandoc = function(_) assert() end }
|
||||||
end
|
end
|
||||||
|
|
||||||
return lit
|
|
||||||
|
|
Loading…
Reference in New Issue