marko 0.3.0 → 0.4.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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +12 -0
  3. data/.rubocop.yml +45 -0
  4. data/CHANGELOG.md +10 -4
  5. data/Dockerfile +11 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +17 -31
  8. data/Rakefile +2 -11
  9. data/exe/marko +4 -22
  10. data/lib/basic.rb +27 -0
  11. data/lib/marko/chain.rb +44 -0
  12. data/lib/marko/cli.rb +119 -129
  13. data/lib/marko/config.rb +30 -20
  14. data/lib/marko/errors.rb +38 -0
  15. data/lib/marko/model/markup.rb +33 -0
  16. data/lib/marko/model/topic.rb +126 -0
  17. data/lib/marko/model/tree_node.rb +34 -0
  18. data/lib/marko/model.rb +10 -0
  19. data/lib/marko/parser/metadata.rb +28 -0
  20. data/lib/marko/parser/source.rb +52 -0
  21. data/lib/marko/parser/topic.rb +33 -0
  22. data/lib/marko/parser.rb +8 -19
  23. data/lib/marko/renderers/artifact.rb +29 -0
  24. data/lib/marko/renderers/content.rb +37 -0
  25. data/lib/marko/renderers/link.rb +19 -0
  26. data/lib/marko/renderers/metadata.rb +34 -0
  27. data/lib/marko/renderers/nested_list.rb +21 -0
  28. data/lib/marko/renderers/nested_tree.rb +22 -0
  29. data/lib/marko/renderers/renderer.rb +17 -0
  30. data/lib/marko/renderers/title.rb +16 -0
  31. data/lib/marko/renderers/topic.rb +24 -0
  32. data/lib/marko/renderers/url.rb +16 -0
  33. data/lib/marko/renderers.rb +17 -0
  34. data/lib/marko/scanner.rb +39 -0
  35. data/lib/marko/tasks/assemble.rb +52 -0
  36. data/lib/marko/tasks/compile.rb +19 -0
  37. data/lib/marko/tasks/load.rb +13 -0
  38. data/lib/marko/tasks/parse.rb +27 -0
  39. data/lib/marko/tasks/scan.rb +18 -0
  40. data/lib/marko/tasks/validate.rb +32 -0
  41. data/lib/marko/tasks.rb +13 -0
  42. data/lib/marko/validators/lost_index.rb +21 -0
  43. data/lib/marko/validators/lost_links.rb +25 -0
  44. data/lib/marko/validators/lost_parent.rb +21 -0
  45. data/lib/marko/validators/non_unique_id.rb +23 -0
  46. data/lib/marko/validators.rb +11 -0
  47. data/lib/marko/version.rb +1 -3
  48. data/lib/marko.rb +11 -43
  49. metadata +47 -85
  50. data/Gemfile +0 -10
  51. data/Gemfile.lock +0 -23
  52. data/STORY.md +0 -44
  53. data/_layouts/footer.md +0 -4
  54. data/_layouts/header.md +0 -3
  55. data/_layouts/layout.html +0 -73
  56. data/_layouts/robots.txt.erb +0 -4
  57. data/_layouts/sitemap.xml.erb +0 -20
  58. data/_layouts/styles.css +0 -92
  59. data/docs/changelog.html +0 -74
  60. data/docs/css/styles.css +0 -92
  61. data/docs/index.html +0 -297
  62. data/docs/readme.html +0 -297
  63. data/docs/robots.txt +0 -4
  64. data/docs/sitemap.xml +0 -30
  65. data/docs/story.html +0 -132
  66. data/lib/assets/demo/README.md +0 -13
  67. data/lib/assets/demo/src/fr/assemble.md +0 -27
  68. data/lib/assets/demo/src/fr/compile.md +0 -25
  69. data/lib/assets/demo/src/fr/markup.md +0 -111
  70. data/lib/assets/demo/src/fr/storage.md +0 -16
  71. data/lib/assets/demo/src/fr/treenode.md +0 -34
  72. data/lib/assets/demo/src/index.md +0 -34
  73. data/lib/assets/demo/src/intro.md +0 -98
  74. data/lib/assets/demo/src/ui/cli.md +0 -26
  75. data/lib/assets/demo/src/ui/gem.md +0 -14
  76. data/lib/assets/demo/src/ur/uc.create.project.md +0 -8
  77. data/lib/assets/demo/src/ur/uc.general.flow.md +0 -14
  78. data/lib/assets/init/README.md +0 -61
  79. data/lib/assets/init/Rakefile +0 -100
  80. data/lib/assets/init/tt/custom.md.tt +0 -19
  81. data/lib/assets/init/tt/default.md.tt +0 -4
  82. data/lib/assets/samples/0_index.md +0 -14
  83. data/lib/assets/samples/1_intro.md +0 -55
  84. data/lib/assets/samples/2_stakh.md +0 -21
  85. data/lib/assets/samples/3_actors.md +0 -10
  86. data/lib/assets/samples/4_cases.md +0 -53
  87. data/lib/assets/samples/5_entities.md +0 -18
  88. data/lib/assets/samples/6_concerns.md +0 -60
  89. data/lib/assets/samples/SRS-IEEE-830-1998.md +0 -293
  90. data/lib/assets/samples/SRS-RUP.md +0 -283
  91. data/lib/assets/samples/business-case.md +0 -116
  92. data/lib/assets/samples/ears.md +0 -112
  93. data/lib/assets/samples/gen_punch_domain.rb +0 -183
  94. data/lib/assets/samples/requirements.md +0 -105
  95. data/lib/assets/samples/stakeholders.png +0 -0
  96. data/lib/assets/samples/vision.md +0 -191
  97. data/lib/marko/artifact.rb +0 -5
  98. data/lib/marko/assembler.rb +0 -83
  99. data/lib/marko/compiler.rb +0 -16
  100. data/lib/marko/gadgets/pluggable.rb +0 -55
  101. data/lib/marko/gadgets/sentry.rb +0 -66
  102. data/lib/marko/gadgets/service.rb +0 -52
  103. data/lib/marko/gadgets.rb +0 -3
  104. data/lib/marko/loader.rb +0 -38
  105. data/lib/marko/markup/compiler.rb +0 -30
  106. data/lib/marko/markup/decorator.rb +0 -80
  107. data/lib/marko/markup/macro.rb +0 -176
  108. data/lib/marko/markup/parser.rb +0 -122
  109. data/lib/marko/markup/storage.rb +0 -118
  110. data/lib/marko/markup/validator.rb +0 -101
  111. data/lib/marko/markup.rb +0 -24
  112. data/lib/marko/services/assemble.rb +0 -16
  113. data/lib/marko/services/compile.rb +0 -30
  114. data/lib/marko/services.rb +0 -2
  115. data/lib/marko/storage.rb +0 -36
  116. data/lib/marko/tree_node.rb +0 -129
  117. data/lib/marko/validator.rb +0 -19
  118. data/marko.gemspec +0 -44
  119. data/sancho.yml +0 -6
data/docs/readme.html DELETED
@@ -1,297 +0,0 @@
1
- <!DOCTYPE html>
2
- <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="generator" content="pandoc" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7
- <meta name="keywords" content="ruby, markup-compiler" />
8
- <title>Marko Readme</title>
9
- <style>
10
- code{white-space: pre-wrap;}
11
- span.smallcaps{font-variant: small-caps;}
12
- div.columns{display: flex; gap: min(4vw, 1.5em);}
13
- div.column{flex: auto; overflow-x: auto;}
14
- div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
15
- ul.task-list{list-style: none;}
16
- ul.task-list li input[type="checkbox"] {
17
- width: 0.8em;
18
- margin: 0 0.8em 0.2em -1.6em;
19
- vertical-align: middle;
20
- }
21
- .display.math{display: block; text-align: center; margin: 0.5rem auto;}
22
- /* CSS for syntax highlighting */
23
- pre > code.sourceCode { white-space: pre; position: relative; }
24
- pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
25
- pre > code.sourceCode > span:empty { height: 1.2em; }
26
- .sourceCode { overflow: visible; }
27
- code.sourceCode > span { color: inherit; text-decoration: inherit; }
28
- div.sourceCode { margin: 1em 0; }
29
- pre.sourceCode { margin: 0; }
30
- @media screen {
31
- div.sourceCode { overflow: auto; }
32
- }
33
- @media print {
34
- pre > code.sourceCode { white-space: pre-wrap; }
35
- pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
36
- }
37
- pre.numberSource code
38
- { counter-reset: source-line 0; }
39
- pre.numberSource code > span
40
- { position: relative; left: -4em; counter-increment: source-line; }
41
- pre.numberSource code > span > a:first-child::before
42
- { content: counter(source-line);
43
- position: relative; left: -1em; text-align: right; vertical-align: baseline;
44
- border: none; display: inline-block;
45
- -webkit-touch-callout: none; -webkit-user-select: none;
46
- -khtml-user-select: none; -moz-user-select: none;
47
- -ms-user-select: none; user-select: none;
48
- padding: 0 4px; width: 4em;
49
- color: #aaaaaa;
50
- }
51
- pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
52
- div.sourceCode
53
- { }
54
- @media screen {
55
- pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
56
- }
57
- code span.al { color: #ff0000; font-weight: bold; } /* Alert */
58
- code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
59
- code span.at { color: #7d9029; } /* Attribute */
60
- code span.bn { color: #40a070; } /* BaseN */
61
- code span.bu { color: #008000; } /* BuiltIn */
62
- code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
63
- code span.ch { color: #4070a0; } /* Char */
64
- code span.cn { color: #880000; } /* Constant */
65
- code span.co { color: #60a0b0; font-style: italic; } /* Comment */
66
- code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
67
- code span.do { color: #ba2121; font-style: italic; } /* Documentation */
68
- code span.dt { color: #902000; } /* DataType */
69
- code span.dv { color: #40a070; } /* DecVal */
70
- code span.er { color: #ff0000; font-weight: bold; } /* Error */
71
- code span.ex { } /* Extension */
72
- code span.fl { color: #40a070; } /* Float */
73
- code span.fu { color: #06287e; } /* Function */
74
- code span.im { color: #008000; font-weight: bold; } /* Import */
75
- code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
76
- code span.kw { color: #007020; font-weight: bold; } /* Keyword */
77
- code span.op { color: #666666; } /* Operator */
78
- code span.ot { color: #007020; } /* Other */
79
- code span.pp { color: #bc7a00; } /* Preprocessor */
80
- code span.sc { color: #4070a0; } /* SpecialChar */
81
- code span.ss { color: #bb6688; } /* SpecialString */
82
- code span.st { color: #4070a0; } /* String */
83
- code span.va { color: #19177c; } /* Variable */
84
- code span.vs { color: #4070a0; } /* VerbatimString */
85
- code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
86
- </style>
87
- <link rel="stylesheet" href="css/styles.css" />
88
- <!--[if lt IE 9]>
89
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
90
- <![endif]-->
91
- </head>
92
- <body>
93
- <p class="navbar">
94
- <span class="smallcaps">= <strong>“Marko” Markup Compiler</strong> = <a
95
- href="readme.html">Readme</a> ~ <a href="changelog.html">Changelog</a> ~
96
- <a href="story.html">Story</a> ~ <a
97
- href="https://github.com/nvoynov/sancho">Github</a></span>
98
- </p>
99
- <header id="title-block-header">
100
- <h1 class="title">Marko Readme</h1>
101
- </header>
102
- <nav id="TOC" role="doc-toc">
103
- <ul>
104
- <li><a href="#installation" id="toc-installation">Installation</a></li>
105
- <li><a href="#usage" id="toc-usage">Usage</a>
106
- <ul>
107
- <li><a href="#interface" id="toc-interface">Interface</a></li>
108
- <li><a href="#structure" id="toc-structure">Structure</a></li>
109
- <li><a href="#markup" id="toc-markup">Markup</a></li>
110
- <li><a href="#metadata" id="toc-metadata">Metadata</a></li>
111
- <li><a href="#tree-ids" id="toc-tree-ids">Tree, IDs</a></li>
112
- <li><a href="#macros" id="toc-macros">Macros</a></li>
113
- <li><a href="#templates" id="toc-templates">Templates</a></li>
114
- <li><a href="#automation" id="toc-automation">Automation</a></li>
115
- </ul></li>
116
- <li><a href="#development" id="toc-development">Development</a></li>
117
- <li><a href="#contributing" id="toc-contributing">Contributing</a></li>
118
- </ul>
119
- </nav>
120
- <p>Marko is a markup compiler that builds a tree from separated sources
121
- and compiles it into a single deliverable artifact.</p>
122
- <p>Marko supplies a “docs-as-code” approach for compiling bulky software
123
- artifacts by providing source storage, original plain text markup,
124
- compiler templates, Ruby- and a command-line interface for assembling
125
- and compiling.</p>
126
- <p>Having assembled the artifact, it can be analyzed, enriched by extra
127
- data, etc.; it can serve as a source for deriving subdued artifacts.</p>
128
- <p>I’ve applied the approach for dozens of artifacts for the last six
129
- years, mainly writing requirements in Markdown, analyzing quality,
130
- deriving estimation sheets, exporting deliverables with Pandoc, and
131
- automating some parts of my everyday work.</p>
132
- <h2 id="installation">Installation</h2>
133
- <p>Install the gem by executing:</p>
134
- <pre><code>$ gem install marko</code></pre>
135
- <h2 id="usage">Usage</h2>
136
- <h3 id="interface">Interface</h3>
137
- <p>Marko provides just basic command-line interface for creating new
138
- projects and assembling artifacts - run <code>$ marko</code> to see the
139
- details.</p>
140
- <p>In addition to the standard CLI, Marko supplies you with Rakefile,
141
- that also serves as custom automation example. You can run
142
- <code>rake -T</code> to see available commands.</p>
143
- <p>To help you with task automation, Marko provides
144
- <code>Marko.assemble</code> for assembling and
145
- <code>Marko.compile</code> for compiling artifacts (you could already
146
- spot it inside Rakefile.) See <a href="#automation">Automation</a>
147
- section for examples.</p>
148
- <h3 id="structure">Structure</h3>
149
- <p><code>marko new PROJECT</code> command will create a new marko
150
- project inside the <code>PROJECT</code> directory with following
151
- structure:</p>
152
- <ul>
153
- <li><a href="bin/">bin/</a> - output folder for <code>build</code></li>
154
- <li><a href="bin/assets/">bin/assets/</a> - assets folder</li>
155
- <li><a href="src/">src/</a> - markup sources</li>
156
- <li><a href="tt/">tt/</a> - templates for <code>build</code></li>
157
- <li><a href="marko.yml">marko.yml</a> - project configuration</li>
158
- <li><a href="Rakefile">Rakefile</a> - Rake automation file</li>
159
- <li><a href="README.md">README.md</a> - this file</li>
160
- </ul>
161
- <h3 id="markup">Markup</h3>
162
- <p>The basic and the only Marko entity is <a
163
- href="#github-link">TreeNode</a> with <code>id</code>,
164
- <code>meta</code>, <code>body</code>, and <code>items</code>
165
- properties.</p>
166
- <p>And the primary activity is just writing source files consisting of
167
- the TreeNode, where the source actually just a regular Markdown with an
168
- optional metadata excerpt. All lines from <code>#</code> until the next
169
- <code>#</code> are considered TreeNode.</p>
170
- <p>Let’s see it by example and assume one has a few separate sources
171
- <code>content.md</code>, <code>uc.signup.md</code>, and
172
- <code>uc.signin.md</code>. <code>content.md</code></p>
173
- <div class="sourceCode" id="cb2"><pre
174
- class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu"># Overview</span></span>
175
- <span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="fu"># User Requirements</span></span>
176
- <span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="fu">## Use Cases</span></span>
177
- <span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>{{id: uc, order_index: .signup .signin}}</span>
178
- <span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu"># Functional requirements</span></span></code></pre></div>
179
- <p><code>uc.signup.md</code></p>
180
- <div class="sourceCode" id="cb3"><pre
181
- class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu"># Sign-Up</span></span>
182
- <span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>{{id: .signup, parent: uc}}</span>
183
- <span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
184
- <span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>body markup</span></code></pre></div>
185
- <p><code>uc.signin.md</code></p>
186
- <div class="sourceCode" id="cb4"><pre
187
- class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu"># Sign-In</span></span>
188
- <span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>{{id: .signin, parent: uc}}</span>
189
- <span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a></span>
190
- <span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>body markup</span></code></pre></div>
191
- <p>These sources will be assembled in a single hierarchy as follows</p>
192
- <div class="sourceCode" id="cb5"><pre
193
- class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu"># Overview</span></span>
194
- <span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu"># User Requirements</span></span>
195
- <span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="fu">## Use Cases</span></span>
196
- <span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a>{{id: uc, order_index: .signup .signin}}</span>
197
- <span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="fu">### Sign-Up</span></span>
198
- <span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a>{{id: .signup, parent: uc}}</span>
199
- <span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a></span>
200
- <span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a>body markup</span>
201
- <span id="cb5-9"><a href="#cb5-9" aria-hidden="true" tabindex="-1"></a><span class="fu">### Sign-In</span></span>
202
- <span id="cb5-10"><a href="#cb5-10" aria-hidden="true" tabindex="-1"></a>{{id: .signin, parent: uc}}</span>
203
- <span id="cb5-11"><a href="#cb5-11" aria-hidden="true" tabindex="-1"></a></span>
204
- <span id="cb5-12"><a href="#cb5-12" aria-hidden="true" tabindex="-1"></a>body markup</span>
205
- <span id="cb5-13"><a href="#cb5-13" aria-hidden="true" tabindex="-1"></a></span>
206
- <span id="cb5-14"><a href="#cb5-14" aria-hidden="true" tabindex="-1"></a><span class="fu"># Functional requirements</span></span></code></pre></div>
207
- <p>So all the assemblage magic is just linking TreeNode by using
208
- <code>id</code>, <code>parent</code>, and <code>order_index</code>
209
- attributes; where <code>id</code> and <code>parent</code> are just nodes
210
- identifiers, and <code>order_index</code> is just an array of
211
- identifiers that point out the order of getting <code>items</code>.</p>
212
- <h3 id="metadata">Metadata</h3>
213
- <p>It was shown above how to provide hierarchy attributes by metadata
214
- excerpt <code>{{}}</code>. But you can also use the excerpt to provide
215
- your own attributes, like <code>source: John Doe</code>,
216
- <code>affects: some.other.thing</code>, etc.</p>
217
- <h3 id="tree-ids">Tree, IDs</h3>
218
- <p>When you deal with trees in separated sources, to reference nodes you
219
- need identifiers. So when you write <code>id</code>, <code>parent</code>
220
- and <code>order_index</code> metadata - you actually deal with TreeNode
221
- Id, and it must be unique.</p>
222
- <p>When one works on a simple parent -&gt; child relationship,
223
- identifiers can be shortened by starting from <code>.</code>. In the
224
- example above <code>{{order_index: .signup .signin}}</code>, the parent
225
- will find its children by <code>/.signup$/</code> and
226
- <code>/.signin$/</code>; and besides, during the assembling phase those
227
- relative identifiers will be turned to full - <code>uc.signup</code> and
228
- <code>uc.signin</code>.</p>
229
- <p>Marko will generate a unique Id for each TreeNode when Id was not
230
- provided by the author.</p>
231
- <h3 id="macros">Macros</h3>
232
- <p>The TreeNode.body can include macros. The most helpful one is
233
- <code>[[reference.id]]</code> that will be substituted by well-formed
234
- markdown link <code>[&lt;node.title&gt;](#&lt;node.url&gt;)</code>.
235
- There are also <code>@@tree</code>, <code>@@list</code>,
236
- <code>@@todo</code>, and <code>@@skip</code> standard macros; and this
237
- list could be extended or shortened through building templates.</p>
238
- <ul>
239
- <li><code>@@tree</code> substituted by the tree of references to all
240
- descendants of the current node, might be used for the table of
241
- contents;</li>
242
- <li><code>@@list</code> substituted by the list of references to node
243
- items;</li>
244
- <li><code>@@todo</code> will will skip text with the macro till the end
245
- of the line</li>
246
- <li><code>@@skip</code> will skip the text after the macro</li>
247
- </ul>
248
- <h3 id="templates">Templates</h3>
249
- <p>Marko uses templates placed under the <code>tt</code> folder to
250
- compile sources into artifacts. You can use and customize the default
251
- one or design your own for particular purposes. It’s just pure ERB,
252
- where Marko enumerates TreeNodes and renders the node output.</p>
253
- <pre><code>&lt;%= @node.header %&gt;
254
- &lt;%= @node.meta %&gt;
255
- &lt;%= @node.body %&gt;</code></pre>
256
- <p>The <code>marko.yml</code> configuration file sets the building
257
- process’s default template and other default values.</p>
258
- <div class="sourceCode" id="cb7"><pre
259
- class="sourceCode yml"><code class="sourceCode yaml"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="pp">--- !ruby/struct:Marko::Artifact</span></span>
260
- <span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">id</span><span class="kw">:</span><span class="at"> ed863484-243f-4d46-8012-4b148f8c2910</span></span>
261
- <span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="fu">title</span><span class="kw">:</span><span class="at"> Marko Artifact</span></span>
262
- <span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="fu">template</span><span class="kw">:</span><span class="at"> tt/artifact.md.tt</span></span>
263
- <span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="fu">filename</span><span class="kw">:</span><span class="at"> tt/marko-artifact.md</span></span></code></pre></div>
264
- <h3 id="automation">Automation</h3>
265
- <p>Following quick example will assemble tree, remove TreeNode with id
266
- == ‘hint’, and compile the tree. You can also see Rakefile for other
267
- examples.</p>
268
- <div class="sourceCode" id="cb8"><pre
269
- class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">require</span> <span class="vs">&#39;marko&#39;</span></span>
270
- <span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
271
- <span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="cf">def</span> do_remove_hint</span>
272
- <span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> tree <span class="kw">=</span> <span class="dt">Marko</span><span class="at">.assemble</span></span>
273
- <span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a> hint <span class="kw">=</span> tree<span class="at">.find_node</span>(<span class="vs">&#39;hint&#39;</span>)</span>
274
- <span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> hint<span class="at">.orphan!</span></span>
275
- <span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">Marko</span><span class="at">.compile</span>(<span class="wa">tree: </span>tree) </span>
276
- <span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a><span class="cf">end</span></span></code></pre></div>
277
- <h2 id="development">Development</h2>
278
- <p>After checking out the repo, run <code>bin/setup</code> to install
279
- dependencies. Then, run <code>rake test</code> to run the tests. You can
280
- also run <code>bin/console</code> for an interactive prompt that will
281
- allow you to experiment.</p>
282
- <p>To install this gem onto your local machine, run
283
- <code>bundle exec rake install</code>. To release a new version, update
284
- the version number in <code>version.rb</code>, and then run
285
- <code>bundle exec rake release</code>, which will create a git tag for
286
- the version, push git commits and the created tag, and push the
287
- <code>.gem</code> file to <a
288
- href="https://rubygems.org">rubygems.org</a>.</p>
289
- <h2 id="contributing">Contributing</h2>
290
- <p>Bug reports and pull requests are welcome on GitHub at
291
- https://github.com/[USERNAME]/marko.</p>
292
- <div id="footer">
293
- <hr />
294
- <p>© 2022-2023 <a href="http://nvoynov.github.io/">nvoynov</a></p>
295
- </div>
296
- </body>
297
- </html>
data/docs/robots.txt DELETED
@@ -1,4 +0,0 @@
1
- User-agent: *
2
- Allow: /
3
-
4
- Sitemap: https://nvoynov.github.io/marko/sitemap.xml
data/docs/sitemap.xml DELETED
@@ -1,30 +0,0 @@
1
- <?xml version='1.0' encoding='UTF-8'?>
2
- <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
4
- xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
5
-
6
- <url>
7
- <loc>nvoynov.github.io/marko/</loc>
8
- <lastmod>2023-02-11</lastmod>
9
- <changefreq>weekly</changefreq>
10
- <priority>1.0</priority>
11
- </url>
12
- <url>
13
- <loc>nvoynov.github.io/marko/readme.html</loc>
14
- <lastmod>2023-02-11</lastmod>
15
- <changefreq>weekly</changefreq>
16
- <priority>0.8</priority>
17
- </url>
18
- <url>
19
- <loc>nvoynov.github.io/marko/changelog.html</loc>
20
- <lastmod>2023-02-11</lastmod>
21
- <changefreq>weekly</changefreq>
22
- <priority>0.8</priority>
23
- </url>
24
- <url>
25
- <loc>nvoynov.github.io/marko/story.html</loc>
26
- <lastmod>2023-01-30</lastmod>
27
- <changefreq>weekly</changefreq>
28
- <priority>0.8</priority>
29
- </url>
30
- </urlset>
data/docs/story.html DELETED
@@ -1,132 +0,0 @@
1
- <!DOCTYPE html>
2
- <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="generator" content="pandoc" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7
- <meta name="dcterms.date" content="2023-01-26" />
8
- <title>Marko Story</title>
9
- <style>
10
- code{white-space: pre-wrap;}
11
- span.smallcaps{font-variant: small-caps;}
12
- div.columns{display: flex; gap: min(4vw, 1.5em);}
13
- div.column{flex: auto; overflow-x: auto;}
14
- div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
15
- ul.task-list{list-style: none;}
16
- ul.task-list li input[type="checkbox"] {
17
- width: 0.8em;
18
- margin: 0 0.8em 0.2em -1.6em;
19
- vertical-align: middle;
20
- }
21
- .display.math{display: block; text-align: center; margin: 0.5rem auto;}
22
- </style>
23
- <link rel="stylesheet" href="css/styles.css" />
24
- <!--[if lt IE 9]>
25
- <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
26
- <![endif]-->
27
- </head>
28
- <body>
29
- <p class="navbar">
30
- <span class="smallcaps">= <strong>“Marko” Markup Compiler</strong> = <a
31
- href="readme.html">Readme</a> ~ <a href="changelog.html">Changelog</a> ~
32
- <a href="story.html">Story</a> ~ <a
33
- href="https://github.com/nvoynov/sancho">Github</a></span>
34
- </p>
35
- <header id="title-block-header">
36
- <h1 class="title">Marko Story</h1>
37
- <p class="date">2023-01-26</p>
38
- </header>
39
- <nav id="TOC" role="doc-toc">
40
- <ul>
41
- <li><a href="#childhood-2012" id="toc-childhood-2012">Childhood,
42
- 2012</a></li>
43
- <li><a href="#adolescence-2014---2015"
44
- id="toc-adolescence-2014---2015">Adolescence, 2014 - 2015</a></li>
45
- <li><a href="#youth-since-2015" id="toc-youth-since-2015">Youth, since
46
- 2015</a></li>
47
- <li><a href="#marko-2022" id="toc-marko-2022">Marko, 2022</a></li>
48
- </ul>
49
- </nav>
50
- <p><a href="https://github.com/nvoynov/marko">Marko</a> is the result of
51
- my ten-year journey with Ruby playing the Business Analyst role.</p>
52
- <h2 id="childhood-2012">Childhood, 2012</h2>
53
- <p>Somewhere in between 2011 and 2014 I was playing Software Engineer
54
- role in some BigKnownCo where my first and foremost working tool was
55
- Microsoft Word 2007. Requirements specifications and Architecture design
56
- documents Artifacts that I was mainly working on often consisted of one
57
- and more hundreds of pages and it was such a pain to deal with in MS
58
- Word which was the corporate standard.</p>
59
- <p>In simple words it just gone crazy on large documents, the program
60
- consumed all my RAM, document navigation was slow, the program simply
61
- stopped responding, which entailed restarting the process with a loss of
62
- changes; or even worse, the loss of style formatting that is invisible
63
- to the eye when you simply cannot see it that the formatting was lost
64
- somewhere on the 225th page.</p>
65
- <blockquote>
66
- <p>So problem was clear “<strong>The problem of</strong> the lack of
67
- simple reliable tools and approaches for writing software artifacts
68
- <strong>affects</strong> technical writers who develop and manage the
69
- artifacts <strong>the impact of which is</strong> they tend to
70
- choose..”</p>
71
- </blockquote>
72
- <p>And I come up with the idea to create something light, simple and
73
- reliable to eliminate the MS Word from my work experience once and for
74
- all. This time I was curious about using YAML for storing requirements
75
- just inside file system. And I regularly done some estimations and
76
- prioritization for requirements, so I decided that FPA, PERT, and
77
- Risk-Value prioritization will be valuable features here.</p>
78
- <p>It was my first serious diving into Ruby for few weeks. I succeeded
79
- in reading / writing YAML and even provided estimations algorithms. I
80
- fall in love with Ruby. But from user perspective (I was the user) it
81
- was complete failure. Writing YAML manually was just unforgivable but
82
- that time I was obsessed with the format.</p>
83
- <blockquote>
84
- <p>YAML was chosen just because this days I dramatically reduced time
85
- for load configuration of my target service provisioning system, that
86
- stored its configuration tree in RDBMS that causes ~5 000 000 selects
87
- for reading and about the same number insert/update for writing. It just
88
- reduced to 20 000 instead of 5 000 000.</p>
89
- </blockquote>
90
- <h2 id="adolescence-2014---2015">Adolescence, 2014 - 2015</h2>
91
- <p>It took two years to return to the subject, I left that job in 2014
92
- and got haft year off. This time I discovered Markdown and static site
93
- generators, and I decided on Markdown as my primary markup format, where
94
- each source is just a plain markdown file with some metadata
95
- excerpt.</p>
96
- <p>Things were going well and in a few months, I got something quite
97
- usable. Estimations algorithms were thrown out; markup sources were
98
- assembled in one artifact that was translated into HTML by Kramdown. I
99
- named it “Creq” for “console requirements” and since then I assembled
100
- all software artifacts in my own tool.</p>
101
- <h2 id="youth-since-2015">Youth, since 2015</h2>
102
- <p>Using my tool daily on a regular basis I discovered Pandoc and then
103
- can translate my artifact into any supported format; provided more
104
- advanced artifact templates, and provided a few templates for different
105
- purposes (draft, customer deliverable, etc.), added macros for tree node
106
- body.</p>
107
- <p>This time I named my tool Clerq because it just was my regular tool -
108
- I started my day from <code>$ git checkout -b new_feature</code> and
109
- finished with merging the branch, assembling new requirements increment,
110
- and pushing into git for my development team.</p>
111
- <p>In 2018 I have read The Clean Architecture I took my first clumsy
112
- attempts to apply it for Clerq.</p>
113
- <h2 id="marko-2022">Marko, 2022</h2>
114
- <p>The last time I used Clerq for two months in July 2022. I noticed
115
- that time that I use only “create a new project” and “build the
116
- artifact” commands. And I realized that there is nothing about
117
- requirements - just about artifact assembling.</p>
118
- <p>So I took two weeks and finished 2022 with a git commit on Dec 31,
119
- 2022 :)</p>
120
- <p>The Marko purpose is assembling markup artifact from separated markup
121
- sources. Its interfaces are simple and clear. It could be naturally
122
- extended through Rakefile for any specific purpose related to visiting
123
- artifacts tree nodes.</p>
124
- <p>This is the first time I feel for a product that there are nothing I
125
- want to take or change. Just “Right Product, Done Right, Managed
126
- Messy”</p>
127
- <div id="footer">
128
- <hr />
129
- <p>© 2022-2023 <a href="http://nvoynov.github.io/">nvoynov</a></p>
130
- </div>
131
- </body>
132
- </html>
@@ -1,13 +0,0 @@
1
- % Marko Demo Project
2
-
3
- # Overview
4
-
5
- This project is an example of developing a technical artifacts with Marko. The artifact is Marko Requirements Specification that also servers as Marko Sandbox for testing and features development.
6
-
7
- # Usage
8
-
9
- Run `$ marko` to see command-line interface
10
-
11
- Run `$ rake marko:publish` to publish the artifact
12
-
13
- Run `$ rake -T` to see other custom interface
@@ -1,27 +0,0 @@
1
- # Assemble artifact
2
- {{id: .assemble, parent: fr}}
3
-
4
- The system shall provide the function to assemble artifact.
5
-
6
- __Input__
7
-
8
- * NO
9
-
10
- __Output__
11
-
12
- Parameter Type 0..* Description
13
- --------- -------- ---- --------------
14
- tree TreeNode 1 assembled tree
15
-
16
- __Flow__
17
-
18
- @@todo provide id for required functions and change steps with appropriate links
19
-
20
- 1. get list of project sources
21
- 2. parse sources buffering nodes and errors
22
- 3. fail "parsing errors" if errors.any?
23
- 4. assemble artifact from buffer of nodes
24
- 5. generate and inject auto ids
25
- 6. validate artifact buffering errors
26
- 7. fail "tree errors" if errors.any?
27
- 8. return artifact
@@ -1,25 +0,0 @@
1
- # Compile artifact
2
- {{id: .compile, parent: fr}}
3
-
4
- The system shall provide the function to create deliverable artifact.
5
-
6
- __Input__
7
-
8
- Parameter Type 0..* Description
9
- --------- -------- ---- --------------
10
- tree TreeNode 1 assembled tree
11
- template String 1 ERB template
12
- filename String 1 filename
13
-
14
- __Output__
15
-
16
- The output of the function must be well-formed deliverable with `filename` built on `template` parameter.
17
-
18
- __Flow__
19
-
20
- @@todo provide id for required functions and change steps with appropriate links
21
-
22
- 1. `tree` = [[fr.assemble]] unless `tree`
23
- 2. load template body from `template`
24
- 3. backup `filename` to `<filename>~`
25
- 4. render `template` for each node of `tree` into `filename`
@@ -1,111 +0,0 @@
1
- # Source Markup
2
- {{id: .markup, parent: fr}}
3
-
4
- The main and only entity in the system is [[fr.treenode]]. The system shall provide the following abilities for the entity:
5
-
6
- @@list
7
-
8
- ## Node Markup
9
- {{id: .node}}
10
-
11
- The system shall support the following node markup.
12
-
13
- ```markdown
14
- # <title>
15
- {{\<meta\>}}
16
- \<body\>
17
- ```
18
-
19
- Where:
20
-
21
- - Each node starts from Markdown header mark `#`.
22
- - The header mark can be followed by node title.
23
- - The next line _might_ contain metadata block:
24
- - that starts from `{{` and finishes with `}}`;
25
- - that can be one or multiline string.
26
- - The next lines tile the end of file or next header mark `#` are considered as node body.
27
-
28
- ## Get Sources
29
-
30
- The system shall provide function to getting all sources files from project repository.
31
-
32
- @@todo define project repository
33
-
34
- ## Parse Source
35
-
36
- The system shall provide the function to parse source file.
37
-
38
- During the parsing process the system must record source information within the node parsed, such as origin file name and the number of line inside the origin where the node begins. This information must be stored inside metadata as [[fr.treenode.orig]].
39
-
40
- __Input__
41
-
42
- Parameter Type 0..* Description
43
- --------- ------ ---- -----------
44
- filename String 1 filename
45
-
46
- __Output__
47
-
48
- Parameter Type 0..* Description
49
- --------- ------ ---- -----------
50
- node Node 0..n node parsed
51
-
52
- ## Assemble Tree
53
-
54
- The system shall provide the function to assemble the artifact tree. The artifact tree is assembled based on [[fr.treenode.tree]].
55
-
56
- @@todo The assemblage algorithm, errors handler
57
-
58
- __Input__
59
-
60
- Parameter Type 0..* Description
61
- --------- ------ ---- -----------
62
- node Node 0..n node array
63
-
64
- __Output__
65
-
66
- Parameter Type 0..* Description
67
- --------- ------ ---- -----------
68
- node Node 1 root tree
69
-
70
- ## Inject Id
71
-
72
- The system shall provide each node with unique node Id.
73
-
74
- Some nodes can already have ids from source file, especially those that referenced as parent or child and placed in separate files. For those nodes that still have empty id, the system must generate auto id 0..99.
75
-
76
- For example, when the system has assembled the tree
77
-
78
- ```markdown
79
- # Artifact
80
- ## Introduction
81
- ### Purpose
82
- ### Scope
83
- # User Requirements #ur
84
- # Functional Requirements #fr
85
- ```
86
-
87
- and then generated id, the generated ids should be as follows:
88
-
89
- ```markdown
90
- # Artifact Title #00
91
- ## Introduction #01.01
92
- ### Purpose #01.01.01
93
- ### Scope #01.01.02
94
- # User Requirements #ur
95
- # Functional Requirements #fr
96
- ```
97
-
98
- __Input__
99
-
100
- Parameter Type 0..* Description
101
- --------- ------ ---- -----------
102
- root Node 1 root node
103
-
104
- ## Checking Tree
105
-
106
- The system shall provide the function to check assembled tree for errors related to assembling tree based on [[fr.treenode.tree]]. The system must check the following errors:
107
-
108
- - `duplicate id`, finds two or more nodes that share the same id;
109
- - `unknown parent`, finds nodes that have `parent` metadata, but parent not found in the tree;
110
- - `unknown index`, finds nodes with `order_index` metadata where one or more children in the index not found;
111
- - `unknown links`, finds nodes containing links but the links are not found.