Run DocAsCode
To run DocasCode, open a terminal and type:
docascode --help
This gives you all the public available subcommands.
Each subcommand of DocAsCode has the following syntax:
docascode <subcommand> [OPTIONS]
For more informations type:
docascode <subcommand> -h
Initialization
A DocAsCode repository can be setup and/or enabled by typing:
cd <my-folder-or-my-git-repository>
docascode init
DocAsCode will initialize or upgrade mandatory files and initialize a Git repository.
Files Organization
A DocAsCode repository is structured as follow:
<root> (1)
.docascode (2)
tmp (3)
markdown (4)
plugins (5)
my-plugin (6)
tasks.xml
**
** (7)
chrono.xml (8)
settings.xml (9)
delivery.xml (10)
delivery.properties (11)
| 1 | The root directory |
| 2 | The DocAsCode directory |
| 3 | The DocAsCode directory for temporary files |
| 4 | The directory containing DocAsCode preview files |
| 5 | The DocAsCode project plugins directory |
| 6 | A plugin directory |
| 7 | Another plugin |
| 8 | The repository database chrono.xml |
| 9 | The project maven settings. For diff and deploy purposes. See Maven section. |
DocAsCode Repository Database
The file .docascode/chrono.xml is designed to:
-
declare files as DocAsCode artifacts
-
attribute a label to designate then
-
attach nested DocAsCode artifacts
-
declare naming rule for delivering
To register the file myDoc.docx with the label spec, type:
docascode add --id spec --file myDoc.docx
To add Maven metadata informations type:
docascode add --id spec \
--groupId group \
--artifactId artifact \
--version @version@ (1)
| 1 | @version@ will be resolved by ths custom property value in myDoc.docx. |
Once an artifact can be resolved either by giving its file path or its Maven Metadata, you can use its embedded custom properties in other fields.
To define a default naming rule for delivering the spec artifact, type:
docascode add --id spec \
-o @Title@-@version@.docx (1)
| 1 | Since artifact spec can be resolved, @Title@ will be replaced by its Title core property and @version@ will be replaced by its version custom property field in a build. |
To define a non-default naming rule, use the --name option.
To remove entries in .docascode/chrono.xml, use the remove subcommand
docascode remove --help