summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/context/third/enigma/enigma_manual.tex50
-rw-r--r--documentation.ichd2
-rw-r--r--tex/context/third/enigma/enigma.lua18
-rw-r--r--tex/context/third/enigma/t-enigma.mkvi2
-rw-r--r--tex/plain/enigma/enigma.tex2
5 files changed, 64 insertions, 10 deletions
diff --git a/doc/context/third/enigma/enigma_manual.tex b/doc/context/third/enigma/enigma_manual.tex
new file mode 100644
index 0000000..281ae93
--- /dev/null
+++ b/doc/context/third/enigma/enigma_manual.tex
@@ -0,0 +1,50 @@
+\startdocchapter[title=Example: Encrypted Document]
+
+Encrypt the text of your document using the script interface. For
+a start try out the settings as given in below listing.
+
+\starttyping
+mtxrun --script mtx-t-enigma \
+ --setup="other_chars = ok, \
+ day_key = B I II III 01 01 01, \
+ rotor_setting = xyz, \
+ verbose=0" \
+ --text="Nobody can read this."
+\stoptyping
+
+This will result in the thoroughly scrambled string
+\type{zdkbxwwnwkazpokvgr}.
+Then, use the same settings you encrypted the text with in your
+document.
+
+\startcontexttyping
+\usemodule[enigma]
+\defineenigma [secretmessage]
+\setupenigma [secretmessage] [
+ other_chars = ok,
+ day_key = B I II III 01 01 01,
+ rotor_setting = xyz,
+ verbose=3,
+]
+
+\starttext
+
+\startsecretmessage
+zdkbxwwnwkazpokvgr
+\stopsecretmessage
+
+\stoptext
+\stopcontexttyping
+
+If you compile this document with \CONTEXT, the plain text will
+reappear.
+Notice that punctuation is substituted with the letter “x” before
+encryption and that spaces are omitted.
+
+\stopdocchapter
+
+\startdocchapter[title=Acknowledgements]
+The Enigma module was inspired by Arno Trautmann’s
+\identifier{chickenize} package.
+Without \LUATEX, encryption on node-level would not have been possible.
+\stopdocchapter
diff --git a/documentation.ichd b/documentation.ichd
index 7d49d0e..516026f 100644
--- a/documentation.ichd
+++ b/documentation.ichd
@@ -1,6 +1,8 @@
Documentation Specification for the Enigma Module.
+ setup extra_setups.tex
[Manual]
to be written
+doc enigma_manual.tex
[Implementation]
\PLAIN\_macros tex enigma.tex
\CONTEXT\_macros context t-enigma.mkvi
diff --git a/tex/context/third/enigma/enigma.lua b/tex/context/third/enigma/enigma.lua
index b7ab57c..f6881f6 100644
--- a/tex/context/third/enigma/enigma.lua
+++ b/tex/context/third/enigma/enigma.lua
@@ -452,9 +452,9 @@ do
--[[ichd--
\startparagraph
-Main stdout verbosity wrapper function. Checks if the global verbosity
-setting exceeds the specified threshold, and only then pushes the
-output.
+\luafunction{emit} is the main wrapper function for \identifier{stdout}.
+Checks if the global verbosity setting exceeds the specified threshold,
+and only then pushes the output.
\stopparagraph
--ichd]]--
emit = function (v, f, ...)
@@ -770,14 +770,16 @@ extraction of successive characters from the sequence.
\placetable[here][]{Initialization strings}{%
\bTABLE
\bTR
- \bTD Reflector \eTD
- \bTD[nc=3] Rotor \eTD
- \bTD Initial rotor \eTD
- \bTD Plugboard wiring \eTD
+ \bTD Reflector \eTD
+ \bTD[nc=3] Rotor \eTD
+ \bTD[nc=3] Initial \eTD
+ \bTD[nc=10] Plugboard wiring \eTD
\eTR
\eTR
\bTR
- \bTD in slot \eTD \bTD[nc=3] setting \eTD
+ \bTD in slot \eTD
+ \bTD[nc=3] setting \eTD
+ \bTD[nc=3] rotor \eTD
\eTR
\bTR
\bTD \eTD
diff --git a/tex/context/third/enigma/t-enigma.mkvi b/tex/context/third/enigma/t-enigma.mkvi
index 552e483..f6f9db7 100644
--- a/tex/context/third/enigma/t-enigma.mkvi
+++ b/tex/context/third/enigma/t-enigma.mkvi
@@ -39,7 +39,7 @@ thirddata = thirddata or { }
\stopluacode
\registerctxluafile{enigma}
-%D \startdocsection[title=setups]
+%D \startdocsection[title=Macro Generator]
%D \startparagraph
%D The main setup. The \texmacro{defineenigma} macro does not adhere to
%D the reommended practis of automatical macro derivation. Rather, we
diff --git a/tex/plain/enigma/enigma.tex b/tex/plain/enigma/enigma.tex
index 2299890..5b15a8d 100644
--- a/tex/plain/enigma/enigma.tex
+++ b/tex/plain/enigma/enigma.tex
@@ -36,7 +36,7 @@
%D \startdocsection[title=Setups]
%D \startparagraph
%D Once the proper catcodes are in place, the setup macro
-%D \texmacro{do-setup_enigma} doesn’t to anything besides passing stuff
+%D \texmacro{do_setup_enigma} doesn’t to anything besides passing stuff
%D through to Lua.
%D \stopparagraph
\def\do_setup_enigma#1{%