Fix: lit won't be a rock, but nat would be

This commit is contained in:
perro tuerto 2023-05-29 13:33:28 -07:00
parent eac9b36409
commit 1d6918d927
3 changed files with 8 additions and 23 deletions

9
dist/lin.min.lua vendored
View File

@ -7,14 +7,7 @@ Computable Pandoc:
require "fennel"
require "dog"
----------------------------------- NATURAL -----------------------------------
local nat = {}
function nat.get(str)
return str
end
require "nat"
---------------------------------- LITERATE ----------------------------------

View File

@ -20,14 +20,11 @@ local function make_dist(name, bundle)
-- Variables
local bundle = (bundle == nil or bundle == true)
local dist = pandoc.path.join({"dist", name})
local ext = chomp(optpath .. "dog.lua")
local fnl = chomp(optpath .. "fennel.lua")
local fnl = fnl:gsub("\nreturn mod\n", "\nlocal fnl = mod\n")
local pan = chomp("src/pandoc.lua")
local fnl = chomp(optpath .. "fennel.lua"):gsub("\nreturn mod\n", "\nlocal fnl = mod\n")
local dog = chomp(optpath .. "dog.lua")
local nat = chomp("src/natural.lua"):gsub("\nreturn nat\n", "")
local msg = ("src/locale.yaml"):readtext()
local lit = chomp("src/literate.lua"):gsub("\nreturn lit\n", "")
local lit = lit:gsub("#locale%(%)", msg)
local lit = chomp("src/literate.lua"):gsub("#locale%(%)", ("src/locale.yaml"):readtext())
local pan = chomp("src/pandoc.lua")
local license = string.strip([[
Computable Pandoc:
(C) 2023 perro hi@perrotuerto.blog
@ -46,18 +43,15 @@ Fennel:
]])
-- 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")
if bundle then
file:write("--[[\n", extralicense, "\n]]--\n")
file:write(fnl, ext)
file:write(fnl, dog, nat)
else
file:write("--[[\n", license, "\n]]--\n")
file:write('\nrequire "fennel"\nrequire "dog"\n')
file:write('\nrequire "fennel"\nrequire "dog"\nrequire "nat"\n')
end
file:write(nat, lit, pan)
file:write(lit, pan)
file:close()
end

View File

@ -286,5 +286,3 @@ function lit.exam(doc)
:walk { Code = function(inline) return insert(inline) end }
:walk { Pandoc = function(_) assert() end }
end
return lit