Sphinx can turn a ReStructured Text file or series of files into good looking HTML documentation. But when you read how to get it going, it seems complicated. You are told the set up a folder and run make to produce a configuration file, which you will probably tinker with. It's confusing what all the options and settings mean.
Turns out you don't have to do all that if you are willing to live with a basic configuration, but it's probably one you would use most of the time anyway. Instead of generating a config file, you can just write a small script that passes the most important options to Sphinx directly. You can write the script in a Leo node and run it with CNTL-B like any other script.
Here is an annotated sample.
import sys
import subprocess
pyexe=sys.executable
cmd=[pyexe,'-m','sphinx','-C',
'-D', 'master_doc=main_doc', # the main RsT file
'-D', 'source_suffix=.rst', # The RsT file extension
# (set by a Leo setting)
'-D', 'html_theme=bizstyle', # Look on web for other themes
'-D', 'project=my project', # Project name, can have spaces
'-D', 'copyright=T. B. Passin', # Optional
'.', 'result-dir'] # Directory for generated files
subprocess.call(cmd)
I don't recall just now if Sphinx will make the output directory for you if it doesn't exist.
You can create the file(s) using the rst3 command on an @rst file, or you can just write an RsT file (or file tree) by hand yourself, as an @clean file. Then run your script and when Sphinx is done it will tell you where to find the output HTML files. If you use it often, you can make it into a button.
When I need to create a new Sphinx project, I usually copy the script to a new outline and change the key names.
That's it!