Commits

Philipp Gesang committed 5dc8c6f

urls in ldx comments; moved some lua tables up for sake of legibility

  • Participants
  • Parent commits 3bb1f58

Comments (0)

Files changed (1)

File ratiocinator.lua

 --environment.loadluafile("graph")
 
 --[[ldx--
-<p>Preloading functions from the lpeg namespace into local environment.</p>
+<p>Preloading functions from the <l n='lpeg'/> namespace into local environment.</p>
 --ldx]]--
 local C, Cb, Cc, Cg, Cmt, Cp, Cs, Ct 
     = lpeg.C, lpeg.Cb, lpeg.Cc, lpeg.Cg, lpeg.Cmt, lpeg.Cp, lpeg.Cs, lpeg.Ct
 --[[ldx--
 <p>
 Module initialization.
-Respecting the canonical <a
-href="http://www.ntg.nl/pipermail/ntg-context/2010/054982.html">namespace</a>
+Respecting the canonical namespace (cf.
+<type>http://www.ntg.nl/pipermail/ntg-context/2010/054982.html</type>)
 for modules.
 </p>
 --ldx]]--
 local report_rat = logs.reporter("ratiocinator", "module")
 
 local            rat = thirddata.ratiocinator
+           rat.graph = rat.graph or { }
 --local      notations = rat.notations
          rat.options = rat.options or { }
    rat.options.graph = rat.options.graph or { }
 end
 
 --[[ldx--
-<h1>Context Pretty Printing Functions</h1>
+<h1><l n='context'/> Pretty Printing Functions</h1>
 --ldx]]--
 do
     local get_atoms, tree, group, evaluate, complete_tt =
 
 --[[ldx--
 <h1>GraphViz Output</h1>
-<p>The <a href="http://luagraph.luaforge.net/">LuaGRAPH</a> library has to be
-installed for this to work.</p>
+<p>The LuaGRAPH (get it at <type>http://luagraph.luaforge.net/</type>) library
+has to be installed for this to work.</p>
 --ldx]]--
-rat.graph = { }
 do
     local cluster, edge, node = graph.cluster, graph.edge, graph.node
     local fmt = string.format
+    local graph_cache = { } -- cache for filenames
+
     local g = { }
 --[[ldx--
 <p>The function <type>rat.graph.dograph</type> recursively builds a syntax tree
 <p>For now this creates a valid dotfile that is fed to Luagraph’s
 <type>graph.read</type> function afterwards (equivalent to passing it to
 <em>dotty</em>). This entails lots of calls to <type>string.format</type> and
-string concatenation which is as of now unavoidable due to Luatex segfaulting
-with the Lua methods of the Luagraph library.</p>
+string concatenation which is as of now unavoidable due to <l n='luatex'/>
+segfaulting with the Lua methods of the Luagraph library.</p>
 --ldx]]--
     local function dograph (node, old_id)
         local onot = options.notation.output.to
         return rat.tmp_prefix .. "-" .. tmp_file_cnt
     end
 
-    local graph_cache = { } -- cache for filenames
-
     local c = context
     local function syntaxtree (expr)
         -- parameters like font and notation might change