texlive[71622] Master/texmf-dist: ideavault (25jun24)

commits+karl at tug.org commits+karl at tug.org
Tue Jun 25 22:00:03 CEST 2024


Revision: 71622
          https://tug.org/svn/texlive?view=revision&revision=71622
Author:   karl
Date:     2024-06-25 22:00:03 +0200 (Tue, 25 Jun 2024)
Log Message:
-----------
ideavault (25jun24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.pdf
    trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex
    trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
    trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty

Modified: trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex	2024-06-25 19:59:45 UTC (rev 71621)
+++ trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex	2024-06-25 20:00:03 UTC (rev 71622)
@@ -13,7 +13,8 @@
 \par This is what the Idea Vault is used for.
 
 \section{Dependencies}
-\par Idea Vault requires some packages (most of them for styling the printed idea).
+\par Lua\LaTeX --- this is Lua\LaTeX package and will not work without Lua.
+\par Additionally, Idea Vault requires some packages (most of them for styling the printed idea).
 \begin{itemize}
 \item \texttt{bookmark}
 \item \texttt{xargs}
@@ -33,7 +34,7 @@
 
 \subsection{\textbackslash{}createIdea}
 \begin{verbatim}
-\printIdea[prefix]{name}{content}[dependencies][tags][weight]
+\createIdea[prefix]{name}{content}[dependencies][tags][weight]
 \end{verbatim}
 \begin{itemize}
 \item \texttt{prefix}: prefix to locate the idea in. By default, equals to \texttt{default}.
@@ -84,7 +85,7 @@
 
 \par Example:
 \begin{verbatim}
-\printIdeaAllWithPrefix[somePrefix][lcbf]
+\printAllWithPrefix[somePrefix][lcbf]
 \end{verbatim}
 
 \subsection{\textbackslash{}printAllWithTag}
@@ -100,7 +101,7 @@
 
 \par Example:
 \begin{verbatim}
-\printIdeaAllWithTag[somePrefix][lcbf]{tag1}
+\printAllWithTag[somePrefix][lcbf]{tag1}
 \end{verbatim}
 
 \section{Style}
@@ -109,15 +110,32 @@
 \item \texttt{f}: Frame whole idea
 \item \texttt{c}: Center whole idea
 \item \texttt{b}: Create bookmark leading to the idea
-\item \texttt{l}: Use large font for the name
+\item \texttt{l}: Use Large font for the name
+\item \texttt{L}: Use LARGE font for the name
+\item \texttt{h}: Use huge font for the name
+\item \texttt{H}: Use Huge font for the name
 \item \texttt{s}: Reserve some space using needspace to avoid awkward pagebreaks
 \item \texttt{e}: emph the name
-\item \texttt{q}: do not print the name
+\item \texttt{q}: Do not print the name
 \item \texttt{p}: New page before printing the idea (useful when doing serial printing, for example via \texttt{printAllWithTag})
 \item \texttt{P}: New page after printing the idea (useful when doing serial printing, for example via \texttt{printAllWithTag})
 \end{itemize}
 
+\section{Debugging}
+\par By default, this package avoids spamming too much to stdout, but sometimes it would be useful to see what idea creation/printing is triggering some problems.
+\subsection{\textbackslash{}debugEnable}
+\begin{verbatim}
+\debugEnable
+\end{verbatim}
+\par Enables debug output --- remember, it may be quite overwhelming if there are a lot of ideas.
+\subsection{\textbackslash{}debugDisable}
+\begin{verbatim}
+\debugDisable
+\end{verbatim}
+\par Disables debug output. Debug output is disabled by default, so it's only use is to revert the effect of enabling it.
+
 \section{Example}
+\par This is short example of code, and it's result. Extended example can be found in file \texttt{example.tex}.
 \subsection{Code}
 \begin{verbatim}
 \createIdea[somePrefix]{Not So Great Idea}{

Modified: trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua	2024-06-25 19:59:45 UTC (rev 71621)
+++ trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua	2024-06-25 20:00:03 UTC (rev 71622)
@@ -15,6 +15,29 @@
 --
 -- This work consists of the files ideavault.sty and ideavault-lua.lua
 
+
+logErrorEnabled = true
+logWarnEnabled = true
+logDebugEnabled = false
+
+function logError(message)
+  if (logErrorEnabled) then
+    texio.write_nl("[ERROR] " .. message)
+  end
+end
+
+function logWarn(message)
+  if (logWarnEnabled) then
+    texio.write_nl("[WARN] " .. message)
+  end
+end
+
+function logDebug(message)
+  if (logDebugEnabled) then
+    texio.write_nl("[DEBUG] " .. message)
+  end
+end
+
 IdeaVaultClass = {}
 IdeaVaultClass.__index = IdeaVaultClass
 
@@ -186,12 +209,15 @@
 
 function IdeaClass:printSelf(style)
   style = style or ""
-  texio.write("Printing idea. Title: '" .. self:getTitle() .. "', style: '" .. style .. "'.\n")
+  logDebug("Printing idea. Title: '" .. self:getTitle() .. "', style: '" .. style .. "'.\n")
   
   local frame = false
   local center = false
   local bookmark = false
   local large = false
+  local Large = false
+  local huge = false
+  local Huge = false
   local needSpace = false
   local emph = false
   local quiet = false
@@ -206,7 +232,13 @@
     elseif (c == "b") then 
       bookmark = true 
     elseif (c == "l") then 
-      large = true 
+      large = true
+    elseif (c == "L") then
+      Large = true
+    elseif (c == "h") then
+      huge = true
+    elseif (c == "H") then
+      Huge = true
     elseif (c == "s") then 
       needSpace = true 
     elseif (c == "e") then 
@@ -247,23 +279,34 @@
   end
   if (not quiet)
   then
+    tex.sprint("{%")
     if (large) 
     then
-      tex.sprint("{\\Large%")
+      tex.sprint("\\Large%")
     end
+    if (Large)
+    then
+      tex.sprint("\\LARGE%")
+    end
+    if (huge)
+    then
+      tex.sprint("\\huge%")
+    end
+    if (Huge)
+    then
+      tex.sprint("\\Huge%")
+    end
     if (emph) 
     then
       tex.sprint("\\emph{,,")
     end
     tex.sprint(self:getTitle())
+    tex.sprint("\\nopagebreak%")
     if (emph) 
     then
       tex.sprint("''}%")
     end
-    if (large) 
-    then
-      tex.sprint("}%")
-    end
+    tex.sprint("}%")
   end
   if (center) 
   then
@@ -344,7 +387,7 @@
     t = t .. a .. ", "
   end
   t = t .. "]"
-  texio.write("Creating idea. Title: '" .. key .. "'. Prefix: '" .. prefix .. "', tags: " .. t .. ".\n")
+  logDebug("Creating idea. Title: '" .. key .. "'. Prefix: '" .. prefix .. "', tags: " .. t .. ".\n")
   deps = {}
   for _, val in pairs(dependencies)
   do
@@ -360,7 +403,7 @@
 
 function die(reason)
   reason = reason or "nil"
-  texio.write_nl("Critical error: " .. reason)
+  logError("Critical error: " .. reason)
   tex.error("Critical error: " .. reason)
 end
 

Modified: trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty	2024-06-25 19:59:45 UTC (rev 71621)
+++ trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty	2024-06-25 20:00:03 UTC (rev 71622)
@@ -17,7 +17,7 @@
 
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ideavault}[1.0.3]
+\ProvidesPackage{ideavault}[1.0.4]
 \RequirePackage[open,openlevel=2,atend]{bookmark}
 \RequirePackage{xargs}
 \RequirePackage{luacode}
@@ -57,6 +57,10 @@
 % #3: tag
 \newcommandx{\printAllWithTag}[3][1=default, 2=lcf]{\luadirect{ideaVault:printAllWithTag(\luastringN{#1}, \luastringN{#3}, \luastringN{#2})}}
 
+% Commands for managing debug output
+\newcommandx{\debugEnable}{\luadirect{logDebugEnabled = true}}
+\newcommandx{\debugDisable}{\luadirect{logDebugEnabled = false}}
+
 % Internal commands for managing bookmark depth
 \newcounter{bookmarkDepth}
 \newcommand{\bookDown}{\stepcounter{bookmarkDepth}}



More information about the tex-live-commits mailing list.