|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file:
-- http://anggtwu.net/blogme3/maxima-index-html.lua.html
-- http://anggtwu.net/blogme3/maxima-index-html.lua
-- (find-angg "blogme3/maxima-index-html.lua")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
--
-- This file parses the file "maxima-index-html.lisp" and stores the
-- result in the table maxima_index_table. Here is a longer
-- explanation:
--
-- The correct way to htmlize a sexp hyperlink like this one,
-- (find-maximanode "subst")
-- is to make its target point to here,
-- https://maxima.sourceforge.io/docs/manual/maxima_33.html#subst
-- like in the index:
-- https://maxima.sourceforge.io/documentation.html
-- https://maxima.sourceforge.io/docs/manual/maxima_toc.html
-- https://maxima.sourceforge.io/docs/manual/maxima_423.html Appendix A: Index
-- So we need to do conversions like these ones:
-- "subst" -> "maxima_33.html#subst"
-- "subst" -> "https://maxima.sourceforge.io/docs/manual/maxima_33.html#subst"
-- When Maxima generates its html docs it puts the data for those
-- conversions in a file called "maxima-index-html.lisp". See:
-- (find-es "maxima" "maxima-git-5.47.0")
-- http://anggtwu.net/blogme3/maxima-index-html.lisp.html
-- The code in this file parses that file using this grammar,
-- (find-angg "LUA/Lisp4.lua")
-- and puts the result in the table maxima_index_table, that is used by:
-- (find-blogme3 "sandwiches-defs.lua" "find-maximanode")
Path.prependtopath "~/LUA/?.lua"
require "Lisp4" -- (find-angg "LUA/Lisp4.lua")
maxima_index_parse = function (bigstr)
local a,b = lisp4_parse(bigstr)
return b[2][1][2][1]
end
maxima_index_make_table = function (o, verbose)
local tbl = VTable {}
for i,abc in ipairs(o) do
local a,b,c = abc[1].s,abc[2].s,abc[3].s
if verbose then print(a,b,c) end
tbl[a] = b.."#"..c
end
return tbl
end
maxima_index_parse_all = function ()
local fname = "~/blogme3/maxima-index-html.lisp"
maxima_index_lisp = ee_readfile(fname) .. "\n"
maxima_index_parsed = maxima_index_parse(maxima_index_lisp)
maxima_index_table = maxima_index_make_table(maxima_index_parsed)
end
-- See: (find-es "maxima" "maxima-git-5.47.0")
-- (find-fline "~/blogme3/maxima-index-html.lisp")
maxima_index_fname = "~/blogme3/maxima-index-html.lisp"
if not maxima_index_table then
maxima_index_parse_all(maxima_index_fname)
end
--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "maxima-index-html.lua"
= maxima_index_lisp
o = maxima_index_parsed
= o[1]
= o[1][1]
= o[1][1].s
= maxima_index_table
--]]
-- Local Variables:
-- coding: utf-8-unix
-- End: