clerq 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -3
  3. data/CHANGELOG.md +22 -0
  4. data/Gemfile.lock +1 -1
  5. data/README.md +187 -143
  6. data/TODO.md +6 -2
  7. data/clerq.gemspec +2 -2
  8. data/lib/assets/knb/SRS-IEEE-830-1998.md +293 -0
  9. data/lib/assets/knb/SRS-RUP.md +282 -0
  10. data/lib/assets/knb/ears-with-examples.md +101 -0
  11. data/lib/assets/knb/problem-statement.md +8 -0
  12. data/lib/assets/knb/product-statement.md +8 -0
  13. data/lib/assets/knb/requirement-attributes.md +26 -0
  14. data/lib/assets/knb/use-case.md +39 -0
  15. data/lib/assets/new/clerq.thor.tt +2 -4
  16. data/lib/assets/new/content.md.tt +2 -40
  17. data/lib/assets/tt/default.md.erb +19 -40
  18. data/lib/assets/tt/pandoc.md.erb +2 -1
  19. data/lib/clerq.rb +51 -11
  20. data/lib/clerq/cli.rb +56 -29
  21. data/lib/clerq/entities.rb +0 -1
  22. data/lib/clerq/entities/node.rb +129 -115
  23. data/lib/clerq/interactors.rb +4 -4
  24. data/lib/clerq/interactors/{check_nodes.rb → check_assembly.rb} +6 -10
  25. data/lib/clerq/interactors/create_node.rb +10 -8
  26. data/lib/clerq/interactors/interactor.rb +2 -4
  27. data/lib/clerq/interactors/query_assembly.rb +69 -0
  28. data/lib/clerq/interactors/query_template.rb +31 -0
  29. data/lib/clerq/interactors/render_assembly.rb +41 -0
  30. data/lib/clerq/render_erb.rb +33 -0
  31. data/lib/clerq/repositories.rb +2 -3
  32. data/lib/clerq/repositories/file_repository.rb +58 -0
  33. data/lib/clerq/repositories/node_repository.rb +70 -29
  34. data/lib/clerq/repositories/text_repository.rb +47 -0
  35. data/lib/clerq/settings.rb +2 -2
  36. data/lib/clerq/version.rb +1 -1
  37. metadata +21 -20
  38. data/lib/assets/tt/gitlab.md.erb +0 -93
  39. data/lib/assets/tt/raw.md.erb +0 -23
  40. data/lib/clerq/entities/template.rb +0 -19
  41. data/lib/clerq/gateways.rb +0 -3
  42. data/lib/clerq/gateways/gateway.rb +0 -17
  43. data/lib/clerq/gateways/in_files.rb +0 -36
  44. data/lib/clerq/gateways/in_memory.rb +0 -35
  45. data/lib/clerq/interactors/compile_nodes.rb +0 -31
  46. data/lib/clerq/interactors/join_nodes.rb +0 -59
  47. data/lib/clerq/interactors/query_nodes.rb +0 -62
  48. data/lib/clerq/repositories/in_memory.rb +0 -45
  49. data/lib/clerq/repositories/repository.rb +0 -11
  50. data/lib/clerq/repositories/template_repository.rb +0 -53
  51. data/lib/clerq/templater.rb +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d95f522537af88379a6881b154fc50453973102601db1cb4be573f655a33a78d
4
- data.tar.gz: cb5e26ff19ff66d0ecc6364decb2caaee046c763956fdd2c39b9e71e932c6abb
3
+ metadata.gz: c4d9114f078750db97781623afefdbd33f39809dc02c6f68dfe8303d0764b751
4
+ data.tar.gz: d9cb6491239baa42fdc945ad0282aa3683aa850079de52c26bd5f37a370e01fa
5
5
  SHA512:
6
- metadata.gz: 2ce20279f674973d75ab59d1cdaf474248459a442dd58eeebb9980c1d59fe4c687c7956e72bade7be78b9b5134b595e35e3859d5a983cb009afcb17481a47ff5
7
- data.tar.gz: 55b67ea4ef4b43285c6c5eb51b49d2c3fb2cdef7f323dfe897a4e8a9ecd5644d3b6b3ee563ab78bc06291a2cdc9a3b6ed9e2bcc784669bc842438ac0f96a42b1
6
+ metadata.gz: cf035ee76e81ff8f565e5d5448773185075839589ebea7773ed8ace9e7477bb8700c805419e17dbc358608b57db01008fc056f7fee203b37bf1966d6ed4c9ff7
7
+ data.tar.gz: 1758cc13f790117e93944ccc17f97bb738a26cede5c3e70d462dedae9c8deb4aedeaffe868f3056d527ab207864cef083ffdb48b6eabf63c34be3f623639bbb8
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  /lib/sandbox/
2
- /test/.sandbox/
3
2
  /.imdone/
4
3
  /.bundle/
5
4
  /.yardoc
@@ -8,5 +7,4 @@
8
7
  /doc/
9
8
  /pkg/
10
9
  /spec/reports/
11
- /test/tmp/
12
- /tmp/
10
+ Gemfile.lock
data/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Change log
2
+
3
+ ## 0.2.0 (2019-11-23)
4
+
5
+ Changes:
6
+
7
+ * Started new project [Clerq Video Guide](https://github.com/nvoynov/clerq-video-guide) that provides example of using Clerq.
8
+ * Done massive refactoring of source code; no more gateways.
9
+ * Totally redesigned NodeRepository and TextRepository.
10
+ * Improved interactors caused by gateways throwing out.
11
+ * Improved tests suite; no more DEPRECATED Minitest; Dir.mktmpdir is used for sandbox.
12
+ * Improved README to include all the changes mentioned before.
13
+ * Improved `clerq new PROJECT` command; when the `PROJECT` parameter consists of more than one word, it will create `<project>.thor` file that follows to usual ruby file and class naming conventions; e.g. for `user guide` it will create `user_guide.thor` and `class UserGuide < Thor` inside.
14
+ * Shortened `content.md.tt` content
15
+ * Only two templates in the box are left - `default.md.erb` and `pandoc.md.erb`.
16
+ * Thor `error(msg)` in `cli.rb` changed to `stop!(mgs); raise Thor::Error`.
17
+ * Improved CLI for `build`, `check`, `toc`, `node`; now each one checks if the command is running in clerq project, checked if `clerq.yml` or `src` folder exist.
18
+ * Other small improvements.
19
+
20
+ ## 0.1.0 (2019-11-08)
21
+
22
+ First release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clerq (0.1.0)
4
+ clerq (0.2.0)
5
5
  thor (~> 0.20.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,42 +1,139 @@
1
1
  # Clerq
2
2
 
3
- Gem `clerq` represents an unusual but effective way of writing and managing requirements. It resembles some static site builders and was inspired by those. Actually this gem provides the ability to write requirements in separate files and combine those to a unified consistent requirements source for any future purposes.
3
+ __What is Clerq?__
4
4
 
5
- Sounds too simple? Combine it with a modern text editor that supports markdown, place repository under `Git`, install `Pandoc` to convert it to any supported format. Create your own commands through `Thor` to automate every piece of work that can be automated. Give it a try!
5
+ The Clerq is a toolbox for manipulating the hierarchy of text data placed in separate markdown files. It implements three basic ideas:
6
+
7
+ 1. Text data repository in file system, based on markdown files with few extra conventions.
8
+ 2. Ruby gem that provides access to the text hierarchy from the repository.
9
+ 3. Basic CLI to manage the repository and compile the text data to documents based on erb-templates.
10
+
11
+ __What for?__
12
+
13
+ The Clerq is suitable for writing thick structured texts. The initial purpose for the system was the "requirements management in file system" and it supposed to help in writing stuff like Vision, RFP, URD, SRS, SAD, and deriving various requirements based artifacts. But now it seems much wider.
6
14
 
7
15
  ## Installation
8
16
 
9
- Add this line to your application's Gemfile:
17
+ Install it yourself as:
18
+
19
+ $ gem install clerq
20
+
21
+ ## Usage
22
+
23
+ The Clerq is entirely based on one single domain entity `Node` that represents a node of tree hierarchy and provides `id`, `title`, `body`, and `metadata` attributes. It supposes the following simple workflow:
24
+
25
+ * you create files with text content,
26
+ * and manipulate the data by scripts.
27
+
28
+ ### Project
29
+
30
+ The Clerq project lives in the following folders structure that will be created by `clerq new <project>`:
31
+
32
+ * `bin/` - for output documents;
33
+ * `bin/assets` - for assets;
34
+ * `knb/` - knowledge base;
35
+ * `lib/` - place for extra Ruby code;
36
+ * `src/` - source data repository;
37
+ * `tt/` - templates;
38
+ * `<project>.thor` - see [Scripting](#scripting);
39
+ * `clerq.yml` - project settings;
40
+ * `README.md`.
41
+
42
+ ### Writing
43
+
44
+ The Clerq reads nodes from a set of separate files and assembles it to a single hierarchy. There are a few conventions for a separate file that will become a part of hierarchy.
45
+
46
+ #### Files
47
+
48
+ The first convention is the scheme how a markdown content becomes the `Node` entity.
10
49
 
11
- ```ruby
12
- gem 'clerq'
13
50
  ```
51
+ # [p2] Part two
52
+ {{parent: top}}
14
53
 
15
- And then execute:
54
+ Body
55
+ ```
16
56
 
17
- $ bundle
57
+ Where
18
58
 
19
- Or install it yourself as:
59
+ * `#` familiar markdown header that indicates a new `node`;
60
+ * `[p1]` is an optional identifier that becomes `node.id`;
61
+ * `Part two` is an optional `node.title`;
62
+ * `{{parent: top}}` in an optional metadata section that becomes `node.meta`;
63
+ * and finally `Body` is an optional `node.body`.
20
64
 
21
- $ gem install clerq
65
+ Every new header (`#`) at any level indicates a new node. When a file contains headers of different levels, the nodes will be created in a natural hierarchy based on header levels. So as the result of reading the content below, the Clerq will create the natural hierarchy with root node `Top` that holds two child nodes `First` and `Second`.
22
66
 
23
- ## Usage
67
+ ```markdown
68
+ # Top
69
+ ## First
70
+ ## Second
71
+ ```
72
+
73
+ One more extra thing is links. You can place links to other nodes in the body section of the file content by using `[[<id>]]` macro. It can be handled in templates.
74
+
75
+ #### IDs
76
+
77
+ Each node must have its own unique id so that you can refer to it in other parts of the project. That's why the recommended practice is to put the id straight into the header `# [node id] node title`.
78
+
79
+ ID can start with one dot, like `[.suffix]`, and clerq will add id of parent node. For the followed example, `[.fm]` will be translated to `[cm.fm]`.
80
+
81
+ ```
82
+ # 3 Function requirements
83
+ ## [cm] Components
84
+ ### [.fm] File manager
85
+ ### Logger
86
+ ```
87
+
88
+ When an id is not provided, Clerq will generate it automatically, and you can freely combine nodes that have id and that has not. For the example above, the `Logger` will be identified as `[cm.01] Logger`.
89
+
90
+ #### Meta
91
+
92
+ The excerpt, the text in brackets `{{ }}` that follows by the header, contains node attributes. And the second convention mentioned in [Writing](#writing) section is two magic metadata attributes that specify parameters of a hierarchy:
93
+
94
+ 1. `parent: <id>` indicates that the node belongs to a node with specified `id`;
95
+ 2. `order_index: <id1> <id2>` indicates that child nodes must be lined up in specified order.
96
+
97
+ You can place in metadata any simple string that suitable for providing additional information like status, originator, author, priority, etc. E.g.
98
+
99
+ ```
100
+ # [r.1]
101
+ {{parent: r, status: draft}}
102
+
103
+ # [r.2]
104
+ {{parent: r
105
+ }}
106
+
107
+ # [r.3]
108
+ {{
109
+ parent: r}}
110
+ ```
111
+
112
+ #### Assets
113
+
114
+ When you want to provide some assets or links to something outside the repository you can provide the lint to the assets. Put the asset in the `bin/assets` folder and specify the link.
115
+
116
+ ```markdown
117
+ # [ent] Entities
118
+
119
+ The following picture shows something
24
120
 
25
- To see the list of all standard clerq commands type in console `clerq help` and follow the printed instructions.
121
+ ![Image](assets/er.png)
122
+ ```
26
123
 
27
- To see the list of all specific for the project commands type `thor help <project>`
124
+ ### CLI
28
125
 
29
- Actually the best way to start with Clerq is to see it in action through [Promo](#promo). Just start from copying promo content and running some commands.
126
+ Clerq provides CLI that is based on Thor, so all standard thor features are supported. To print all Clerq commands type `$ clerq help` in your console. To see the list of all the project-specific commands type `thor help <project>`.
30
127
 
31
- ### Creating new project
128
+ #### Create new project
32
129
 
33
130
  To create a new project run `new` command:
34
131
 
35
132
  $ clerq new <project_name>
36
133
 
37
- ### Create new item
134
+ #### Create new file
38
135
 
39
- The simplest way of adding new items to the project is to add a new file to the `src` directory. Of course, Clerq also provides the command `node`
136
+ The simplest way of adding new items to the project is to add a new file to the `src` directory. Of course, Clerq also provides the command `node` that can create template-based files:
40
137
 
41
138
  $ clerq node ID [TITLE] [-t TEMPLATE]
42
139
 
@@ -46,13 +143,13 @@ If you are using images or other assets, you should place it to `bin/assets` dir
46
143
 
47
144
  __Templates__
48
145
 
49
- You also can prepare your own templates it `tt` folder and provide template through `-t/--template` option. The content of the template file will be placed on the body of the requirement.
146
+ You also can prepare your own templates it `tt` folder and provide template through `-t/--template` option. The content of the template will be placed on the created file.
50
147
 
51
- ### Check repository
148
+ #### Check repository
52
149
 
53
150
  Because of lots of handwriting there can be some specific errors in repository. The most obvious are:
54
151
 
55
- * non-unique requirements identifiers;
152
+ * non-unique identifiers;
56
153
  * links to and id that does not exist:
57
154
  * for `parent` attribute;
58
155
  * in `order_index`;
@@ -62,9 +159,9 @@ The system provides command `clerq check` that will check the repository for the
62
159
 
63
160
  $ clerq check
64
161
 
65
- ### Build project
162
+ #### Build project
66
163
 
67
- Clerq provides the ability to combine all requirements from the project repository and create final document. To create such document you can use `clerq build` command:
164
+ Clerq provides the ability to combine all the text data from the project repository and create the final document. To create such document you can use `clerq build` command:
68
165
 
69
166
  $ clerq build
70
167
 
@@ -81,182 +178,129 @@ You also can specify these settings through `clerq build` options:
81
178
  * `-t/--template TEMPLATE` provides the ability to specify template;
82
179
  * `-o/--output FILE_NAME` provides the ability to specify output file name.
83
180
 
84
- __Query requirements__
181
+ __Queries__
85
182
 
86
- Clerq also provides ability to query requirements that meet query criteria. To query requirements you should use `-q/--query QUERY_STRING` where `QUERY_STRING` is ruby code that will test if each node meets the `QUERY_STRING`. For example, `node.tile == 'Functional requirements'` or `node.id == 'us'`.
183
+ Clerq provides the ability to query data that match query criteria. To query data you should use `-q/--query QUERY_STRING` option where `QUERY_STRING` is ruby code that will test if each node matches the `QUERY_STRING`. For example, `node.tile == 'Functional requirements'` or `node.id == 'us'`.
87
184
 
88
- ### Print TOC
185
+ #### Print TOC
89
186
 
90
187
  Sometimes it helpful to check repository structure by `clerq toc` command. The command also supports `-q/--query QUERY_STRING` option.
91
188
 
92
- ## Known issues
189
+ ### Scripting
93
190
 
94
- ### Failed test
191
+ The section assumes that you are familiar with Ruby or some other programming language.
95
192
 
96
- Some tests of CLI fail by `$ bundle exec rake test` but pass individually one by one through `$ bundle exec rake test TEST=test/cli/cli_build_spec.rb` and I haven't caught the reason.
193
+ Using the basic commands described in [CLI](#cli) section gives you just the ability to create final documents or other output. But this is just the tip of the iceberg, just the beginning, and you can do much more than that with Clerq.
97
194
 
98
- ### Thor version
195
+ A usual scenario will consist of two simple steps:
99
196
 
100
- The one issue I certain in is when you are using different version of thor, your custom scripts won't work.
197
+ 1. Get data hierarchy from the repository.
198
+ 2. Do some processing of the hierarchy.
101
199
 
102
- ## Structure
200
+ Instead of adding extra scripts files somewhere in the project, you can write tasks to `<project>.thor` file and access to them through `thor <project>:<your-task> [<params>]`.
103
201
 
104
- ### Project
202
+ #### Node class
105
203
 
106
- The Clerq project has the following folders structure by default (that will be created by `clerq new <project>`):
204
+ The [Writing](#writing) section provides the basic knowledge to understand Clerq, and now it is the right time to see the [Node class](https://github.com/nvoynov/clerq/blob/master/lib/clerq/entities/node.rb). It implements the Composite pattern.
107
205
 
108
- * `bin/` - for output documents;
109
- * `bin/assets` - for assets;
110
- * `knb/` - knowledge base;
111
- * `lib/` - place for Ruby code;
112
- * `src/` - place for requirements;
113
- * `tt/` - templates;
114
- * `<project>.thor` - file with automated tasks (see more in [Automating](#automating));
115
- * `clerq.yml` - project settings;
116
- * `README.md`.
117
-
118
- ### Repository
119
-
120
- Place requirements to the `src` folder. You can group your requirements by different folders and subfolders - Clerq load all the files of `src` including all subfolders at any level of nesting.
121
-
122
- ### Node
123
-
124
- Each requirement is a markdown file with a few additional compliances (will be explained below) where every file can contain any number of requirements. Let's meet some files ...
206
+ #### Interactors
125
207
 
126
- **content.md**
208
+ Clerq provides five followed interactors:
127
209
 
128
- ```markdown
129
- # 1 Introduction
130
- {skip_meta: true}
131
- ## 1.1 Purpose
132
- ## 1.2 Scope
133
- ## 1.3 References
134
- ## 1.4 Definitions
135
- ## 1.5 Overview
136
- # [f] Requirements
137
- # [i] Interfaces
138
- # [n] Non-functional requirements
139
- # [c] Design constraints
140
- ```
210
+ * `QueryAssembly` provides assembly of repository as root Node;
211
+ * `CheckAssembly` checks the assembly for errors (ids and links);
212
+ * `RenderAssembly` render assembly by provided erb-template;
213
+ * `CreateNode` crates new node in the repository;
214
+ * `QueryTemplate` provides text of the template provided as parameter.
141
215
 
142
- **fm.md**
143
-
144
- ```markdown
145
- # [.fm] File manager
146
- {{parent: f}}
216
+ The first part of each repository related task is to get repository assembly. It can be performed through `NodeRepository#assemble` or `QueryAssembly.call`. Each of these methods returns Node that provides [Enumerable](https://ruby-doc.org/core-2.6.5/Enumerable.html) interface.
147
217
 
148
- The system shall provide the `File Manager` component. The component shall provide the following features:
218
+ Let's invent some advanced scenario. Assume that you develop a "User requirements document" and the project policy requires that each user requirement must have the parameter called `originator`. You can write the policy as followed:
149
219
 
150
- {{@@list}}
151
-
152
- ## Read folders structure
153
- ## Read file content
154
- ## Load ".md"
155
- ## Load ".tt"
220
+ ```ruby
221
+ require 'clerq'
222
+ include Clerk::Interactors
223
+
224
+ # supposed you have something like user requirements document
225
+ node = QueryAssembly.("node.title == 'User requirements'")
226
+ miss = node.drop(1).select{|n| n[:originator].empty? }
227
+ unless miss.empty?
228
+ errmsg = "`Originator` is missed for the next nodes:\n"
229
+ errmsg << miss.map(&:id).join(', ')
230
+ raise Error, errmsg
231
+ end
156
232
  ```
157
233
 
158
- #### Headers
234
+ #### Root Node
159
235
 
160
- Every requirement starts with markdown header. All the text between headers belongs to the requirement.
236
+ A hierarchy starts form root node and Clerq provides the root node with parameter `title` specified in `clerq.yml` file. The subject is a bit tricky actually and there are few extra considerations I try to explain below (and you can always see tests)
161
237
 
162
- #### Identifiers
238
+ When your repository stills empty, the Clerq will provide you with the root node. From one point it resembles the NullObject.
163
239
 
164
- Each requirement must have its own unique identifier so that you can refer to it in other parts of the project. That's why the recommended practice is to put id straight into the header `# [requirement_id] requirement title`.
240
+ When you have a few root nodes in your repository, those become direct childs of the root node. But when your repository contains single root node, the Clerq will return the single node as root node.
165
241
 
166
- ID can start with one dot, like `[.suffix]`, and clerq will add parent requirement id before. For the followed example, `[.fm]` will be translated to `[cm.fm]`.
242
+ The following example does not provide root node and it causes adding root node from `clerq.yml`.
167
243
 
168
244
  ```
169
- # 3 Function requirements
170
- ## [cm] Components
171
- ### [.fm] File manager
172
- ### Logger
245
+ # User requirements
246
+ # Functional requirements
173
247
  ```
174
248
 
175
- When an identifier is not provided, Clerq will generate it automatically, and you can combine requirements that have id and requirements that does not. For the example above, the `Logger` will be identified as `[cm.01] Logger`.
176
-
177
- #### Attributes
178
-
179
- The excerpt, the text in brackets `{{ }}` that follows by the header, contains requirement attributes. You can place here anything you need to provide additional information, like status, source, author, priority, etc. All the following examples are correct.
249
+ But this one provides, and root node will be `Product SRS` according to rule 1.
180
250
 
181
251
  ```
182
- # [r.1]
183
- {{parent: r; skip_meta: true}}
184
-
185
- # [r.2]
186
- {{parent: r
187
- skip_meta: true}}
188
-
189
- # [r.3]
190
- {{
191
- parent: r
192
- skip_meta: true
193
- }}
252
+ # Product SRS
253
+ ## User requirements
254
+ ## Functional requirements
194
255
  ```
195
256
 
196
- The next attributes are **system attributes** and these influence to Clerq behavior:
197
-
198
- * `order_index: feature1 feature2` will sort child requirements in provided order;
199
- * `parent: f` will place the requirement as a child of parent requirement `[f]`.
257
+ The QueryAssembly.call(query) follow similar logic
200
258
 
201
- All other attributes (`status`, `source`, etc.) are **user attributes** and do not influence Clerq behavior. These attributes are holding in requirement's attributes and can be used for publishing or automation purpose. One of such `skip_meta: true` used producing output document.
202
-
203
- #### Assets
204
-
205
- If you need to add an image or some other material into a requirements body, put it in the `bin/assets` folder and specify the link
206
-
207
- ```markdown
208
- # [ent] Entities
209
-
210
- ... the following picture shows conceptual entity relations diagram
211
-
212
- ![Image](assets/er.png)
213
- ```
259
+ * When query result is empty, the Clerq will provide result with QueryNullNode (node.title == `Query`, node[:query] == QUERY_STRING)
260
+ * When query result contains single node, it becomes a root query node.
261
+ * When query result contains more than one, those becomes a child of root query node.
214
262
 
215
263
  ### Templating
216
264
 
217
- To customize Clerq output the system provides `erb` templates. You have a lot of possibilities here if you are familiar with Ruby. Clerq distributions provides two basic templates - `default.md.erb` and `pandoc.md.erb`.
218
-
219
- The first one combines all requirements to one document and there no requirements transformation actually.
265
+ The Clerq provides the ability to precise adjusting the output for `clerq build` command by erb-templates and gives you two basic templates from the box.
220
266
 
221
- The second one has a lot of features and provides a good example of how to add new features in the requirements body. It handles three macros:
267
+ * [default.md.erb](https://github.com/nvoynov/clerq/blob/master/lib/assets/tt/default.md.erb) that just combines all nodes to one markdown document;
268
+ * [pandoc.md.erb](https://github.com/nvoynov/clerq/blob/master/lib/assets/tt/pandoc.md.erb) is more advanced, it produces [Pandoc's Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown) and provides three followed macros for node body:
269
+ * `{{@@list}}` - replaces the macro with the list of child requirements;
270
+ * `{{@@tree}}` - replaces the macro with the tree of child requirements;
271
+ * `{{@@skip}}` - skip all content inside the brackets.
222
272
 
223
- * `{{@@list}}` - replaces the macro with the list of child requirements;
224
- * `{{@@tree}}` - replaces the macro with the tree of child requirements;
225
- * `{{@@skip}}` - skip all content inside the brackets.
273
+ ## Known issues
226
274
 
227
- `pandoc.md.erb` generates Pandoc markdown and can be used to convert the output of the template in any supported format. You also can use relative requirements links here. An example of using Pandoc to generate `docx` can be found in [Promo](#promo).
275
+ ### Thor version
228
276
 
229
- ### Automating
277
+ The one issue I certain in is when you are using different version of thor, your custom scripts won't work.
230
278
 
231
- You can and should extend the standard Clerq CLI by your own commands. See `<project>.thor` file as an example and call for action. It is all the Ruby code and the main point is to get requirements collection and then transform it to anything you want. It is the `Thor` gem that does all work related to CLI.
279
+ ## Some considerations
232
280
 
233
- You can find some examples of custom automating in [Promo](#promo), and I hope to provide some more examples in the future.
281
+ ### Some obvious things
234
282
 
235
- ## Promo
283
+ Use modern text editor that provides projects tree. like Atom, Sublime, etc.
236
284
 
237
- The clerq provides the promotion project `promo` than contains requirements to the clerq. You can copy the `promo` content to the current clerq repository by `clerq promo` command.
285
+ Hold your projects in Git
238
286
 
239
- The promo provides few specific commands that created to show you the way how to extend clerq. See `promo.thor` for details.
287
+ Use pandoc for generating output in different formats
240
288
 
241
- ## History
289
+ ### MarkupNode
242
290
 
243
- During 4 years work for my previous employer I participated in dozen software development and software reengineering projects and developed dozen bulk SRS and SAD documents. All those documents were developed in MS Word as a corporate standard format for all project documentation. And every of those often cause some headache usually with casual losses of style formatting or dead halt of Microsoft Word.
291
+ Don't like the current dirty solution with templates and incorporated MarkupNode that does all that stuff with macro. It is the first attempt to provide template that can skipp comments
244
292
 
245
- When I left the employer, I decided to create a small toolkit for writing software documentation. The idea was to hold requirements in Yaml, each item in a separate file, and to provide reach features for effort estimation and prioritizing based on requirements. The first attempt was failed but brought some output. Throw out extra features! One item per file is a hell to author (but for a developer it was rather practical).
293
+ ### Several artifacts
246
294
 
247
- As the result of the first fail, the gem `Creq` was born. Exra features were thrown out. An author not limited to Yaml and uses Markdown now; he can write as many topics as he wants in one file. And for my new employer all requirements were developed in Creq. Some lessons were learn, some peculiarities were met, and then I decided to do some reengineering and developed Clerq. So here we are and now I have no claims to the subject of requirements writing and management.
295
+ Because Clerq has `-q/--query QUERY_STRING` option you can be interested in developing several different artifacts in one project.
248
296
 
249
- * One Clerq project per one document!
250
- * Document versioning and authors collaboration are under Git!
251
- * Any text editor is suitable for requirements writing! Of course, markdown syntax highlighting feature is desired.
252
- * Single consistent requirements source and many templates for final documents (I like to left "TBD", "TODO" and other comment for myself, reviewer, and developers but it cannot be left in documents releases.)
253
- * All extra repeated job for certain project can be automated through Thor.
297
+ I was considering such an example to develop all software project documents in one clerq project but decided that it is more properly to develop one single artifact per project because usually, each artifact has its own develop-review-release cycle.
254
298
 
255
- The last thing should be mentioned is drifting the original purpose of requirements management to compilation bulk documents from small pieces, and a requirement here is just a piece of text that can express just anything.
299
+ Also, I was considering to add some kind of a "top" project that is just a wrapper for individual projects inside (each of them is the clerq project, and the top project just provides a specific set of commands.) I was speculating about some kind of shared content and tracing nodes between different artifacts. But for the moment I have no full-fledged vision.
256
300
 
257
301
  ## Development
258
302
 
259
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
303
+ The project is bundled, so after checking out the repo, run `bundle` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
260
304
 
261
305
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
262
306