[tex4ht-commits] [SCM] tex4ht updated: r369 - trunk/tests/scholarlyhtml

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Tue Jan 30 17:53:20 CET 2018


Author: michal_h21
Date: 2018-01-30 18:53:20 +0200 (Tue, 30 Jan 2018)
New Revision: 369

Modified:
   trunk/tests/scholarlyhtml/config.cfg
   trunk/tests/scholarlyhtml/elementstruct.sty
   trunk/tests/scholarlyhtml/testelements.tex
Log:
Some basic config

Modified: trunk/tests/scholarlyhtml/config.cfg
===================================================================
--- trunk/tests/scholarlyhtml/config.cfg	2018-01-29 14:59:25 UTC (rev 368)
+++ trunk/tests/scholarlyhtml/config.cfg	2018-01-30 16:53:20 UTC (rev 369)
@@ -1,4 +1,29 @@
 \RequirePackage{elementstruct}
-\Preamble{xhtml,html5}
+\Preamble{xhtml,html5,info}
+\NewLogicalBlock{textit}
+\SetBlockProperty{textit}{class}{textit}
+\Configure{textit}{\NoFonts\InlineElementStart{textit}{}}{\InlineElementEnd{textit}\EndNoFonts}
+
+\NewLogicalBlock{maketitle}
+\SetTag{maketitle}{header}
+
+\NewLogicalBlock{titlehead}
+\SetTag{titlehead}{h1}
+\SetBlockProperty{titlehead}{class}{titleHead}
+
+\catcode`\:=11
+\makeatletter
+\Configure{maketitle}{%
+{%
+\Configure{maketitle}{}{}{}{}%                                                                                                                                             
+%\Tag{AUTHORS+}{\@author}
+\Tag{TITLE+}{\@title}}
+
+\BlockElementStart{maketitle}{}}{\BlockElementEnd{maketitle}}{\NoFonts\BlockElementStart{titlehead}{}}{\BlockElementEnd{titlehead}\EndNoFonts}
+\makeatother
+\catcode`\:=12
+
+\def\twodigits#1{\ifnum#1<10 0\fi\the#1}
+\Configure{@HEAD}{\HCode{<meta property="published" content="\the\year-\twodigits\month-\twodigits\day" />}}
 \begin{document}
 \EndPreamble

Modified: trunk/tests/scholarlyhtml/elementstruct.sty
===================================================================
--- trunk/tests/scholarlyhtml/elementstruct.sty	2018-01-29 14:59:25 UTC (rev 368)
+++ trunk/tests/scholarlyhtml/elementstruct.sty	2018-01-30 16:53:20 UTC (rev 369)
@@ -1,39 +1,42 @@
 \ProvidesPackage{elementstruct}
-% stack structure. we need it for end tags
-\def\newstack#1{\def#1{}}
-\newcommand{\stack at item}[1]{\ERROR}
-\newcommand{\stack at push}[2]{%
-  \edef#1{%
-    \unexpanded{\stack at item{#2}}%
-    \unexpanded\expandafter{#1}%
-  }%
+
+
+% The following macro should not be used directly in the user
+% configurations. Higher level macros like \InlineTagStart 
+% should be used instead
+% #1 logical block name
+% #2 attributes used only for the current element
+\def\InsertTagStart#1#2{%
+  \edef\local at properties{\ifx\relax#2\relax\else\space#2\fi}
+  \HCode{<\get at tag{#1}\get at block@properties{#1}\local at properties>}%
 }
-\newcommand{\stack at pop}[2]{%
-  \ifx#1\@empty
-  \expandafter\stack at pop@error
-  \else
-  \expandafter\stack at pop@aux
-  \fi
-  #1#2%
+\def\InsertTagEnd#1{\HCode{</\get at tag{#1}>}}
+
+\long\def\InlineElementStart#1#2{\InsertTagStart{#1}{#2}}
+\long\def\InlineElementEnd#1{\InsertTagEnd{#1}}
+
+\long\def\BlockElementStart#1#2{\ifvmode\IgnorePar\fi\EndP\InsertTagStart{#1}{#2}}
+\long\def\BlockElementEnd#1#2{\ifvmode\IgnorePar\fi\EndP\InsertTagEnd{#1}}
+
+% define default values for a new logical block
+\def\NewLogicalBlock#1{%
+  \SetTag{#1}{span}%
+  \expandafter\def\csname #1:properties\endcsname{}
 }
-\newcommand{\stack at pop@error}[2]{%
-  \PackageError{mystackpackage}
-  {Cannot pop from empty stack #1}
-  {Some more text!}%
+
+\def\SetTag#1#2{\expandafter\xdef\csname #1:tagname\endcsname{#2}}
+\def\get at tag#1{\expandafter\expandafter\csname #1:tagname\endcsname}
+
+\def\SetBlockProperty#1#2#3{%
+  \expandafter\ifcsname #1:property:#2\endcsname\else%
+  \expandafter\edef\csname #1:properties\endcsname{\csname #1:properties\endcsname\space\csname #1:property:#2\endcsname }
+  \fi%
+  \expandafter\def\csname #1:property:#2\endcsname{#2="#3"}
 }
-\newcommand{\stack at pop@aux}[2]{%
-  \expandafter\stack at pop@aux at ii#1\q at stop#1#2%
+
+\def\get at block@properties#1{%
+\expandafter\csname #1:properties\endcsname%
 }
-\long\def\stack at pop@aux at ii\stack at item#1#2\q at stop#3#4{%
-  \def#3{#2}%
-  \def#4{#1}%
-}
 
-\newstack\endtag
 
-% basic command for block insertion
-% the three arguments are: logical block name
-% \def\inserttag
-
-
 \endinput

Modified: trunk/tests/scholarlyhtml/testelements.tex
===================================================================
--- trunk/tests/scholarlyhtml/testelements.tex	2018-01-29 14:59:25 UTC (rev 368)
+++ trunk/tests/scholarlyhtml/testelements.tex	2018-01-30 16:53:20 UTC (rev 369)
@@ -1,6 +1,6 @@
 \documentclass{article}
 \title{Scholarly HTML sample}
-\author{Michal Hoftich}
+\author{Michal Hoftich \and others}
 \usepackage{biblatex}
 \addbibresource{scholarly.bib}
 \begin{document}
@@ -9,7 +9,7 @@
 
 \section{Introduction}
 
-This is a test file for \cite{scholarly}
+This is a \textit{test file} for \cite{scholarly}
 
 \printbibliography
 



More information about the tex4ht-commits mailing list