RST Basic Structure

Useful rst summaries

https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html https://docutils.sourceforge.io/docs/user/rst/quickref.html

Normally, there are no heading levels assigned to certain characters as the structure is determined from the succession of headings. However, it is better to stick to the same convention throughout a project. For instance:

  • # for parts

  • * for chapters

  • = for sections

  • - for subsections

  • ^ for subsubsections

  • " for paragraphs

Terms and Definitions

Definition of the term, which must be indented

and can even consist of multiple paragraphs

Another Term

Description.

Some Order List:

  1. Apples

  2. Oranges

  3. Bananas

Warning

This is a warning in a box

Labels and References

https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#my-target

Internal Links are also be done via labels and references. Labels are defined at headers In this and other documents on this site

Reference to other docs, see below! Variable Testing in Bash.

Linking to other headers in other pages

  • Python Links to the other document, with the name of the header captured

  • External file target. Links to the other document with our own link name

This is a normal text paragraph. The next paragraph is a python code sample:

class SomeType:
   def __init__(self,name='Someone'):
   self.name = name
   pass

This is a normal text paragraph again.

function quit_all_screens {
   for k in $(screen -ls | python -m xbin.screen_split); do screen -S $k -X quit; done
   echo "successfully quit all active screens"
}
export -f quit_all_screens


function update_host_detached {
   if   [[ $# -eq 0 ]]; then
      screen -dmS sx_$(hostname) bash -c "sudo apt -y update && sudo apt -y upgrade"
   elif [[ $# -eq 1 ]]; then
      ssh $1 "screen -dmS sx_$1 bash -c \"sudo apt -y update && sudo apt -y upgrade\""
   else
      echo "too many hosts"
   fi
}
export -f update_host_detached

Variable Testing in Bash

Expression in script

name=’fish’

name=’’

unset name

test “$name”

TRUE

f

f

test -n “$name”

TRUE

f

f

test ! -z “$name”

TRUE

f

f

test ! “${name-x}”

f

TRUE

f

test ! “${name+x}”

f

f

TRUE

Caution

Be Careful not to give yourself away Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur in dolor id magna tincidunt accumsan. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean congue laoreet placerat. In nec consequat elit, quis pharetra sapien. Vestibulum nec fringilla nunc. Nam tempor dolor quis pulvinar pharetra. Aenean rhoncus venenatis consequat. Phasellus non scelerisque nisl. Suspendisse malesuada lorem vitae aliquam porttitor. Duis et dolor at neque ultricies condimentum eu sodales lorem. Donec aliquet nisl eu purus dignissim, ac bibendum ante condimentum. Suspendisse finibus, risus eu placerat aliquet, felis turpis dapibus diam, a vehicula urna risus ac leo.