C.1 Markup#

<i>

[1] rivt String#


rivt markup provides a readable, plain text language that generates formatted text, PDF or HTML docs from the same rivt file. The markup is processed in a rivt string - a utf-8 text string argument to a API function.

The API function and header start in the first column (standard Python syntax), with subsequent lines indented 4 spaces for improved readability and section folding in IDEs.

rv._("""Section Label | hide;print, public;private; (rvsource, rvlocal)

    section content (utf-8 text)
    ...
    ...

    """)

The rivt string begins with a section header that includes a “section label” and parameters that define the section behavior.

<i>

[3] Section Content#


Section content is indented four spaces (for legibility and code folding) and includes tags for text formatting and commands for file operations.

rv._("""Section Label | write; nowrite, public; private

    section content
    ...

    """)

A section is processed line by line to a RestructuredText string, and then further processed to an HTML or PDF file. If a line does not contain a command or tag it is passed through as is. This allows for including restructured text directly, e.g. surrounding text with * for italics or ** for bold. Text docs are formatted separately.

<i>

[4] Tags and Commands#


Tags

A line tag formats a line of text and is denoted with _[TAG], usually at the end of the line.

A block tag formats a block of text that begins with _[[TAG]] and terminates with _[[Q]].

Commands

rivt commands read and write external files. They typically start in the first column with a vertical bar ( | ) followed by the file path, name and parameters. The exceptions to this pattern are the assignment (<= ) and definition (:=) commands, which are used to assign values to equation results and define variables.

| COMMAND | relative path | parameters

File paths are specified relative to the report folder or rivt file folder. The typical rivt report folder structure is described here.

Scope

Command | path | parameters

R/W

file types

R

LINUX | relative path | popen; run

R

sh

R

MACOS | relative path | popen; run

R

sh

R

WIN | relative path | popen; run

R

bat, cmd

I, V

TEXT | relative path | normal; literal

R

txt, tex, rst

I, V

TABLE | relative path | title, width, l;c;r

R

csv, txt, xlsx

I, V

IMG | relative path | caption, scale

R

png, jpg

I, V

IMG2 | relative path | c1, c2, s1, s2

R

png, jpg

V

VALUES | relative path | title

R

csv

V

a := 1*IN | unit1, unit2, decimal | description

W

define value

V

b <= a + 3*FT | unit1, unit2, decimal | reference

W

assign value

T

HTML | relative path | html; file

R

html

T

LATEX | relative path | pdftex, file

R

tex

T

PYTHON | relative path | rivt; external

R

py

D

APPEND | relative path | cover_page_title

W

pdf, html

D

DOCS | relative path | pdf; pdftex; text; html

W

pdf, html, txt