Here are the examples you requested. I'm using .rst for my source_suffix, but you can change that in your conf.py for your site. Notice, I named the bash file test.sh.rst to remind myself it is a bash file. Linux doesn't care what the file name is as long as you set the mod with chmod +x.
index.rst example:
.. _MyManual:
My Manual
===========================================
.. toctree::
:maxdepth: 2
:caption: Contents:
doc/doc
bash/test.sh
Example test.sh.rst:
#!/bin/bash
: '
***********************
Example Bash
***********************
Using multi-line comment for larger comments.
And use hash # to proceed code so it shows nicely in sphinx. Note the double
:: at the end to give the proper formatting.
'
# Initial code::
mkdir tmp
# check_client::
check_client()
{
# determine if this is being run on a client that is using git folder
# check the parameter for the bash on CLI and if exist, use it
echo HERE in client "$1" and "$parameter_1"
if [[ "$parameter_1" = "" ]]; then
client_directory=/
else
client_directory=/git
fi
}
# other code::
parameter_1="$1"
check_client
echo the client is "$client_directory"
read -p "pause " answer