|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file:
-- http://anggtwu.net/LUA/C2Intro1.lua.html
-- http://anggtwu.net/LUA/C2Intro1.lua
-- (find-angg "LUA/C2Intro1.lua")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
--
-- (defun e () (interactive) (find-angg "LUA/C2Intro1.lua"))
Intro = Class {
type = "Intro",
from = function (fname)
local ii = Intro {}
local bigstr = ee_readfile(fname)
local bigstr2 = bigstr .. "\n\\newpage\n"
ii[0] = bigstr
for medstr in bigstr2:gmatch("(.-)\n\\newpage\n") do
table.insert(ii, medstr)
end
return ii
end,
__index = {
tag = function (ii,n) return ii[n]:match("«(.-)»") end,
},
}
--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "C2Intro1.lua"
ii = Intro.from "~/LATEX/2025-1-C2-intro.tex"
= ii[1]
= ii[2]
= ii[3]
= ii[4]
= ii:tag(4)
= ii:tag(42)
= #ii
tag = function (n) return ii[n]:match("«(.-)»") end
= tag(4)
pat = "\n\\newline\n"
= ii[0]:match(pat)
= #ii
= ii[0]
--]]
-- Local Variables:
-- coding: utf-8-unix
-- End: