The main purpose of this document is to provide a comprehensive demo project for Marko Gem. The other technical purpose is to have Marko Sandbox for testing and development.
The problem of of managing large structured texts (articles, books, specific structured documents) affects the authors of such texts the impact of which is the text management process itself became a pain as the text groves and the structure evolves a successful solution would be a software that provides
For authors of large structured texts Who need simple reliable text management process The Marko Markup Compiler is a free text management scripting software That utilizes the docs-as-code approach Unlike other competitive approaches like using word processors, Wiki system, or dedicated content publishing systems Our product does not require any special environment and can be adopted in any text environment.
The Marko provides you with:
Having large structured texts as just a bunch of plain text files, one can
The developed system will provide the following components:
Command-line interface
Ruby Templating system
The remaining sections of this document requirements to the system. The document structured the manner of software requirements specification, where one can find descriptions of Users, Use Cases, Functional Requirements, and Interface Requirements.
The users of the system are different people who play for authoring various sorts of technical documentation. It might be a technical writer, business/systems analyst, developer, etc.
Id | ur |
Id | uc |
Id | uc.create |
The scenario is used when the user wants to create a new Marko artifact project
Main Flow
Extensions
2a The directory exists: The system reports to the user that the directory exits. The scenario if finished.
Id | uc.manage |
Outside the system scenario of managing the artifact sources, templates, automated tasks.
Main Flow
Outside the system
src
directory of Marko project (created by Create a new project scenario.)Id | uc.compile |
The scenario is used when the user wants to compile the artifact from the artifact sources
Prerequisites
Main Flow
Extensions
2a The system detected markup errors inside sources: The system reports the errors found to the user; the scenario is finished.
2b The system detected tree structure errors during the assembling stage: The system reports the errors found to the user; the scenario is finished.
Id | uc.automate |
Basically, Marko assembles artifacts from markup sources, but there are cases when user wants to add some information from other sources like UI/UML/ER design tools, some prepared data files in whatever it could be form. Sometimes the user wants to modify or remove some content inside the markup sources.
Such tasks could be automated by intervening into the artifact tree between assemblage and compilation stages.
Main Flow
Id | fr |
Id | fr.treenode |
The system shall provide Node
entity with the following
properties that provide the following attributes:
Property | Type | Mult. | Default | Description |
---|---|---|---|---|
id | String | 1 | “” | Node identifier |
parent | Node | 1 | null | Parent node |
title | String | 1 | “” | Node title |
meta | Hash | 1 | {} | Node metadata |
body | String | 1 | “” | Node body |
items | TreeNode | 0..N | [] | Child nodes |
Id | fr.treenode.tree |
To assemble the project artifact from nodes placed among several source files, the system shall provide the following optional tree metadata attributes:
Attribute | Type | Mult. | Description |
---|---|---|---|
id | String | 0..1 | Unique node id |
parent | String | 0..1 | Parent id |
order_index | String | 0..N | Children IDs |
Id | fr.treenode.orig |
During source file parsing, the system must store the following node origin information:
Attribute | Type | Mult. | Description |
---|---|---|---|
origin | String | 1 | file name |
lineno | String | 1 | file line |
Id | fr.markup |
The main and only entity in the system is TreeNode. The system shall provide the following abilities for the entity:
Id | fr.markup.node |
The system shall support the following node markup.
# <title>
\<meta\>}}
{{\<body\>
Where:
#
.{{
and finishes with
}}
;#
are considered as node body.Id | fr.markup.01 |
The system shall provide function to getting all sources files from project repository.
Id | fr.markup.02 |
The system shall provide the function to parse source file.
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 Source Metadata.
Input
Parameter | Type | Mult. | Description |
---|---|---|---|
filename | String | 1 | filename |
Output
Parameter | Type | Mult. | Description |
---|---|---|---|
node | TreeNode | 0..N | node parsed |
Id | fr.markup.03 |
The system shall provide the function to assemble the artifact tree. The artifact tree is assembled based on Tree Metadata.
Input
Parameter | Type | Mult. | Description |
---|---|---|---|
node | TreeNode | 0..N | node collection |
Output
Parameter | Type | Mult. | Description |
---|---|---|---|
node | TreeNode | 1 | root node |
Id | fr.markup.04 |
The system shall provide each node with unique node Id. Some nodes can already have id from source files, 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.
For example, when the system has assembled the tree
# Artifact
## Introduction
### Purpose
### Scope
# User Requirements #ur
# Functional Requirements #fr
and then generated id, the generated ids should be as follows:
# Artifact Title #00
## Introduction #01.01
### Purpose #01.01.01
### Scope #01.01.02
# User Requirements #ur
# Functional Requirements #fr
Input
Parameter | Type | Mult. | Description |
---|---|---|---|
root | TreeNode | 1 | root node |
Id | fr.markup.05 |
The system shall provide the function to check assembled tree for errors related to assembling tree based on Tree Metadata. The system must check the following errors:
duplicate id
, finds two or more nodes that share the
same id;unknown parent
, finds nodes that have
parent
metadata, but parent not found in the tree;unknown index
, finds nodes with
order_index
metadata where one or more children in the
index not found;unknown links
, finds nodes containing links but the
links are not found.Id | fr.create |
The system shall provide the function to create a new project.
Input
Parameter | Type | Mult. | Description |
---|---|---|---|
directory | string | 1 | project directory |
Output
Parameter | Type | Mult. | Description |
---|---|---|---|
filename | string | 1..N | created directory or filename |
Flow
directory
already
existdirectory
Id | fr.assemble |
The system shall provide the function to assemble the artifact.
Input
Output
Parameter | Type | Mult. | Description |
---|---|---|---|
tree | TreeNode | 1 | assembled tree |
Flow
Id | fr.compile |
The system shall provide the function to create deliverable artifact.
Input
Parameter | Type | Mult. | Description |
---|---|---|---|
tree | TreeNode | 0..1 | assembled tree |
template | String | 1 | rendering template |
filename | String | 1 | output artifact filename |
Output
Parameter | Type | Mult. | Description |
---|---|---|---|
filename | String | 1 | output artifact filename |
Flow
tree
parameter providedtemplate
filename
to <filename>~
when
esiststemplate
for each node of tree
filename
filename
Id | ui |
Id | ui.cli |
The system shall provide the command-line interface. The interface must provide the following commands:
Id | ui.cli.01 |
The system shall provide the new PROJECT
command. When
the user requests the new PROJECT
command, the system must
call Create project.
Id | ui.cli.02 |
The system shall provide the
compile [-t TEMPALTE] [-o FILENAME]
command. When the user
requests the compile
command, the system must call Compile artifact.
Id | ui.gem |
The system shall provide Ruby Gem with the following functions
Id | ui.gem.01 |
Id | ui.gem.02 |
The user will utilize his preferred text editor so no other UI requirement
The user will utilize Git so no other version management or access management requirements
The user will publish deliverables by using Pandoc so there are no publishing requirements