clerq 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +6 -0
  5. data/Gemfile.lock +24 -0
  6. data/README.md +269 -0
  7. data/Rakefile +10 -0
  8. data/TODO.md +3 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/clerq.gemspec +44 -0
  12. data/exe/clerq +8 -0
  13. data/lib/assets/new/README.md.tt +75 -0
  14. data/lib/assets/new/clerq.thor.tt +15 -0
  15. data/lib/assets/new/clerq.yml.tt +4 -0
  16. data/lib/assets/new/content.md.tt +41 -0
  17. data/lib/assets/promo/README.md +40 -0
  18. data/lib/assets/promo/bin/Clerq SRS.docx +0 -0
  19. data/lib/assets/promo/bin/Clerq SRS.md +579 -0
  20. data/lib/assets/promo/bin/assets/promo_dark.png +0 -0
  21. data/lib/assets/promo/bin/assets/promo_light.png +0 -0
  22. data/lib/assets/promo/clerq.yml +3 -0
  23. data/lib/assets/promo/promo.thor +58 -0
  24. data/lib/assets/promo/src/clerq.md +82 -0
  25. data/lib/assets/promo/src/fr/cmp.node.md +14 -0
  26. data/lib/assets/promo/src/fr/cmp.repo.md +10 -0
  27. data/lib/assets/promo/src/fr/cmp.tt.md +20 -0
  28. data/lib/assets/promo/src/fr/cmp.writer.md +19 -0
  29. data/lib/assets/promo/src/fr/ent.md +32 -0
  30. data/lib/assets/promo/src/ui/cli/cli.bld.md +32 -0
  31. data/lib/assets/promo/src/ui/cli/cli.chk.md +17 -0
  32. data/lib/assets/promo/src/ui/cli/cli.hlp.md +14 -0
  33. data/lib/assets/promo/src/ui/cli/cli.new.md +20 -0
  34. data/lib/assets/promo/src/ui/cli/cli.opt.md +11 -0
  35. data/lib/assets/promo/src/ui/cli/cli.ver.md +4 -0
  36. data/lib/assets/promo/src/ui/ui.cli.md +8 -0
  37. data/lib/assets/promo/src/us/us.reader.md +8 -0
  38. data/lib/assets/promo/src/us/us.writer.md +79 -0
  39. data/lib/assets/tt/default.md.erb +64 -0
  40. data/lib/assets/tt/gitlab.md.erb +93 -0
  41. data/lib/assets/tt/pandoc.md.erb +88 -0
  42. data/lib/assets/tt/raw.md.erb +23 -0
  43. data/lib/clerq.rb +41 -0
  44. data/lib/clerq/cli.rb +129 -0
  45. data/lib/clerq/entities.rb +2 -0
  46. data/lib/clerq/entities/node.rb +135 -0
  47. data/lib/clerq/entities/template.rb +19 -0
  48. data/lib/clerq/gateways.rb +3 -0
  49. data/lib/clerq/gateways/gateway.rb +17 -0
  50. data/lib/clerq/gateways/in_files.rb +36 -0
  51. data/lib/clerq/gateways/in_memory.rb +35 -0
  52. data/lib/clerq/interactors.rb +5 -0
  53. data/lib/clerq/interactors/check_nodes.rb +81 -0
  54. data/lib/clerq/interactors/compile_nodes.rb +31 -0
  55. data/lib/clerq/interactors/create_node.rb +40 -0
  56. data/lib/clerq/interactors/interactor.rb +28 -0
  57. data/lib/clerq/interactors/join_nodes.rb +59 -0
  58. data/lib/clerq/interactors/query_nodes.rb +62 -0
  59. data/lib/clerq/properties.rb +21 -0
  60. data/lib/clerq/repositories.rb +5 -0
  61. data/lib/clerq/repositories/in_memory.rb +45 -0
  62. data/lib/clerq/repositories/node_reader.rb +107 -0
  63. data/lib/clerq/repositories/node_repository.rb +56 -0
  64. data/lib/clerq/repositories/repository.rb +11 -0
  65. data/lib/clerq/repositories/template_repository.rb +53 -0
  66. data/lib/clerq/settings.rb +56 -0
  67. data/lib/clerq/templater.rb +32 -0
  68. data/lib/clerq/version.rb +3 -0
  69. metadata +172 -0
@@ -0,0 +1,15 @@
1
+ # TODO how about to include commands automatically from 'lib' folder
2
+
3
+ require 'thor'
4
+ require 'clerq'
5
+
6
+ class <%=config[:project].capitalize%> < Thor
7
+ include Thor::Actions
8
+
9
+ desc "stat", "Print statistic"
10
+ def stat
11
+ nodes = Clerq::Interactors::JoinNodes.()
12
+ say "#{nodes.to_a.drop(1).size} nodes total"
13
+ end
14
+
15
+ end
@@ -0,0 +1,4 @@
1
+ ---
2
+ document: <%=config[:project]%>
3
+ template: default.md.erb
4
+ title: <%=config[:project]%>
@@ -0,0 +1,41 @@
1
+ # Introduction
2
+ {{skip_meta: true}}
3
+
4
+ {{@@skip
5
+
6
+ This file was created automatically from the premise that you could want to have the high-level structure of the project (document) in a single place.
7
+
8
+ For the usual descriptive parts (nodes) that do not need unique identifiers - use `skip_meta: true` attribute. To output child parts in appropriate order - use the `order_index: nx ny nz` attribute.
9
+
10
+ Pay attention that this content placed under `skip` macro that means this content won't be included in the output document.}}
11
+
12
+ ## Purpose
13
+ {{skip_meta: true}}
14
+
15
+ The purpose of this document is to provide a detailed product description of the <%= config[:project] %>. The document describes the product from user and software requirements perspectives.
16
+
17
+ All parties who are responsible for the definition and implementation of the project should read and understand this document.
18
+
19
+ ## Scope
20
+ {{skip_meta: true}}
21
+
22
+ ## Definitions, acronyms, and abbreviations
23
+ {{skip_meta: true}}
24
+
25
+ ## References
26
+ {{skip_meta: true}}
27
+
28
+ ## Overview
29
+ {{skip_meta: true}}
30
+
31
+ # Users and Stakeholders
32
+ {{skip_meta: true}}
33
+
34
+ # User requirements
35
+ {{skip_meta: true}}
36
+
37
+ # Functional requirements
38
+ {{skip_meta: true}}
39
+
40
+ # Nonfunctional requirements
41
+ {{skip_meta: true}}
@@ -0,0 +1,40 @@
1
+ # CReq Promo
2
+
3
+ The purpose of this project is the "Clerq promotion by examples" of writing the SRS for Clerq using the Clerq.
4
+
5
+ * [Repository](#repository)
6
+ * [CLI](#cli)
7
+ * [Promo CLI](#promo-cli)
8
+
9
+ ## Repository
10
+
11
+ The project has the following folders structure:
12
+
13
+ * `bin/` - for output documents;
14
+ * `bin/assets` - for any assets provided by the documents;
15
+ * `knb/` - place here any helpful information;
16
+ * `lib/` - place for custom Ruby code;
17
+ * `src/` - place for requirements;
18
+ * `tt/` - place for templates;
19
+ * `clerq.yml` - the project settings;
20
+ * `promo.thor` - the project automating tasks;
21
+ * `README.md` - this file.
22
+
23
+ ## CLI
24
+
25
+ You can see a list of all clerq commands by `clerq help` and get help of a certain command by `clerq help <commmand>`.
26
+
27
+ Play with CLI, type some commands and see results.
28
+
29
+ $ clerq help
30
+ $ clerq help chk
31
+ $ clerq check
32
+ $ clerq build
33
+ $ clerq node
34
+ $ clerq toc
35
+
36
+ ## Promo CLI
37
+
38
+ Clerq CLI s based on the `Thor` gem and you can extend it according to your specific needs. For this purpose, you should use `promo.thor`. And to see all the Promo tasks you can just type `thor list promo` or `thor help promo`.
39
+
40
+ `promo.thor` contains just one simple example creating Microsoft Word document by converting Clerq document to .docx by using `Pandoc`.
@@ -0,0 +1,579 @@
1
+ % Clеrk SRS
2
+ % generated by Clerq on November 8, 2019 at 20:16
3
+
4
+ # 1 Introduction
5
+
6
+ ## 1.1 Purpose
7
+
8
+ The purpose of this document is to provide a demo project "Clerq Promo SRS" for all perspective Clerq users to introduce the system by example and provide a sandbox for experiments for the existing users.
9
+
10
+ The other purpose (rather technical) is to have repository that provides all possible combinations of markup inside (links, ids, macros, etc.) to exercise in writing documents templates.
11
+
12
+ ## 1.2 Scope
13
+
14
+ This software system will be a command-line interface (CLI) that provides a set of tools related to requirements management tasks. The system will also provide the requirements repository structure and the format of the requirements sources.
15
+
16
+ The system does not provide any graphical user interface. Assumed that users create and write requirements through any available text editor application, and manage requirements repository structure through any available file manager application.
17
+
18
+ Any features related to restricting access to the requirements repository or to the functions of the system are out of scope. Assumed that each project repository is under control of an SCM tool (Git, Subversion, etc.) and the SCM is in charge of user's access to the SCM artifacts.
19
+
20
+ ## 1.3 Definitions, acronyms, and abbreviations
21
+
22
+ CLI
23
+
24
+ : Command-line interface
25
+
26
+ VCS
27
+
28
+ : Version control system
29
+
30
+ SCM
31
+
32
+ : Software configuration management
33
+
34
+ User story
35
+
36
+ : User stories at [www.agilealliance.org](https://www.agilealliance.org/glossary/user-stories)
37
+
38
+ OS
39
+
40
+ : Operations System
41
+
42
+ [//]: # (to use the extension `--from markdown+definition_lists`)
43
+
44
+ ## 1.4 References
45
+
46
+ 1. [Markdown Guide](https://www.markdownguide.org/)
47
+ 2. [Pandoc User’s Guide](https://pandoc.org/MANUAL.html)
48
+ 3. [Git Documentation](https://git-scm.com/doc)
49
+
50
+ ## 1.5 Overview
51
+
52
+ The remaining sections of this document provide user requirements and functional requirements of the system.
53
+
54
+ The next chapter [2 User stories](#us) introduces the system from User Stories' point of view and establishes the context for the functional requirements. The chapter is organized by user roles.
55
+
56
+ The following chapter [3 Functional requirements](#fr) describes detailed requirements for functions and user interfaces that are based on user stories from the previous chapter. The chapter is structured around system components and is written primarily for developers and quality assurance specialists.
57
+
58
+ # 2 User stories
59
+
60
+ ## Reader
61
+
62
+ Attribute | Value
63
+ --------- | -----
64
+ id | us.reader
65
+
66
+ A requirements reader uses requirements in his day to day work as an input for other project activities or participates in the requirements review process.
67
+
68
+ ### Chose a presentation format
69
+
70
+ Attribute | Value
71
+ --------- | -----
72
+ id | us.reader.01
73
+
74
+ As a reader, I want to get requirements in a particular document format (PDF, Html, MS Word, OpenDocument, etc.), so that I can use my usual tools to work with the document.
75
+
76
+ ## Writer
77
+
78
+ Attribute | Value
79
+ --------- | -----
80
+ id | us.writer
81
+
82
+ A requirements writer / author / developer / analyst
83
+
84
+ ### README, HOW-TO
85
+
86
+ Attribute | Value
87
+ --------- | -----
88
+ id | us.writer.01
89
+
90
+ As a requirements analyst who visits the project promo page, I want to get some introduction to the project and its features, so that I understand how close it meets my needs.
91
+
92
+ {{@@skip it just requires that the project should have README.md}}
93
+
94
+ ### Write in plain text files
95
+
96
+ Attribute | Value
97
+ --------- | -----
98
+ id | us.writer.02
99
+
100
+ As a requirements writer, I want to develop and store requirements in plain text, so that my readers and I would not need to install any specialized software to work with requirements.
101
+
102
+ ### Using of lightweight markup language
103
+
104
+ Attribute | Value
105
+ --------- | -----
106
+ id | us.writer.03
107
+
108
+ As a requirements writer, when I work on the requirements text, I want to use a lightweight markup language (LML), so that it still plain text and, at the same time, I have basic formatting capabilities of style and structure of a text, lists, and tables.
109
+
110
+ ### Set of separate files
111
+
112
+ Attribute | Value
113
+ --------- | -----
114
+ id | us.writer.04
115
+
116
+ As a requirements writer, when I develop requirements, I want to structure the entire set of requirements as a set of separate files and folders, so that I have a high degree of agility but some drawbacks also ...
117
+
118
+ * I can write different complex topics in different files and folders;
119
+ * I can share the same repository with other authors without problems like the necessity to work with the same file simultaneously more that one person:
120
+
121
+ {{@@skip just curious if the user stories format really suited there for ... these rather features and benefits or quality properties than stories}}
122
+
123
+ ### Requirements subordination and order
124
+
125
+ Attribute | Value
126
+ --------- | -----
127
+ id | us.writer.05
128
+
129
+ As a drawback for the previous story when I have requirements in separated files, I need an ability to specify requirements subordination and output order through separated files, so that I can combine all requirements into the consistent repository.
130
+
131
+ ### Supporting Metadata
132
+
133
+ Attribute | Value
134
+ --------- | -----
135
+ id | us.writer.06
136
+
137
+ As a requirements writer, when I develop requirements, I want to mark requirements text by some metadata (source, author, dependencies, etc.), so that I can use the metadata for tagging, searching, selection, referring, etc.
138
+
139
+ ### Supporting Links
140
+
141
+ Attribute | Value
142
+ --------- | -----
143
+ id | us.writer.07
144
+
145
+ As a requirements writer, when I develop requirements, I want to link those with each other through simple references, so that I refer from one requirement to others.
146
+
147
+ ### Requirements templates
148
+
149
+ Attribute | Value
150
+ --------- | -----
151
+ id | us.writer.08
152
+
153
+ As a requirements writer, when I develop requirements, I want to create and use requirements templates, so that I simplify my work, improve productivity and provide basic writing style.
154
+
155
+ ### Checking repository
156
+
157
+ Attribute | Value
158
+ --------- | -----
159
+ id | us.writer.09
160
+ topic | true
161
+
162
+ As a requirements writer, I want to check requirements repository for different possible errors, so that I fix the errors and have consistent repository.
163
+
164
+ Manual files writing and writing in separate files especially can cause the following errors:
165
+
166
+ * Errors in structure of a requirements file;
167
+ * Errors in linking or ordering requirements;
168
+ * References that not exist in the repository;
169
+ * Duplicates of requirements identifiers.
170
+
171
+ ### Querying requirements
172
+
173
+ Attribute | Value
174
+ --------- | -----
175
+ id | us.writer.10
176
+
177
+ As a requirements writer, at any time, I want to query requirements (based on its attributes such "id", "title", "body", and metadata), so that I can have different subsets of requirements based on my needs.
178
+
179
+ ### Combining into documents
180
+
181
+ Attribute | Value
182
+ --------- | -----
183
+ id | us.writer.11
184
+
185
+ As a requirements writer, at any time, I want to combine requirements to a single consistent requirements specification, so that I can have requirements draft and releases.
186
+
187
+ ### Providing unique identifiers
188
+
189
+ Attribute | Value
190
+ --------- | -----
191
+ id | us.writer.12
192
+
193
+ As a requirements writer, I want to have automatically created unique identifiers for the requirements where it omitted, so that I will always have unique identifiers for all requirements.
194
+
195
+ ### Document templates
196
+
197
+ Attribute | Value
198
+ --------- | -----
199
+ id | us.writer.13
200
+
201
+ As a requirement writer, I want the system support ability to chose different templates for documents, so that I can have templates for different purposes (drafts and releases) and even software products (GitHub Markdown, Gitlab Markdown, Pandoc Markdown to convert to docx, odt, or pdf.)
202
+
203
+ ### Create own document template
204
+
205
+ Attribute | Value
206
+ --------- | -----
207
+ id | us.writer.14
208
+
209
+ As a requirements writer, I want to have ability to create my own templates or modify existing templates, so than I can do template tuning for my needs.
210
+
211
+ ### Script automation
212
+
213
+ Attribute | Value
214
+ --------- | -----
215
+ id | us.writer.15
216
+
217
+ As a requirements analyst, I want have ability to automate my working tasks related to requirements, so that I can write scripts related to publishing, reviewing or deriving other artifacts based on the requirements (backlog, estimation sheet, traceability matrix, etc.).
218
+
219
+ # 3 Functional requirements
220
+
221
+ ## Components
222
+
223
+ Attribute | Value
224
+ --------- | -----
225
+ id | cmp
226
+
227
+ The system shall provide the following components:
228
+
229
+ {{@@list}}
230
+
231
+ ### Node
232
+
233
+ Attribute | Value
234
+ --------- | -----
235
+ id | cmp.node
236
+
237
+ The system shall provide the `Node` component that represents one single node of a document. The component shall provide the following function:
238
+
239
+ {{@@list}}
240
+
241
+ #### Read node from markup text
242
+
243
+ Attribute | Value
244
+ --------- | -----
245
+ id | cmp.node.read
246
+
247
+ The system shall provide the ability to read node from lightweight markup language (markdown) to [Node entity](#ent-node).
248
+
249
+ #### Write node to markup text
250
+
251
+ Attribute | Value
252
+ --------- | -----
253
+ id | cmp.node.write
254
+
255
+ The system shall provide the ability to write node from [Node entity](#ent-node) to lightweight markup language (markdown).
256
+
257
+ ### Repository
258
+
259
+ Attribute | Value
260
+ --------- | -----
261
+ id | cmp.repo
262
+
263
+ #### Read repository
264
+
265
+ Attribute | Value
266
+ --------- | -----
267
+ id | cmp.repo.read
268
+
269
+ The system shall provide the function to read repository from separate files and folders and combine it to [Node entity](#ent-node) under root document node.
270
+
271
+ #### Query repository
272
+
273
+ Attribute | Value
274
+ --------- | -----
275
+ id | cmp.repo.query
276
+
277
+ The system shall provide the function to query repository by providing a query string
278
+
279
+ ### Templates manager
280
+
281
+ Attribute | Value
282
+ --------- | -----
283
+ id | cmp.tt
284
+
285
+ The system shall provide `Template manager` component. The component shall provide the following functions:
286
+
287
+ {{@@list}}
288
+
289
+ #### Find template
290
+
291
+ Attribute | Value
292
+ --------- | -----
293
+ id | cmp.tt.find
294
+
295
+ The system shall provide function `find` for templates
296
+
297
+ __Input__
298
+
299
+ Parameter | Type | Required | Description
300
+ --------- | ------ | -------- | -----------
301
+ id | String | Yes | Template identifier
302
+
303
+ __Output__
304
+
305
+ Template body (see [Template entity](#ent-tt)) by provided template `id` parameter.
306
+
307
+ ### Writer
308
+
309
+ Attribute | Value
310
+ --------- | -----
311
+ id | cmp.writer
312
+
313
+ The system shall provide the `Writer component`. The component shall provide functions of writing requirements repository to markup text.
314
+
315
+ #### Write function
316
+
317
+ Attribute | Value
318
+ --------- | -----
319
+ id | cmp.writer.write
320
+
321
+ The `Writer` component shall provide the function `write`.
322
+
323
+ __Input__
324
+
325
+ Parameter | Type | Required | Description
326
+ --------- | ---- | -------- | -----------
327
+ node | Node | Yes | see [Node entity](#ent-node)
328
+ template | Template | Yes | se [Template entity](#ent-tt)
329
+
330
+ __Output__
331
+
332
+ Text presentation of `node` parameter according to `template` parameter
333
+
334
+ ## Entities
335
+
336
+ Attribute | Value
337
+ --------- | -----
338
+ id | ent
339
+
340
+ ### Node entity
341
+
342
+ Attribute | Value
343
+ --------- | -----
344
+ id | ent.node
345
+
346
+ The system shall provide `Node` entity that provide the following attributes:
347
+
348
+ Attribute | Type | Required | Default | Description
349
+ --------- | ------ | -------- | ------- | -----------
350
+ id | String | Yes | "" | Node identifier
351
+ title | String | Yes | "" | Node title
352
+ meta | Hash | Yes | {} | Node metadata
353
+ body | String | Yes | "" | Node body
354
+ items | Array<Node> | Yes | [] | Array of child nodes
355
+
356
+ #### System node options
357
+
358
+ Attribute | Value
359
+ --------- | -----
360
+ id | ent.node.01
361
+
362
+ The system through node metadata shall provide the following system options:
363
+
364
+ Option | Example | Description
365
+ ----------- | ------- | -----------
366
+ parent | parent: fr | specifies the node parent
367
+ skip_meta | skip_meta: true | force the system to skip printing metadata
368
+ order_index | order_index: .1 .2 | force the system to use specified order for child nodes
369
+
370
+ ### Template entity
371
+
372
+ Attribute | Value
373
+ --------- | -----
374
+ id | ent.tt
375
+
376
+ The system shall provide `Template` entity that provide the following attributes:
377
+
378
+ Attribute | Type | Required | Default | Description
379
+ --------- | ------ | -------- | ------- | -----------
380
+ id | String | Yes | "" | Template identifier
381
+ body | String | Yes | "" | Template body
382
+
383
+ ## User Interface
384
+
385
+ Attribute | Value
386
+ --------- | -----
387
+ id | ui
388
+
389
+ ### CLI
390
+
391
+ Attribute | Value
392
+ --------- | -----
393
+ id | cli
394
+
395
+ The following requirements assumed that all CLI commands have to be called in a directory that contains a certain clerq project.
396
+
397
+ The system shall provide the following CLI commands:
398
+
399
+ {{@@list}}
400
+
401
+ #### Project settings
402
+
403
+ Attribute | Value
404
+ --------- | -----
405
+ id | cli.opt
406
+
407
+ The system shall provide settings file for clerq project. It should be placed under root clerq project directory and called `clerq.yml`.
408
+
409
+ Clerq project setting file shall provide the following options:
410
+
411
+ * `document`, string, required, represent file name of output document by default;
412
+ * `template`, string, required, represent template of output document by default;
413
+ * `title`, string, required, represent title of the output document;
414
+ * `author`, string, optional, represent optional document author.
415
+
416
+ #### Getting version
417
+
418
+ Attribute | Value
419
+ --------- | -----
420
+ id | cli.ver
421
+
422
+ The system shall provide command `clerq --version`. When the user requests the command the system shall print its version.
423
+
424
+ #### Help
425
+
426
+ Attribute | Value
427
+ --------- | -----
428
+ id | cli.hlp
429
+
430
+ The system shall provide command `clerq help`. When the user requests the command, the system shall print the list of all clerq CLI commands with a short description of each command.
431
+
432
+ ##### Input parameters
433
+
434
+ Attribute | Value
435
+ --------- | -----
436
+ id | cli.hlp.par
437
+
438
+ The command shall provide the following input parameters:
439
+
440
+ * `COMMAND`, string, optional, represent name for the command.
441
+
442
+ #####
443
+
444
+ Attribute | Value
445
+ --------- | -----
446
+ id | cli.hlp.01
447
+
448
+ When the `COMMAND` parameter is provided, the system shall print the detailed description of the command with all supported parameters and options.
449
+
450
+ #### Creating new project
451
+
452
+ Attribute | Value
453
+ --------- | -----
454
+ id | cli.new
455
+
456
+ The system shall provide command `clerq new`. When the user requests the command the system shall create a new clerq project according to input parameters.
457
+
458
+ {{@@skip TODO what is the project?}}
459
+
460
+ ##### Input parameters
461
+
462
+ Attribute | Value
463
+ --------- | -----
464
+ id | cli.new.par
465
+
466
+ The command shall provide the following input parameters:
467
+
468
+ * `PROJECT`, string, required, represent the name of the new project.
469
+
470
+ #####
471
+
472
+ Attribute | Value
473
+ --------- | -----
474
+ id | cli.new.01
475
+
476
+ When parameter `PROJECT` not provided, the system shall stop the command execution and print the error message `Parameter "PROJECT" required!`.
477
+
478
+ #####
479
+
480
+ Attribute | Value
481
+ --------- | -----
482
+ id | cli.new.02
483
+
484
+ When parameter `PROJECT` provided and a directory called according to the parameter value exists, the system shall stop the command execution and print the error message `Directory "PROJECT" exists!`.
485
+
486
+ #### Checking project
487
+
488
+ Attribute | Value
489
+ --------- | -----
490
+ id | cli.chk
491
+
492
+ The system shall provide command `clerq check`. When the user requests the command the system shall check the clerq repository for errors.
493
+
494
+ #####
495
+
496
+ Attribute | Value
497
+ --------- | -----
498
+ id | cli.chk.01
499
+
500
+ When any errors have found during checking, the system shall print the errors grouped by error type. The following errors type shall be checked:
501
+
502
+ * Non-unique identifiers;
503
+ * Unknown/wrong parents;
504
+ * Unknown/Wrong links;
505
+ * Wrong order_index attribute.
506
+
507
+ #####
508
+
509
+ Attribute | Value
510
+ --------- | -----
511
+ id | cli.chk.02
512
+
513
+ When errors have not found, the system shall print the message `No errors found. Everything is fine.`
514
+
515
+ #### Building project
516
+
517
+ Attribute | Value
518
+ --------- | -----
519
+ id | cli.bld
520
+
521
+ The system shall provide command `clerq build`. When the user requests the command the system shall combine all requirements in the project repository and build the output document according to input parameters.
522
+
523
+ ##### Input parameters
524
+
525
+ Attribute | Value
526
+ --------- | -----
527
+ id | cli.bld.par
528
+
529
+ The command shall provide the following input parameters:
530
+
531
+ * `-o/--output`, string, optional, represent name for the output document;
532
+ * `-t/--template TEMPLATE`, string, optional, represent a template for building the document;
533
+ * `-q/--query QUERY`, string, optional, represent query string for requirements.
534
+
535
+ #####
536
+
537
+ Attribute | Value
538
+ --------- | -----
539
+ id | cli.bld.01
540
+
541
+ When `-o/--output` parameter is not provided, the system shall use the default file name from settings of the project.
542
+
543
+ #####
544
+
545
+ Attribute | Value
546
+ --------- | -----
547
+ id | cli.bld.02
548
+
549
+ When `-o/--output` parameter is provided, the system shall save the generated document under the provided name.
550
+
551
+ #####
552
+
553
+ Attribute | Value
554
+ --------- | -----
555
+ id | cli.bld.03
556
+
557
+ When `-t/--template` parameter is not provided, the system shall use the default template from settings of the project.
558
+
559
+ #####
560
+
561
+ Attribute | Value
562
+ --------- | -----
563
+ id | cli.bld.04
564
+
565
+ When `-t/--template` parameter is provided, the system shall check that the provided template exists and use it for document generation.
566
+
567
+ #####
568
+
569
+ Attribute | Value
570
+ --------- | -----
571
+ id | cli.bld.05
572
+
573
+ When `-q/--query` parameter is provided, the system shall check if the provided query is correct query string and select requirements for building the document according to the query.
574
+
575
+ # Appendix
576
+
577
+ ![Clerq in Atom](assets/promo_light.png)
578
+
579
+