Skip to content

Commit

Permalink
Rename \markdownOptionStripPercentSign -> \...s
Browse files Browse the repository at this point in the history
Test \markdownOptionStripPercentSign by adding markdown to documentation

Closes jgm#26
  • Loading branch information
Witiko committed Feb 19, 2018
1 parent 05f0274 commit 665af33
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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`)
Expand Down
4 changes: 4 additions & 0 deletions latexmkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$pdflatex = 'pdflatex --shell-escape %O %S';
$pdf_mode = 1;
$postscript_mode = 0;
$dvi_mode = 0;
19 changes: 11 additions & 8 deletions markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{microtype}
\usepackage[stripPercentSigns]{markdown}
\usepackage{amsmath}
\usepackage{fancyvrb}
\usepackage{hologo}
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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%
Expand Down Expand Up @@ -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@
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 665af33

Please sign in to comment.