Contribute

OpenSVC projects, including this documentation, are hosted on Github.

Install Git

sudo apt-get install git
git config --global user.name "First Last Name"
git config --global user.email "first.lastname@domain.com"

Clone the agent and book projects

cd /tmp
git clone https://github.com/opensvc/book.opensvc.com.git
git clone https://github.com/opensvc/opensvc.git

Build the agent

(cd opensvc && make om)

Install mdbook

From https://github.com/rust-lang/mdBook/releases

Make autogenerated documentation

(cd book.opensvc.com && OM=../opensvc/bin/om make)

Contribute Documentations

(cd book.opensvc.com && && mdbook serve --open)

Modify the documentation source files (.md located in the src directory and referenced in src/SUMMARY.md)

Command Line Output Coloring

When producing command line output, it is expected to follow the steps below to preserve colors, so as to provide a better experience for futures readers:

Install ansi2html

From https://github.com/ralphbean/ansi2html

generate raw html code from cli:

$ om node print devs --color=yes | aha -n

Edit the .md document and copy/paste the previous output enclosed between <pre> and </pre>:

<pre>
        <span style="font-weight: bold">centos71.opensvc.com                        </span>  <span style="font-weight: bold">Type  </span>  <span style="font-weight: bold">Size</span>  <span style="font-weight: bold">Pct of Parent</span>  
        `- <span style="color: #aa5500">vda                                      </span>  linear  15g   -              
           |- <span style="color: #aa5500">vda1                                  </span>  linear  500m  3%             
           `- <span style="color: #aa5500">vda2                                  </span>  linear  14g   96%            
              |- <span style="color: #aa5500">centos_centos71-swap               </span>  linear  1g    10%            
              `- <span style="color: #aa5500">centos_centos71-root               </span>  linear  13g   89%            
                 |- <span style="color: #aa5500">loop2                           </span>  linear  50m   0%             
                 |  |- <span style="color: #aa5500">testsvc1-lv1                 </span>  linear  20m   40%            
                 |  `- <span style="color: #aa5500">testsvc1-lv2                 </span>  linear  20m   40%            
                 |- <span style="color: #aa5500">loop1                           </span>  linear  100m  0%             
                 |  |- <span style="color: #aa5500">testsvc3-lv2                 </span>  linear  20m   20%            
                 |  |- <span style="color: #aa5500">testsvc3-lv1-real            </span>  linear  52m   52%            
                 |  |  |- <span style="color: #aa5500">testsvc3-lv1              </span>  linear  52m   100%           
                 |  |  `- <span style="color: #aa5500">testsvc3-osvc_sync_lv1    </span>  linear  52m   100%           
                 |  `- <span style="color: #aa5500">testsvc3-osvc_sync_lv1-cow   </span>  linear  8m    8%             
                 |     `- <span style="color: #aa5500">testsvc3-osvc_sync_lv1    </span>  linear  52m   650%           
                 `- <span style="color: #aa5500">loop0                           </span>  linear  100m  0%             
                    |- <span style="color: #aa5500">testsvc2-lv1                 </span>  linear  52m   52%            
                    `- <span style="color: #aa5500">testsvc2-lv2                 </span>  linear  20m   20%            
    </pre>

The result looks like:

	centos71.opensvc.com                          Type    Size  Pct of Parent  
	`- vda                                        linear  15g   -              
	   |- vda1                                    linear  500m  3%             
	   `- vda2                                    linear  14g   96%            
	      |- centos_centos71-swap                 linear  1g    10%            
	      `- centos_centos71-root                 linear  13g   89%            
	         |- loop2                             linear  50m   0%             
	         |  |- testsvc1-lv1                   linear  20m   40%            
	         |  `- testsvc1-lv2                   linear  20m   40%            
	         |- loop1                             linear  100m  0%             
	         |  |- testsvc3-lv2                   linear  20m   20%            
	         |  |- testsvc3-lv1-real              linear  52m   52%            
	         |  |  |- testsvc3-lv1                linear  52m   100%           
	         |  |  `- testsvc3-osvc_sync_lv1      linear  52m   100%           
	         |  `- testsvc3-osvc_sync_lv1-cow     linear  8m    8%             
	         |     `- testsvc3-osvc_sync_lv1      linear  52m   650%           
	         `- loop0                             linear  100m  0%             
	            |- testsvc2-lv1                   linear  52m   52%            
	            `- testsvc2-lv2                   linear  20m   20%            

Decorating words

Awesome font icons can be inlined in the documentation. To make it easier and to enforce a common set of icon and color, include fragments are available in the src/inc/ directory.

SyntaxRendering
{{#include ../inc/action}} action action
{{#include ../inc/repo}} repo repo
{{#include ../inc/registry}} registry registry
{{#include ../inc/node}} node node
{{#include ../inc/svc}} svc svc
{{#include ../inc/res}} res res
{{#include ../inc/tag}} tag tag
{{#include ../inc/svcenv}} svcenv svcenv
{{#include ../inc/env}} env env
{{#include ../inc/pkg}} pkg pkg
{{#include ../inc/net}} net net
{{#include ../inc/check}} check check
{{#include ../inc/form}} form form
{{#include ../inc/report}} report report
{{#include ../inc/metric}} metric metric
{{#include ../inc/chart}} chart chart
{{#include ../inc/group}} group group
{{#include ../inc/priv}} priv priv
{{#include ../inc/user}} user user
{{#include ../inc/dns-domain}} example.com example.com
{{#include ../inc/dns-record}} example.com. IN A 12.13.14.15 example.com. IN A 12.13.14.15
{{#include ../inc/fset}} filterset filterset
{{#include ../inc/disk}} disk disk
{{#include ../inc/array}} array array
{{#include ../inc/diskgroup}} diskgroup diskgroup
{{#include ../inc/rule}} rule rule
{{#include ../inc/ruleset}} ruleset ruleset
{{#include ../inc/modset}} moduleset moduleset
{{#include ../inc/mod}} module module
{{#include ../inc/app}} app application
{{#include ../inc/close}} close close
{{#include ../inc/fullscreen}} fullscreen fullscreen
{{#include ../inc/shrink}} shrink shrink
{{#include ../inc/link}} link link
{{#include ../inc/kw}} keyword keyword
{{#include ../inc/cmd}} command command