Skip to content

Commit

Permalink
Schema docs (#2219)
Browse files Browse the repository at this point in the history
* Leverage Schema naming conventions to generate a more concise documentation; skip external schemas (svg,xhtml); deal better with name wildcards and exclusions

* Careful about placement of \hypertarget for links

* Tweak formatting of description lists

* Tweak CSS color and placements for accessibility

* Enable latexml logging for genschema

* Fix formatting of completeness report

* Minor accessibilitoy tweaks

* minor schema documentation rearrangement

* update manual with reformatted schema documentation
  • Loading branch information
brucemiller authored Sep 28, 2023
1 parent 41dcd5e commit 2dab059
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 101 deletions.
2 changes: 1 addition & 1 deletion bin/latexml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Debug($@) if $@ ne $LaTeXML::Common::Error::DIE_MESSAGE;
my $code = $latexml && $latexml->getStatusCode;
my $status = $latexml && $latexml->getStatusMessage;
my $runtime = RunTime($starttime);
Note("Conversion " . ($code == 3 ? 'failed' : 'complete') . " " . $status . " (reqd. $runtime)");
Note("Conversion " . ($code == 3 ? 'failed' : 'complete') . ": " . $status . " (reqd. $runtime)");
UseLog(undef);

# Should this be within the withState ?
Expand Down
13 changes: 9 additions & 4 deletions doc/latexmldoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ body { margin:0; background:#cfd2e6; color:#000000; }
position:fixed; left:10px; top:10px; width:232px;
margin:0; padding:0;
font-weight: bold; font-size: 75%;
color:#a82ee6;
color:#7113a0;
overflow-x: hidden;
overflow-y: auto; max-height: 95vh;
z-index:10;
}
.ltx_page_navbar .ltx_para .ltx_p {
text-indent:0em;
}

/* overflow:hidden; z-index:10;*/

.ltx_page_navbar a {
color:#a82ee6;
color:#7113a0;
}
.ltx_page_main {
position:absolute; left:240px;
Expand Down Expand Up @@ -44,7 +48,8 @@ body { margin:0; background:#cfd2e6; color:#000000; }
border-bottom: 1px solid #701f99;
}
.ltx_page_header {
height: 30px; }
border:none;
}
.ltx_page_content {
margin:30px 0px 0 0; padding:10px;
background:#e6eaff;
Expand All @@ -58,7 +63,7 @@ body { margin:0; background:#cfd2e6; color:#000000; }
.ltx_title {
text-align:left;
margin:0;
color:#a82ee6;
color:#7113a0;
}
.ltx_subsection,
.ltx_paragraph {
Expand Down
3 changes: 3 additions & 0 deletions doc/manual/genschema
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use FindBin;
use Carp;
use Getopt::Long qw(:config no_ignore_case);
use Pod::Usage;
use lib "$FindBin::RealBin/../../blib/lib";
use LaTeXML::Common::Error;

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
my $WORKDIR = $FindBin::RealBin;
Expand All @@ -28,6 +30,7 @@ $SCHEMADOC = "$WORKDIR/schema.tex" unless $SCHEMADOC;
#======================================================================
#my $schemadoc = "$WORKDIR/schema.tex";
if ($force || (!-f $SCHEMADOC) || (-M $SCHEMADIR < -M $SCHEMADOC)) {
UseLog('genschema.log');
print "Converting Schema in $SCHEMADIR to LaTeX\n";
my $SCHEMAOUT;
open($SCHEMAOUT, '>', $SCHEMADOC) or die "Couldn't open $SCHEMADOC for output:$!";
Expand Down
6 changes: 3 additions & 3 deletions doc/manual/manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
\lxKeywords{LaTeXML, LaTeX to XML, LaTeX to HTML, LaTeX to MathML, LaTeX to ePub, converter}
%============================================================
\begin{lxNavbar}
\lxRef{top}{\includegraphics{../graphics/latexml}}\\
\includegraphics{../graphics/mascot}\\
\lxRef{top}{\includegraphics[alt={LaTeXML}]{../graphics/latexml}}\\
\includegraphics[alt={Sammy, the LaTeXML Mascot}]{../graphics/mascot}\\
\lxContextTOC
\end{lxNavbar}
%============================================================
Expand Down Expand Up @@ -112,7 +112,7 @@ \chapter{Introduction}\label{intro}
the DLMF project proceeded to develop their own tool, \LaTeXML, for this purpose.
%This document describes a \emph{preview} release of \LaTeXML.

\paragraph{Design Goals}\label{intro.goals} The idealistic goals of \LaTeXML\ are:
\paragraph{Design Goals}\label{intro.goals} The idealistic goals are:
\begin{itemize}
\item Faithful emulation of \TeX's behaviour;
\item Easily extensible;
Expand Down
17 changes: 4 additions & 13 deletions doc/sty/latexmlman.sty
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,8 @@
% \elementdef{name}{doc}{body}
\newcommand{\elementdef}[3]{
\item[\textit{Element }{\bfseries\schemafont #1}]
\hspace{1em}
\hypertarget{\cleanhypername{schema.#1}}{}%
\index{#1@{\schemafont #1}!element}%
#2
\hypertarget{\cleanhypername{schema.#1}}{#2}%
\index{#1@{\schemafont #1}!element}%
\ifx.#3.\else\begin{elementdescription}#3\end{elementdescription}\fi
}

Expand All @@ -204,28 +202,21 @@
% \patterndef{name}{doc}{body}
\newcommand{\patterndef}[3]{
\item[\textit{Pattern }{\bfseries\patternfont #1}]
\hspace{1em}
\hypertarget{\cleanhypername{schema.#1}}{}%
\hypertarget{\cleanhypername{schema.#1}}{#2}%
\test@elpattern{#1}\if@elpattern\else
\index{#1@{\patternfont #1}!schema pattern}\fi
#2
\ifx.#3.\else\begin{patterndescription}#3\end{patterndescription}\fi
}

% \patternadd{name}{doc}{body}
\newcommand{\patternadd}[3]{
\item[\textit{Add to }{\bfseries\patternfont #1}] \hspace{1em} #2
%% \item[\textit{Add to }%
%% \@ifundefined{defined.schema.#1}{\hypertarget{schema.#1}{{\bfseries\patternfont #1}}}{{\bfseries\patternfont #1}}
%% ] \hspace{1em} #2
\ifx.#3.\else\begin{patterndescription}#3\end{patterndescription}\fi
}

\newcommand{\patterndefadd}[3]{
\item[\textit{Add to }{\bfseries\patternfont #1}]
\hspace{1em}
\hypertarget{\cleanhypername{schema.#1}}{}%
#2
\hypertarget{\cleanhypername{schema.#1}}{#2}%
\ifx.#3.\else\begin{patterndescription}#3\end{patterndescription}\fi
}

Expand Down
Loading

0 comments on commit 2dab059

Please sign in to comment.