marko 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -0
  3. data/Gemfile.lock +3 -2
  4. data/README.md +16 -13
  5. data/Rakefile +5 -0
  6. data/STORY.md +44 -0
  7. data/_layouts/footer.md +4 -0
  8. data/_layouts/header.md +3 -0
  9. data/_layouts/layout.html +73 -0
  10. data/_layouts/robots.txt.erb +4 -0
  11. data/_layouts/sitemap.xml.erb +20 -0
  12. data/_layouts/styles.css +92 -0
  13. data/docs/changelog.html +74 -0
  14. data/docs/css/styles.css +92 -0
  15. data/docs/index.html +297 -0
  16. data/docs/readme.html +297 -0
  17. data/docs/robots.txt +4 -0
  18. data/docs/sitemap.xml +30 -0
  19. data/docs/story.html +132 -0
  20. data/exe/marko +4 -2
  21. data/lib/assets/demo/README.md +2 -2
  22. data/lib/assets/demo/src/ur/uc.general.flow.md +1 -1
  23. data/lib/assets/init/README.md +1 -1
  24. data/lib/assets/init/Rakefile +2 -2
  25. data/lib/assets/init/tt/custom.md.tt +19 -0
  26. data/lib/assets/init/tt/default.md.tt +4 -0
  27. data/lib/assets/samples/0_index.md +14 -0
  28. data/lib/assets/samples/1_intro.md +55 -0
  29. data/lib/assets/samples/2_stakh.md +21 -0
  30. data/lib/assets/samples/3_actors.md +10 -0
  31. data/lib/assets/samples/4_cases.md +53 -0
  32. data/lib/assets/samples/5_entities.md +18 -0
  33. data/lib/assets/samples/6_concerns.md +60 -0
  34. data/lib/assets/samples/SRS-IEEE-830-1998.md +293 -0
  35. data/lib/assets/samples/SRS-RUP.md +283 -0
  36. data/lib/assets/samples/business-case.md +116 -0
  37. data/lib/assets/samples/ears.md +112 -0
  38. data/lib/assets/samples/gen_punch_domain.rb +183 -0
  39. data/lib/assets/samples/requirements.md +105 -0
  40. data/lib/assets/samples/stakeholders.png +0 -0
  41. data/lib/assets/samples/vision.md +191 -0
  42. data/lib/marko/artifact.rb +3 -1
  43. data/lib/marko/assembler.rb +1 -0
  44. data/lib/marko/cli.rb +10 -2
  45. data/lib/marko/markup/compiler.rb +3 -9
  46. data/lib/marko/markup/decorator.rb +45 -30
  47. data/lib/marko/markup/storage.rb +37 -19
  48. data/lib/marko/tree_node.rb +3 -2
  49. data/lib/marko/version.rb +1 -1
  50. data/lib/marko.rb +8 -0
  51. data/sancho.yml +6 -0
  52. metadata +35 -4
  53. data/lib/assets/init/tt/artifact.md.tt +0 -3
data/docs/sitemap.xml ADDED
@@ -0,0 +1,30 @@
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 ADDED
@@ -0,0 +1,132 @@
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>
data/exe/marko CHANGED
@@ -11,10 +11,12 @@ when nil
11
11
  when /(n|new)/
12
12
  dir = ARGV.shift
13
13
  CLI.punch(dir)
14
- when /(d|demo)/
15
- CLI.punch_demo
16
14
  when /(c|compile)/
17
15
  CLI.compile
16
+ when /(d|demo)/
17
+ CLI.punch_demo
18
+ when /(samples)/
19
+ CLI.punch_samples
18
20
  else
19
21
  CLI.banner
20
22
  end
@@ -2,12 +2,12 @@
2
2
 
3
3
  # Overview
4
4
 
5
- This project is an example of developing bulky technical artifacts with Marko Markup Compiler. It also serves as a sandbox for testing and features development.
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
6
 
7
7
  # Usage
8
8
 
9
9
  Run `$ marko` to see command-line interface
10
10
 
11
- Run `$ rake marko:publish` to publish the aritfact
11
+ Run `$ rake marko:publish` to publish the artifact
12
12
 
13
13
  Run `$ rake -T` to see other custom interface
@@ -1,4 +1,4 @@
1
- # General Clerq flow
1
+ # General Marko Flow
2
2
  {{id: uc.general.flow, parent: uc}}
3
3
 
4
4
  __Prerequisites__
@@ -1,6 +1,6 @@
1
1
  % Marko Demo Project
2
2
 
3
- Welcome to your new [Marko](https://github.com/nvoynov/clerq) project!
3
+ Welcome to your new [Marko](https://github.com/nvoynov/marko) project!
4
4
 
5
5
  # Structure
6
6
 
@@ -26,7 +26,7 @@ namespace :marko do
26
26
  tree = tree.find_node(query)
27
27
  unless tree
28
28
  puts "Nothing to be printed!"
29
- return
29
+ abort
30
30
  end
31
31
  tree.orphan!
32
32
  end
@@ -71,7 +71,7 @@ namespace :marko do
71
71
  extra = args.extra
72
72
  Dir.mkdir('mm') unless Dir.exist?('mm')
73
73
  body = MINUTES % timestamp
74
- name = "minutes-#{datestamp}#{extra.empty? ? '' : ?_ + extra}"
74
+ name = "minutes-#{datestamp}#{extra.empty? ? '' : ?_ + extra}.md"
75
75
  name = File.join('mm', name)
76
76
  errm = "Minutes exists already. Maybe you can provide [EXTRA]?"
77
77
  fail errm if File.exist?(name)
@@ -0,0 +1,19 @@
1
+ %# Marko custom template
2
+ %
3
+ % if !defined?(custom?)
4
+ % def custom?(node)
5
+ % %w[u s f].any?{|t| node.id == t || node.belongs_to?(t)}
6
+ % end
7
+ %
8
+ % def custom!(node)
9
+ % lnkfu = proc{|e| node.find_node(e)&.ref || "[#{e}](#404)" }
10
+ % subfu = proc{|s| s.split(?\s).map(&lnkfu).join(', ')}
11
+ % node[:depend] = subfu.(node[:depend]) if node[:depend]
12
+ % node[:satisfy] = subfu.(node[:satisfy]) if node[:satisfy]
13
+ % end
14
+ % end
15
+ %
16
+ % @model.each do |node|
17
+ % custom!(node) if custom?(node)
18
+ <%= node.text %>
19
+ % end
@@ -0,0 +1,4 @@
1
+ %# Marko default template
2
+ % @model.each do |node|
3
+ <%= node.text %>
4
+ % end
@@ -0,0 +1,14 @@
1
+ # Marko. Software Requirements Specification
2
+ {{id: root, order_index: intro stakh actors fr nf fa as}}
3
+
4
+ ## Functional requirements
5
+ {{id: fr, order_index: .uc .en}}
6
+
7
+ ## Interface Requirements
8
+ {{id: fa}}
9
+
10
+ ## Non-functional requirements
11
+ {{id: nf}}
12
+
13
+ ## Assumptions and Dependencies
14
+ {{id: as}}
@@ -0,0 +1,55 @@
1
+ # Introduction
2
+ {{id: intro, parent: root}}
3
+
4
+ ## Purpose
5
+
6
+ The purpose of this document is to provide software requirements specification for @@todo
7
+
8
+ ## Problem
9
+
10
+ @@skip provide concise statements summarizing the problems that the project should solve
11
+
12
+ __The problem of__ [describe the problem]
13
+ __affects__ [the stakeholders affected by the problem]
14
+ __the impact of which is__ [what is the impact of the problem?]
15
+ __a successful solution would be__ [list some key benefits of a successful solution]
16
+
17
+ ## Product
18
+
19
+ @@skip product statement
20
+
21
+ __For__ [target customer]
22
+ __Who__ [statement of the need or opportunity]
23
+ __The__ [product name] is a [product category]
24
+ __That__ [key benefit, compelling reason to buy]
25
+ __Unlike__ [primary competitive alternative]
26
+ __Our product__ [statement of primary differentiation]
27
+
28
+ ## Scope
29
+
30
+ @@todo define the scope of the project, web-site, micorservice, etc.
31
+
32
+ ## Definitions
33
+
34
+ @@skip place some core definitions here
35
+
36
+ CLI
37
+
38
+ : Command-line interface
39
+
40
+ ## References
41
+
42
+ @@skip provide some references
43
+
44
+ - [Marko](https://github.com/nvoynov/marko)
45
+ - [Punch](https://github.com/nvoynov/punch)
46
+
47
+ ## Overview
48
+
49
+ The next two chapters describe stakeholders ([[stakeholders]]) and users ([[actors]]) of the system.
50
+
51
+ The following section [[fr]] provides functional requirements, that starts from use cases ([[fr.uc]]), proceeds with other functional requirements and finishes with data requirements ([[fr.en]]).
52
+
53
+ [[fa]] section defines required user interface.
54
+
55
+ [[concern]] section provides the domain concerns.
@@ -0,0 +1,21 @@
1
+ # Stakeholders
2
+ {{id: stakeholders, parent: root}}
3
+
4
+ @@skip
5
+
6
+ - Regulator
7
+ - Purchaser
8
+ - Sponsor
9
+ - Politician
10
+ - The Public
11
+
12
+ `ISO 42010`. The following stakeholders shall be considered and when applicable, identified in the architecture description:
13
+
14
+ - users of the system;
15
+ - operators of the system;
16
+ - acquirers of the system;
17
+ - owners of the system;
18
+ - suppliers of the system;
19
+ - developers of the system;
20
+ - builders of the system;
21
+ - maintainers of the system.
@@ -0,0 +1,10 @@
1
+ # Actors
2
+ {{id: actors, parent: root}}
3
+
4
+ @@list
5
+
6
+ ## User
7
+ {{id: .user}}
8
+
9
+ ## Admin
10
+ {{id: .admin}}
@@ -0,0 +1,53 @@
1
+ # Use Cases
2
+ {{id: uc, parent: root}}
3
+
4
+ @@tree
5
+
6
+ @@skip # Some Use Case
7
+ {{id: .some, parent: uc}}
8
+
9
+ **Actors and their Goals**
10
+
11
+ 1. User, wants to get some value
12
+ 2. System, wants to ensure some policies
13
+
14
+ **Guarantee**
15
+
16
+ [Succeed]{.underline}
17
+
18
+ - one
19
+ - two
20
+
21
+ [Failed]{.underline}
22
+
23
+ - one
24
+ - two
25
+
26
+ **Extend**
27
+
28
+ - no use case extensions
29
+ @@todo - [\[fr.uc]]
30
+
31
+ **Include**
32
+
33
+ - no use case inlcusions
34
+ @@todo - [\[fr.uc]]
35
+
36
+ **Main flow**
37
+
38
+ 1.
39
+ 2.
40
+
41
+ **Extension**
42
+
43
+ [1a] something faulty
44
+
45
+ 1. one
46
+ 2. two
47
+
48
+ **Data**
49
+
50
+ [Entities:]{.underline}
51
+
52
+ @@todo - [\[fr.ent.]];
53
+ @@todo - [\[fr.ent.]].
@@ -0,0 +1,18 @@
1
+ # Entities
2
+ {{id: .en, parent: fr}}
3
+
4
+ The system utilizes the following entities:
5
+
6
+ @@list
7
+
8
+ @@skip ## Entity "Sample"
9
+ {{id: .sample, parent: fr.en}}
10
+
11
+ The entity should provide the following properties:
12
+
13
+ Property | Type | Multiplicity | Description
14
+ -------- | ---- | ------------ | -----------
15
+ id | UUID | 1 | unique identifier
16
+ title | text | 1 | title
17
+
18
+ Table: Entity "Sample"
@@ -0,0 +1,60 @@
1
+ # Domain concern
2
+ {{id: concern, parent: root}}
3
+
4
+ - Mergers and acquisitions
5
+ - Time to market
6
+ - User satisfaction
7
+ - Competitive advantage
8
+ - Time and budget
9
+
10
+ ## Architecture Characteristics
11
+
12
+ Also known as "quality characteristics" or "non-functional requirements"
13
+
14
+ Domain Concern Architecture characteristics
15
+ ------------------------ -----------------------------
16
+ Mergers and acquisitions Interoperability, scalability, adaptability, extensibility
17
+ Time to market Agility, testability, deployability
18
+ User satisfaction Performance, availability, fault tolerance, testability, deployability, agility, security
19
+ Competitive advantage Agility, testability, deployability, scalability, availability, fault tolerance
20
+ Time and budget Simplicity, feasibility
21
+
22
+ ### Operational
23
+
24
+ Term Definition
25
+ ------------------ ---------------------------
26
+ Availability How long the system will need to be available (if 24/7, steps need to be in place to allow the system to be up and running quickly in case of any failure).
27
+ Continuity Disaster recovery capability.
28
+ Performance Includes stress testing, peak analysis, analysis of the frequency of functions used, capacity required, and response times. Performance acceptance sometimes requires an exercise of its own, taking months to complete.
29
+ Recoverability Business continuity requirements (e.g., in case of a disaster, how quickly is the system required to be online again?). This will affect the backup strategy and requirements for duplicated hardware.
30
+ Reliability/safety Assess if the system needs to be fail-safe, or if it is mission critical in a way that affects lives. If it fails, will it cost the company large sums of money?
31
+ Robustness Ability to handle error and boundary conditions while running if the internet connection goes down or if there’s a power outage or hardware failure.
32
+ Scalability Ability for the system to perform and operate as the number of users or requests increases
33
+
34
+ ### Structural
35
+
36
+ Term Definition
37
+ --------------------- ----------
38
+ Configurability Ability for the end users to easily change aspects of the software’s configuration (through usable interfaces).
39
+ Extensibility How important it is to plug new pieces of functionality in.
40
+ Installability Ease of system installation on all necessary platforms.
41
+ Leverageability/reuse Ability to leverage common components across multiple products.
42
+ Localization Support for multiple languages on entry/query screens in data fields; on reports, multibyte character requirements and units of measure or currencies.
43
+ Maintainability How easy it is to apply changes and enhance the system?
44
+ Portability Does the system need to run on more than one platform? (For example, does the frontend need to run against Oracle as well as SAP DB?
45
+ Supportability What level of technical support is needed by the application? What level of logging and other facilities are required to debug errors in the system?
46
+ Upgradeability Ability to easily/quickly upgrade from a previous version of this application/solution to a newer version on servers and clients
47
+
48
+ ### Cross-cutting
49
+
50
+ Term Definition
51
+ -------------- ------------------------------
52
+ Accessibility Access to all your users, including those with disabilities like colorblindness or hearing loss.
53
+ Archivability Will the data need to be archived or deleted after a period of time? (For example, customer accounts are to be deleted after three months or marked as obsolete and archived to a secondary database for future access.)
54
+ Authentication Security requirements to ensure users are who they say they are.
55
+ Authorization Security requirements to ensure users can access only certain functions within the application (by use case, subsystem, webpage, business rule, field level, etc.).
56
+ Legal What legislative constraints is the system operating in (data protection, Sarbanes Oxley, GDPR, etc.)? What reservation rights does the company require? Any regulations regarding the way the application is to be built or deployed?
57
+ Privacy Ability to hide transactions from internal company employees (encrypted transactions so even DBAs and network architects cannot see them).
58
+ Security Does the data need to be encrypted in the database? Encrypted for network communication between internal systems? What type of authentication needs to be in place for remote user access?
59
+ Supportability What level of technical support is needed by the application? What level of logging and other facilities are required to debug errors in the system?
60
+ Usability Level of training required for users to achieve their goals with the application/solution.