diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-03 21:04:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-03 21:04:48 +0000 |
commit | d20905e40a1f1c00c8b4d268ecaafcef47953e7a (patch) | |
tree | 904da60a00b88366bbc0b5aef7adc62c08838164 /Master/texmf-dist/doc/support | |
parent | 14d1c94af4e8acce4d5d6854b6988834d8ab4dac (diff) |
make4ht (3may18)
git-svn-id: svn://tug.org/texlive/trunk@47598 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support')
-rw-r--r-- | Master/texmf-dist/doc/support/make4ht/README | 47 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/make4ht/changelog.tex | 65 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf | bin | 98011 -> 101276 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/make4ht/readme.tex | 50 |
4 files changed, 160 insertions, 2 deletions
diff --git a/Master/texmf-dist/doc/support/make4ht/README b/Master/texmf-dist/doc/support/make4ht/README index 924456189d8..6b9ba2e30cf 100644 --- a/Master/texmf-dist/doc/support/make4ht/README +++ b/Master/texmf-dist/doc/support/make4ht/README @@ -111,7 +111,7 @@ the output format name: Available extensions: -latexmk +latexmk_build : use `Latexmk` for \LaTeX\ compilation. @@ -135,6 +135,10 @@ mathjaxnode convert from MathML code to HTML + CSS or SVG. See [the available settings](#mathjaxsettings). +staticsite + +: build the document in form suitable for static site generators like [Jekyll](https://jekyllrb.com/). + # Build files `make4ht` supports build files. These are `Lua` scripts which can adjust @@ -366,6 +370,10 @@ mathjaxnode convert from MathML code to HTML + CSS or SVG. See [the available settings](#mathjaxsettings). +staticsite + +: create HTML file in format suitable for static site generators such as [Jekyll](https://jekyllrb.com/) + svg-height : some SVG images produced by `dvisvgm` seem to have wrong dimensions. This filter @@ -733,6 +741,43 @@ sentence\_match : Lua pattern used to match a sentence. Default value: `"([^%.^%?^!]*)([%.%?!]?)"`. +### The `staticsite` filter and extension + +site\_root + +: directory where generated files should be copied. + +map + +: table where keys are patterns that match filenames, value contains destination directoryfor matched files, relative to the `site_root` (it is possible to use `..` to swich to parent directory). + +file\_pattern + +: pattern used for filename generation. It is possible to use string templates and format strings for `os.date` function. Default value of `%Y-%m-%d-${input}` creates names in the form of `YYYY-MM-DD-file_name`. + +header + +: table with variables to be set in the YAML header in HTML files. If the table value is a function, it is executed with current parameters and HTML page DOM object as arguments. + +Example: + + + local outdir = os.getenv "blog_root" + + filter_settings "staticsite" { + site_root = outdir, + map = { + [".css$"] = "../css/" + }, + header = { + layout="post", + date = function(parameters, dom) + return os.date("!%Y-%m-%d %T", parameters.time) + end + } + } + + # Configuration file {#configfile} It is possible to globally modify the build settings using the configuration diff --git a/Master/texmf-dist/doc/support/make4ht/changelog.tex b/Master/texmf-dist/doc/support/make4ht/changelog.tex index 26614e59491..5200e488573 100644 --- a/Master/texmf-dist/doc/support/make4ht/changelog.tex +++ b/Master/texmf-dist/doc/support/make4ht/changelog.tex @@ -3,6 +3,71 @@ \begin{itemize} \item + 2018/05/03 + + \begin{itemize} + \tightlist + \item + renamed \texttt{latexmk} extension to \texttt{latexmk\_build}, due + to clash in TL + \end{itemize} +\item + 2018/04/18 + + \begin{itemize} + \tightlist + \item + \texttt{staticsite} extension: + + \begin{itemize} + \tightlist + \item + make YAML header configurable + \item + set the \texttt{time} and \texttt{updated} headers + \end{itemize} + \item + don't override existing tables in \texttt{filter\_settings} + \end{itemize} +\item + 2018/04/17 + + \begin{itemize} + \tightlist + \item + done first version of \texttt{staticsite} extension + \end{itemize} +\item + 2018/04/16 + + \begin{itemize} + \tightlist + \item + check for Git repo in the Makefile, don't run Git commands outside + of repo + \end{itemize} +\item + 2018/04/15 + + \begin{itemize} + \tightlist + \item + added \texttt{staticsite} filter + \item + working on \texttt{staticsite} extension + \end{itemize} +\item + 2018/04/13 + + \begin{itemize} + \tightlist + \item + use \texttt{ipairs} instead of \texttt{pairs} to traverse lists of + images and image match functions + \item + load extensions in the correct order + \end{itemize} +\item 2018/04/09 \begin{itemize} diff --git a/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf b/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf Binary files differindex fa9039865ce..910126cb313 100644 --- a/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf +++ b/Master/texmf-dist/doc/support/make4ht/make4ht-doc.pdf diff --git a/Master/texmf-dist/doc/support/make4ht/readme.tex b/Master/texmf-dist/doc/support/make4ht/readme.tex index df67a151b87..261e3f2b882 100644 --- a/Master/texmf-dist/doc/support/make4ht/readme.tex +++ b/Master/texmf-dist/doc/support/make4ht/readme.tex @@ -151,7 +151,7 @@ The extensions can be enabled or disabled by appending Available extensions: \begin{description} -\item[latexmk] +\item[latexmk\_build] use \texttt{Latexmk} for \LaTeX~compilation. \item[tidy] clean the \texttt{HTML} files using the \texttt{tidy} command. @@ -165,6 +165,9 @@ Clean the HTML file using DOM filters. It is more powerful than use \href{https://github.com/pkra/mathjax-node-page/}{mathjax-node-page} to convert from MathML code to HTML + CSS or SVG. See \protect\hyperlink{mathjaxsettings}{the available settings}. +\item[staticsite] +build the document in form suitable for static site generators like +\href{https://jekyllrb.com/}{Jekyll}. \end{description} \hypertarget{build-files}{% @@ -389,6 +392,9 @@ internal links, which results in validation error. use \href{https://github.com/pkra/mathjax-node-page/}{mathjax-node-page} to convert from MathML code to HTML + CSS or SVG. See \protect\hyperlink{mathjaxsettings}{the available settings}. +\item[staticsite] +create HTML file in format suitable for static site generators such as +\href{https://jekyllrb.com/}{Jekyll} \item[svg-height] some SVG images produced by \texttt{dvisvgm} seem to have wrong dimensions. This filter tries to set the correct image size. @@ -815,6 +821,48 @@ Lua pattern used to match a sentence. Default value: \texttt{"({[}\^{}\%.\^{}\%?\^{}!{]}*)({[}\%.\%?!{]}?)"}. \end{description} +\hypertarget{the-staticsite-filter-and-extension}{% +\subsubsection{\texorpdfstring{The \texttt{staticsite} filter and +extension}{The staticsite filter and extension}}\label{the-staticsite-filter-and-extension}} + +\begin{description} +\item[site\_root] +directory where generated files should be copied. +\item[map] +table where keys are patterns that match filenames, value contains +destination directoryfor matched files, relative to the +\texttt{site\_root} (it is possible to use \texttt{..} to swich to +parent directory). +\item[file\_pattern] +pattern used for filename generation. It is possible to use string +templates and format strings for \texttt{os.date} function. Default +value of \texttt{\%Y-\%m-\%d-\$\{input\}} creates names in the form of +\texttt{YYYY-MM-DD-file\_name}. +\item[header] +table with variables to be set in the YAML header in HTML files. If the +table value is a function, it is executed with current parameters and +HTML page DOM object as arguments. +\end{description} + +Example: + +\begin{verbatim} +local outdir = os.getenv "blog_root" + +filter_settings "staticsite" { + site_root = outdir, + map = { + [".css$"] = "../css/" + }, + header = { + layout="post", + date = function(parameters, dom) + return os.date("!%Y-%m-%d %T", parameters.time) + end + } +} +\end{verbatim} + \hypertarget{configfile}{% \section{Configuration file}\label{configfile}} |