From 665af3399312986fdbe214f8c535c7a9c13a52e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Novotn=C3=BD?= Date: Mon, 19 Feb 2018 20:16:40 +0100 Subject: [PATCH] Rename \markdownOptionStripPercentSign -> \...s Test \markdownOptionStripPercentSign by adding markdown to documentation Closes #26 --- Makefile | 11 ++++++----- README.md | 8 ++++---- latexmkrc | 4 ++++ markdown.dtx | 19 +++++++++++-------- ...-sign.test => no-strip-percent-signs.test} | 4 ++-- 5 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 latexmkrc rename tests/testfiles/lunamark-markdown/{no-strip-percent-sign.test => no-strip-percent-signs.test} (67%) diff --git a/Makefile b/Makefile index 6c3fd6fe2..41e2a48ea 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ .PHONY: all clean implode dist docs test SUBDIRECTORIES=examples AUXFILES=markdown.bbl markdown.cb markdown.cb2 markdown.glo markdown.bbl \ - markdown.run.xml markdown.bib -AUXDIRS=_minted-markdown + markdown.run.xml markdown.bib markdown.markdown.in markdown.markdown.lua \ + markdown.markdown.out +AUXDIRS=_minted-markdown _markdown_markdown TDSARCHIVE=markdown.tds.zip CTANARCHIVE=markdown.ctan.zip DISTARCHIVE=markdown.zip @@ -13,7 +14,7 @@ EXAMPLES=examples/context-mkii.pdf examples/context-mkiv.pdf \ examples/latex-luatex.pdf examples/latex-pdftex.pdf TESTS=tests/test.sh tests/support/*.tex tests/templates/*/*.tex.m4 \ tests/templates/*/COMMANDS.m4 tests/testfiles/*/*.test -MAKES=Makefile $(addsuffix /Makefile, $(SUBDIRECTORIES)) +MAKES=Makefile $(addsuffix /Makefile, $(SUBDIRECTORIES)) latexmkrc READMES=README.md LICENSE VERSION examples/README.md tests/README.md \ tests/support/README.md tests/templates/README.md tests/testfiles/README.md \ tests/templates/*/README.md tests/testfiles/*/README.md @@ -39,8 +40,8 @@ $(INSTALLABLES) $(USER_MANUAL): $(INSTALLER) $(DTXARCHIVE) xetex $< # This target typesets the manual. -$(TECHNICAL_DOCUMENTATION): $(DTXARCHIVE) - latexmk -pdf $< +$(TECHNICAL_DOCUMENTATION): $(DTXARCHIVE) $(INSTALLABLES) + latexmk $< # This target typesets the examples. $(EXAMPLES): $(EXAMPLE_SOURCES) $(INSTALLABLES) diff --git a/README.md b/README.md index c650dab1c..fa0b49a54 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ boundaries between the produced files are marked up using a XML-like syntax provided by the [DocStrip][] plain TeX package. Running the [LaTeXMK][LaTeXMK] tool on the `markdown.dtx` file -(`latexmk -pdf markdown.dtx`) typesets the documentation. In `markdown.dtx`, -the documentation is placed inside TeX comments and marked up using the +(`latexmk markdown.dtx`) typesets the documentation. In `markdown.dtx`, the +documentation is placed inside TeX comments and marked up using the [ltxdockit][] LaTeX document class. Support for typesetting the documentation is provided by the [doc][] LaTeX package. @@ -70,8 +70,8 @@ For further information, consult: 1. the technical documentation, which can be typeset by running the [LaTeXMK][LaTeXMK] tool on the `markdown.dtx` file - (`latexmk -pdf markdown.dtx`). [LaTeXMK][LaTeXMK] should be included in your - TeX distribution. The typeset documentation will reside in the file + (`latexmk markdown.dtx`). [LaTeXMK][LaTeXMK] should be included in your TeX + distribution. The typeset documentation will reside in the file `markdown.pdf`, and 2. the user manual, which can be produced by interpreting the `markdown.ins` file using a Unicode-aware TeX engine, such as XeTeX (`xetex markdown.ins`) diff --git a/latexmkrc b/latexmkrc new file mode 100644 index 000000000..dacd5fd3e --- /dev/null +++ b/latexmkrc @@ -0,0 +1,4 @@ +$pdflatex = 'pdflatex --shell-escape %O %S'; +$pdf_mode = 1; +$postscript_mode = 0; +$dvi_mode = 0; diff --git a/markdown.dtx b/markdown.dtx index 7a06ac96e..17547e1d7 100644 --- a/markdown.dtx +++ b/markdown.dtx @@ -6,6 +6,7 @@ \usepackage[T1]{fontenc} \usepackage[american]{babel} \usepackage{microtype} +\usepackage[stripPercentSigns]{markdown} \usepackage{amsmath} \usepackage{fancyvrb} \usepackage{hologo} @@ -154,9 +155,11 @@ % Section \ref{sec:implementation} describes the implementation of the package. % It is aimed at the developer of the package and the curious user. % +% \begin{markdown} % The technical documentation contains only a limited amount of tutorials and % code examples. Please refer to the user guide distributed along with the % package for more of these. +% \end{markdown} % % \iffalse %<*manual> @@ -961,14 +964,14 @@ defaultOptions.underscores = true % \end{macrocode} % % \paragraph{Miscellaneous options} -% The \mdef{markdownOptionStripPercentSign} macro controls whether a percent +% The \mdef{markdownOptionStripPercentSigns} macro controls whether a percent % sign (\t`\%`) at the beginning of a line will be discarded when buffering % Markdown input (see Section~\ref{sec:buffering}) or not. Notably, this % enables the use of markdown when writing \TeX{} package documentation using % the Doc \LaTeX{}~package~\cite{mittelbach17} or similar. The recognized % values of the macro are \t`true` (discard), and \t`false` (retain). % \begin{macrocode} -\def\markdownOptionStripPercentSign{false}% +\def\markdownOptionStripPercentSigns{false}% % \end{macrocode} % % The \mdef{markdownIfOption}\t`\{`\meta{name}\t`\}` macro is provided for @@ -1755,8 +1758,8 @@ defaultOptions.underscores = true \def\markdownOptionTightLists{#1}}% \define@key{markdownOptions}{underscores}[true]{% \def\markdownOptionUnderscores{#1}}% -\define@key{markdownOptions}{stripPercentSign}[true]{% - \def\markdownOptionStripPercentSign{#1}}% +\define@key{markdownOptions}{stripPercentSigns}[true]{% + \def\markdownOptionStripPercentSigns{#1}}% % \end{macrocode} % % The following example \LaTeX{} code showcases a possible configuration of @@ -4678,7 +4681,7 @@ local convert = md.new(\markdownLuaOptions) % we can use the backslash as an ordinary character inside the macro definition. % Likewise, swap the character codes of the percent sign (\t`\%`) and the % ampersand (\t`@`), so that we can remove percent signs from the beginning of -% lines when \cs{markdownOptionStripPercentSign} is \t`true`. +% lines when \cs{markdownOptionStripPercentSigns} is \t`true`. % \begin{macrocode} \catcode`\^^M=13% \catcode`\^^I=13% @@ -4706,15 +4709,15 @@ local convert = md.new(\markdownLuaOptions) |catcode`| =12@ |markdownMakeOther@ % \end{macrocode} -% The \mdef{markdownReadAndConvertStripPercentSign} macro will process the +% The \mdef{markdownReadAndConvertStripPercentSigns} macro will process the % individual lines of output, stipping away leading percent signs (\t`\%`) when -% \cs{markdownOptionStripPercentSign} is \t`true`. +% \cs{markdownOptionStripPercentSigns} is \t`true`. % Notice the use of the comments (\t`@`) to ensure that the entire macro is at % a single line and therefore no (active) newline symbols % (\t`\textasciicircum\textasciicircum M`) are produced. % \begin{macrocode} |def|markdownReadAndConvertStripPercentSign##1{@ - |markdownIfOption{StripPercentSign}@ + |markdownIfOption{StripPercentSigns}@ |if##1%@ |expandafter|expandafter|expandafter@ |markdownReadAndConvertProcessLine@ diff --git a/tests/testfiles/lunamark-markdown/no-strip-percent-sign.test b/tests/testfiles/lunamark-markdown/no-strip-percent-signs.test similarity index 67% rename from tests/testfiles/lunamark-markdown/no-strip-percent-sign.test rename to tests/testfiles/lunamark-markdown/no-strip-percent-signs.test index 50861d3d8..a077a44db 100644 --- a/tests/testfiles/lunamark-markdown/no-strip-percent-sign.test +++ b/tests/testfiles/lunamark-markdown/no-strip-percent-signs.test @@ -1,10 +1,10 @@ <<< -This test ensures that the plain TeX `stripPercentSign` option is disabled by +This test ensures that the plain TeX `stripPercentSigns` option is disabled by default. The following emphasized text *should contain the percent sign at the % beginning of the line*. >>> -codeSpan: stripPercentSign +codeSpan: stripPercentSigns interblockSeparator emphasis: should contain the percent sign at the (percentSign) beginning of the line