I don't know about a "gentle" introduction, but VR3 has an extensive docstring you can read by means of the Plugins menu.
I use Sphinx a lot, and normally I don't even create a Sphinx configuration file. I find I can do enough configuration for my needs with command-line parameters, which I supply with a little script that I can attach to a button. The script would be specialized for a particular outline so the button won't show up for all outlines.
Here is one of the scripts I use. It seems more complicated than it is, but it lets you start from any node in the outline so you don't have to remember to navigate to the top of the @rst tree.
@language python
from sys import executable
import subprocess
import os
target = None
HEAD = "GF4 User's Guide"
p0 = c.p
for p in c.all_unique_positions():
if p.h.startswith(HEAD):
target = p
c.selectPosition(target)
break
if target:
c.k.simulateCommand('rst3')
# Thw rst3 command writes to correct (@path sphinx) directory
# but Sphinx will look in current directory, which may
# not be the same. So -
# if we start from a selected node outside the
# @path sphinx tree, temporarily cd to the docs directory.
cwd = os.getcwd()
if not cwd.endswith('sphinx'):
temp_cwd = os.path.join(cwd, 'sphinx')
os.chdir(temp_cwd)
# Other likely themes:
#'-D', 'html_theme=sphinx_book_theme',
#'-D', 'html_theme=bizstyle',
cmd = [executable, '-m', 'sphinx', '-C',
'-b', 'html',
'-D', "master_doc=GF4_Users_Guide",
'-D', 'source_suffix=.rst',
'-D', 'html_theme=pyramid',
'-D', 'project=GF4',
'-D', 'extensions=sphinx.ext.autosectionlabel',
'-D', 'copyright=Thomas B. Passin 2022',
'-D', "html_theme_options.sidebarwidth=20em",
# sourcedir, outputdir:
r'.', r'..\docs']
subprocess.call(cmd)
else:
g.es('Cannot find the @rst tree to process', color = 'red')
The key here is providing Sphinx's command line arguments. That happens in the block that starts
cmd = [executable, '-m', 'sphinx', '-C',
There are command line parameters for many of the things that would be in a config file. The trickiest part is getting the source and build directories right. They will be relative to the outline's directory if you use relative paths.
For this Sphinx document, the entire rst document is a child of a node name @path sphinx. This points to a subdirectory sphinx just below the outline's directory. The directory structure looks like this:
gf4-docs.leo
docs
sphinx
images