docgen-tool 2.1.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.gitattributes +1 -0
  2. package/.github/workflows/deploy-website.yml +28 -0
  3. package/.prettierignore +4 -0
  4. package/.prettierrc +4 -0
  5. package/LICENSE +35 -33
  6. package/{docgen → dist/docgen.js} +11 -22
  7. package/docgen.js +95 -0
  8. package/package.json +47 -20
  9. package/source/__test__/test-run/contents.json +12 -0
  10. package/source/__test__/test-run/overview.txt +3 -0
  11. package/source/__test__/test-run/parameters.json +32 -0
  12. package/source/__test__/test-run/release-notes.txt +4 -0
  13. package/source/docgen.js +900 -775
  14. package/source/example/contents.json +11 -11
  15. package/source/example/index.txt +3 -3
  16. package/source/example/parameters.json +36 -36
  17. package/source/internal-readme.md +4 -0
  18. package/source/pdf-stylesheet.css +26 -20
  19. package/source/require/docgen.css +76 -69
  20. package/source/require/katexInjector.js +9 -13
  21. package/source/require/print.css +26 -19
  22. package/source/templates/main.html +93 -93
  23. package/source/user-guide/advanced-content.txt +170 -170
  24. package/source/user-guide/contents.json +56 -56
  25. package/source/user-guide/files/images/svg/inkit-logo.svg +9 -0
  26. package/source/user-guide/index.txt +257 -244
  27. package/source/user-guide/installation.txt +49 -49
  28. package/source/user-guide/parameters.json +36 -36
  29. package/source/user-guide/release-notes.txt +69 -58
  30. package/source/user-guide/running.txt +46 -46
  31. package/source/user-guide/troubleshooting.txt +31 -31
  32. package/source/user-guide/upgrading.txt +25 -25
  33. package/source/user-guide/version-control.txt +13 -13
  34. package/source/user-guide/writing-content.txt +269 -269
  35. package/tsconfig.json +8 -0
  36. package/.npmignore +0 -2
  37. package/docs/advanced-content.html +0 -239
  38. package/docs/commonmark.html +0 -225
  39. package/docs/docgen.pdf +0 -0
  40. package/docs/files/images/overview.png +0 -0
  41. package/docs/files/images/pdf.png +0 -0
  42. package/docs/files/images/svg/icon.svg +0 -845
  43. package/docs/files/images/svg/overview.svg +0 -1345
  44. package/docs/files/images/text.png +0 -0
  45. package/docs/files/images/web.png +0 -0
  46. package/docs/index.html +0 -333
  47. package/docs/installation.html +0 -121
  48. package/docs/ownership.html +0 -164
  49. package/docs/release-notes.html +0 -144
  50. package/docs/require/docgen.css +0 -131
  51. package/docs/require/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
  52. package/docs/require/katex/fonts/KaTeX_Main-Bold.woff +0 -0
  53. package/docs/require/katex/fonts/KaTeX_Main-Italic.woff +0 -0
  54. package/docs/require/katex/fonts/KaTeX_Main-Regular.woff +0 -0
  55. package/docs/require/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  56. package/docs/require/katex/fonts/KaTeX_Math-Italic.woff +0 -0
  57. package/docs/require/katex/fonts/KaTeX_Math-Regular.woff +0 -0
  58. package/docs/require/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
  59. package/docs/require/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
  60. package/docs/require/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
  61. package/docs/require/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
  62. package/docs/require/katex/katex.min.css +0 -1
  63. package/docs/require/katex/katex.min.js +0 -6
  64. package/docs/require/katexInjector.js +0 -22
  65. package/docs/require/print.css +0 -19
  66. package/docs/require/webknife/fonts/DroidSansMono.woff +0 -0
  67. package/docs/require/webknife/fonts/OpenSans.woff +0 -0
  68. package/docs/require/webknife/fonts/OpenSansBold.woff +0 -0
  69. package/docs/require/webknife/fonts/OpenSansBoldItalic.woff +0 -0
  70. package/docs/require/webknife/fonts/OpenSansItalic.woff +0 -0
  71. package/docs/require/webknife/framework.icons.js +0 -82
  72. package/docs/require/webknife/framework.min.css +0 -3
  73. package/docs/require/webknife/framework.min.js +0 -14
  74. package/docs/require/webknife/highlight.min.css +0 -1
  75. package/docs/require/webknife/highlight.min.js +0 -6
  76. package/docs/running.html +0 -123
  77. package/docs/troubleshooting.html +0 -105
  78. package/docs/upgrading.html +0 -124
  79. package/docs/version-control.html +0 -102
  80. package/docs/writing-content.html +0 -305
  81. /package/{docs → source/__test__/test-run}/files/images/logo.png +0 -0
@@ -1,305 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta http-equiv="X-UA-Compatible" content="IE=edge"><!--Prevent IE using compatibility mode on local or intranet pages. Do not put scripts before this line.-->
5
- <meta name="viewport" content="width=device-width, user-scalable=yes"><!--Mobile device scaling-->
6
- <meta charset="UTF-8">
7
- <title>DocGen - a documentation tool</title>
8
-
9
- <!--load stylesheets first (rationale: https://developers.google.com/speed/docs/best-practices/rtt#PutStylesBeforeScripts)-->
10
- <link rel="stylesheet" href="require/webknife/framework.min.css" type="text/css">
11
- <link rel="stylesheet" href="require/webknife/highlight.min.css" type="text/css">
12
- <link rel="stylesheet" href="require/docgen.css" type="text/css">
13
- <link rel="stylesheet" href="require/print.css" media="print">
14
-
15
- <!--load scripts second-->
16
-
17
- <script src="require/webknife/framework.min.js"></script>
18
- <script src="require/webknife/framework.icons.js"></script>
19
- <script src="require/webknife/highlight.min.js"></script>
20
-
21
- <!--inline scripts last-->
22
-
23
- <script type="text/javascript">
24
-
25
- $(document).ready( function () {
26
- $("#dg-toc").hide(); //hide the table of contents
27
-
28
- //instantiate an svg injector to show SVG icons
29
- var injector = new svgInject();
30
- injector.inject();
31
-
32
- //code syntax highlighting
33
- $('pre code, .w-inline-code').each(function(i, block) {
34
- hljs.highlightBlock(block);
35
- });
36
-
37
- //toggle visibility of table of contents
38
- $("#dg-navigator").click(function()
39
- {
40
- $("#dg-toc").slideToggle("fast");
41
- $(this).toggleClass("active");
42
- });
43
-
44
- });
45
- </script>
46
-
47
- <script type="text/x-mathjax-config">
48
- //MathJax configuration is the same as used by math.stackexchange.com
49
- MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) },
50
- tex2jax: { inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], processEscapes: true, ignoreClass: "tex2jax_ignore|dno" },
51
- TeX: { noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } }, Macros: { href: "{}" } },
52
- messageStyle: "none"
53
- });
54
- </script>
55
-
56
- <link rel="stylesheet" href="require/katex/katex.min.css" type="text/css"><script type="text/javascript" src="require/katex/katex.min.js"></script><script type="text/javascript" src="require/katexInjector.js"></script><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full"></script></head>
57
-
58
- <body>
59
-
60
- <div id="dg-toc"><div><table class="unstyled"><tr><td class="dg-tocGroup"><ul><li class="dg-tocHeading">Quick Start</li><li><a href="index.html">Overview</a></li><li><a href="installation.html">Installation</a></li><li><a href="upgrading.html">Upgrading</a></li></ul></td><td class="dg-tocGroup"><ul><li class="dg-tocHeading">User Guide</li><li><a href="running.html">Running DocGen</a></li><li><a href="writing-content.html">Writing content</a></li><li><a href="commonmark.html">CommonMark reference</a></li><li><a href="advanced-content.html">Advanced content</a></li></ul></td><td class="dg-tocGroup"><ul><li class="dg-tocHeading">Help</li><li><a href="troubleshooting.html">Troubleshooting</a></li><li><a href="version-control.html">Using with version control</a></li></ul></td><td class="dg-tocGroup"></td><td class="dg-tocGroup" id="dg-tocFixedColumn"><ul><li><span class="w-icon dg-tocIcon" data-name="person_group" title="archive"></span><a href="ownership.html">Ownership</a></li><li><span class="w-icon dg-tocIcon" data-name="refresh" title="archive"></span><a href="release-notes.html">Release Notes</a></li></ul><div><button class="w-icon-button" onclick="window.location=&apos;docgen.pdf&apos;;"><span class="w-icon" data-name="document"></span><span>PDF copy</span></button></div></td></tr></table></div></div>
61
- <div id="dg-navigator">Table of contents</div>
62
-
63
- <header>
64
- <div class="w-fixed-width">
65
- <a id="dg-homelink" href="index.html">
66
- <div id="dg-logo" style="background-image: url(files/images/logo.png); height: 42px; line-height: 42px; padding-left: 85px;">
67
- <span id="dg-title">DocGen - a documentation tool</span> <span id="dg-web-title-version" style="font-weight:normal;">(2.1.2)</span>
68
- </div>
69
- </a>
70
- <div>
71
- <span id="dg-backlink"></span>
72
- </div>
73
- </div>
74
- </header>
75
-
76
- <section id="dg-content"><div class="w-fixed-width"><div id="dg-innerContent"><h1 id="dg-autoTitle">Writing content</h1><ul class="dg-pageToc"><li><a href="#overview">Overview</a></li><li><a href="#metadata">Metadata</a></li><li><a href="#plain-text">Plain text</a></li><li><a href="#commonmark-(markdown)">CommonMark (Markdown)</a></li><li><a href="#html">HTML</a></li><li><a href="#embedding-images">Embedding images</a></li><li><a href="#attaching-files">Attaching files</a></li><li><a href="#mathematical-expressions">Mathematical Expressions</a></li><li><a href="#mathematics-using-katex">Mathematics using KaTeX</a></li><li><a href="#mathematics-using-mathjax">Mathematics using MathJax</a></li></ul><style>
77
- .container {
78
- box-sizing: border-box;
79
- float:left;
80
- width: 480px;
81
- }
82
- .codeContainer {
83
- margin: 0 20px 0 0;
84
- }
85
- .codeContainer pre {
86
- margin: 0;
87
- }
88
- .codeContainer code {
89
- }
90
- .codeContainer p {
91
- margin: 0;
92
- padding: 0;
93
- }
94
- .exampleContainer {
95
- margin: 0;
96
- border: 1px solid #666;
97
- border-radius: 6px;
98
- padding: 0 18px 0 18px;
99
- }
100
- .exampleContainer img {
101
- margin-top: 5px;
102
- }
103
- #content table {
104
- width: 400px!important;
105
- }
106
- .hljs-change {
107
- background-color: transparent!important;
108
- }
109
- </style>
110
- <p>Content for a DocGen website is authored in plain text, using any text editor. Image files can be embedded, and
111
- other types of files can be attached as links. Additionally, website metadata is configured
112
- via <a href="http://json.org">JSON</a> files.</p>
113
- <h2 id="overview">Overview</h2>
114
- <p>DocGen transforms source files from an input directory into output files in an output directory.</p>
115
- <p>It takes every source file (plain text) specified in <strong>contents.json</strong> and converts it. Each source file becomes a
116
- separate page in the website and a separate chapter in the PDF.</p>
117
- <p>DocGen adds metadata that is specified in <strong>parameters.json</strong>, and copies the images and files in the <strong>files</strong>
118
- directory to the output.</p>
119
- <blockquote>
120
- <p>Always save input files with <strong>UTF-8</strong> encoding. This makes non-standard characters (&#xF8; &#xA9; &#xE9; etc) work.</p>
121
- </blockquote>
122
- <h2 id="metadata">Metadata</h2>
123
- <p><strong>parameters.json</strong></p>
124
- <p>The parameters file is used to specify metadata describing the product.</p>
125
- <ul>
126
- <li><strong>title</strong> - the product title</li>
127
- <li><strong>name</strong> - the product name (also used to name the PDF)</li>
128
- <li><strong>version</strong> - the release version</li>
129
- <li><strong>date</strong> - the release date</li>
130
- <li><strong>organization</strong> - the company or organization</li>
131
- <li><strong>author</strong> - the lead author of the document</li>
132
- <li><strong>owner</strong> - the owner of the product</li>
133
- <li><strong>contributors</strong> - list of contributors</li>
134
- <li><strong>website</strong> - a link to the product website</li>
135
- <li><strong>backlink</strong> - a link back to product user interface (useful for integrated documentation)</li>
136
- <li><strong>module</strong> - module name (useful for larger products with submodules)</li>
137
- <li><strong>id</strong> - reference number (e.g. product id in a change management tool)</li>
138
- <li><strong>summary</strong> - a descriptive summary of the product</li>
139
- <li><strong>marking</strong> - license or other protective markings</li>
140
- <li><strong>legalese</strong> - document markings (confidentiality, disclaimers, smallprint etc)</li>
141
- </ul>
142
- <p>Values can be empty strings, but the elements are required in the JSON file.</p>
143
- <p>Parameters with URLs can be either website URLs, or email addresses (specify <em>&apos;mailto:name@address.com&apos;</em>).</p>
144
- <p><strong>contents.json</strong></p>
145
- <p>The contents file specifies the names, locations, order, and hierarchy of the source files. It is used to generate both
146
- the web and PDF table of contents.</p>
147
- <p><strong>release-notes.txt</strong></p>
148
- <p>The release notes source file is a mandatory source file (that does not need to be listed in contents.json). Use it to
149
- summarize the change history for each version of the product.</p>
150
- <h2 id="plain-text">Plain text</h2>
151
- <p>The simplest input format is just to write in plain text. Here is an example of the source and output:</p>
152
- <div class="container codeContainer">
153
- <pre><code>Example paragraph.
154
- </code></pre>
155
- </div>
156
- <div class="container exampleContainer">
157
- <p>Example paragraph.</p>
158
- </div><br class="w-clear">
159
- <p class="dg-forceBreak"></p>
160
- <h2 id="commonmark-(markdown)">CommonMark (Markdown)</h2>
161
- <p><a href="http://commonmark.org/">CommonMark</a> (also known as <a href="http://daringfireball.net/projects/markdown/">MarkDown</a>) is a
162
- human-friendly plain text markup format. The source format is easy to read and write, and the CommonMark parser
163
- translates it into HTML. DocGen uses the <a href="https://markdown-it.github.io">markdown-it</a> implementation
164
- of CommonMark. Here is an example of the source and output:</p>
165
- <div class="container codeContainer">
166
- <pre><code>CommonMark Example
167
- ------------------
168
-
169
- Paragraphs are text blocks separated by new lines.
170
-
171
- Text can be styled: *emphasised* and **strong**.
172
-
173
- Here is an [example link](http://www.google.com).
174
-
175
- # To make a code block, just indent with a tab
176
- # &quot;Hello World&quot; in Ruby:
177
- 5.times { puts &quot;Hello!&quot; }
178
- </code></pre>
179
- </div>
180
- <div class="container exampleContainer">
181
- <p class="dg-fakeHeading" style="font-size: 18px; padding-bottom: 4px;">CommonMark Example</p>
182
- <p>Paragraphs are text blocks separated by new lines.</p>
183
- <p>Text can be styled: <em>emphasised</em> and <strong>strong</strong>.</p>
184
- <p>Here is an <a href="http://www.google.com">example link</a>.</p>
185
- <pre><code># To make a code block, just indent with a tab
186
- # &quot;Hello World&quot; in Ruby:
187
- 5.times { puts &quot;Hello!&quot; }
188
- </code></pre>
189
- </div><br class="w-clear">
190
- <p>For more examples, see the <a href="commonmark.html">CommonMark reference</a>.</p>
191
- <h2 id="html">HTML</h2>
192
- <p>For more complex pages not covered by CommonMark&apos;s syntax, simply use inline HTML:</p>
193
- <div class="container codeContainer">
194
- <pre><code>&lt;table&gt;
195
- &lt;tr&gt;
196
- &lt;td&gt;Foo&lt;/td&gt;
197
- &lt;td&gt;Bar&lt;/td&gt;
198
- &lt;td&gt;Baz&lt;/td&gt;
199
- &lt;/tr&gt;
200
- &lt;/table&gt;</code></pre>
201
- </div>
202
- <div class="container exampleContainer">
203
- <table class="w-table w-fixed w-stripe">
204
- <tr>
205
- <td>Foo</td>
206
- <td>Bar</td>
207
- <td>Baz</td>
208
- </tr>
209
- </table>
210
- </div><br class="w-clear">
211
- <p>For more examples, see <a href="advanced-content.html">writing advanced content</a>.</p>
212
- <blockquote>
213
- <p>Inline HTML is still parsed by the CommonMark parser (HTML is allowed in CommonMark documents). In DocGen, it is also
214
- possible to bypass the CommonMark parser altogether and specify a pure HTML input page, by setting
215
- <code class="w-inline-code">&quot;html&quot;: true</code> in a page object in <em>contents.json</em>.</p>
216
- </blockquote>
217
- <h2 id="embedding-images">Embedding images</h2>
218
- <p>Diagrams (in image form, e.g. JPEG, PNG, GIF etc) should be put the <em>files/images</em> directory, and embedded as images.</p>
219
- <div class="container codeContainer">
220
- <pre><code>![](files/images/logo.png)</code></pre>
221
- </div>
222
- <div class="container exampleContainer">
223
- <img src="files/images/logo.png">
224
- </div><br class="w-clear">
225
- <h2 id="attaching-files">Attaching files</h2>
226
- <p>Other files you want to attach should go into <em>files</em> directory.</p>
227
- <div class="container codeContainer">
228
- <pre><code>[attachment](user_guide.pdf)</code></pre>
229
- </div>
230
- <div class="container exampleContainer">
231
- <a href="user_guide.pdf">attachment</a>
232
- </div><br class="w-clear">
233
- <h2 id="mathematical-expressions">Mathematical Expressions</h2>
234
- <p><a href="http://en.wikipedia.org/wiki/LaTeX">LaTeX</a> is the most common markup format for mathematical expressions.</p>
235
- <p>Modern web browsers do not yet consistently support a common standard for authoring mathematical expressions. For this
236
- reason, extra libraries are needed. DocGen supports two widely-used web mathematics libraries out-the-box:</p>
237
- <ul>
238
- <li><strong><a href="http://khan.github.io/KaTeX/">KaTeX</a></strong> is fast, lightweight, and <a href="http://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX">supports fewer features</a></li>
239
- <li><strong><a href="https://www.mathjax.org/">MathJax</a></strong> is slower, larger, and <a href="http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands">supports more features</a></li>
240
- </ul>
241
- <p>The document author decides which one (or both) to use.</p>
242
- <p class="dg-forceBreak"></p>
243
- <h3 id="mathematics-using-katex">Mathematics using KaTeX</h3>
244
- <p>KaTeX is the recommended choice. It is bundled with DocGen but must be enabled by passing the
245
- <strong>-m</strong> option.</p>
246
- <div class="container codeContainer">
247
- <pre><code>&lt;div class=&quot;dg-katexMath&quot;&gt;
248
- f(x) = \int_{-\infty}^\infty
249
- \hat f(\xi)\,e^{2 \pi i \xi x}
250
- \,d\xi
251
- &lt;/div&gt;</code></pre>
252
- </div>
253
- <div class="container exampleContainer">
254
- <div class="dg-katexMath">
255
- f(x) = \int_{-\infty}^\infty
256
- \hat f(\xi)\,e^{2 \pi i \xi x}
257
- \,d\xi
258
- </div>
259
- </div><br class="w-clear">
260
- <h3 id="mathematics-using-mathjax">Mathematics using MathJax</h3>
261
- <p>MathJax is the fallback choice for expressions not yet supported by KaTex. When required, MathJax can be enabled by
262
- passing the <strong>-n</strong> option.</p>
263
- <blockquote>
264
- <p>DocGen uses the same MathJax configuration as the popular <a href="http://math.stackexchange.com">Stack Exchange</a> websites.</p>
265
- </blockquote>
266
- <p class="w-error">
267
- Because MathJax is a large library, it is not bundled with DocGen, but is served from a third-party CDN
268
- (content delivery network). This means users need an active Internet connection for the MathJax feature to work.
269
- </p>
270
- <p class="w-error">
271
- MathJax can be slow to render. When used with the PDF feature, it may be necessary to allow more rendering time by
272
- passing the <br><strong>-d [milliseconds]</strong> option.
273
- </p>
274
- <div class="container codeContainer">
275
- <pre><code>$$
276
- f(n) = \begin{cases}
277
- n/2, &amp; \text{if $n$ is even} \\
278
- 3n+1, &amp; \text{if $n$ is odd}
279
- \end{cases}
280
- $$</code></pre>
281
- </div>
282
- <div class="container exampleContainer">
283
- $$
284
- f(n) = \begin{cases}
285
- n/2, &amp; \text{if $n$ is even} \\
286
- 3n+1, &amp; \text{if $n$ is odd}
287
- \end{cases}
288
- $$
289
- </div><br class="w-clear">
290
- </div></div></section>
291
-
292
- <footer>
293
- <div><p class="w-fixed-width"><span id="dg-web-footer">Version 2.1.2 released on 28/05/2015.</span></p></div>
294
- <div class="w-fixed-width">
295
- <p><span id="dg-copyright">&#xA9; 2015 <a href="https://github.com/mtmacdonald">Mark Macdonald</a></span></p>
296
- <p>
297
- <span id="dg-marking">MIT License.</span>
298
- <span id="dg-legalese"></span>
299
- <span id="dg-attribution">Created by DocGen 2.1.2 on 28/05/2015 at 18:31:56.</span>
300
- </p>
301
- </div>
302
- </footer>
303
-
304
- </body>
305
- </html>