SlideShare a Scribd company logo
7
Most read
8
Most read
9
Most read
Documenting with Sphinx
ReStructured Text to HTML
Authoring
Workflow
Write RST using any 'text' editor
Compile RST to HTML using
Sphinx
Host HTML using any web server
ReStructured
Text
• A plain text format
• Also known as RST
• Authored using plain-text editors
• Markdown is used for formatting
• Compiles into HTML
• Intro to simple formatting options at
https://en.wikipedia.org/wiki/ReStructuredText#Ex
amples_of_reST_markup
Basic Formatting
First Heading
=============
Sub-heading
-----------
Third Heading
~~~~~~~~~~~~~
Paragraphs are separated
by a blank line.
Two spaces at the end of
a line produces a line
break.
*text* for emphasis
(italics)
**text** for strong
emphasis (boldface)
``text`` for code
samples.
* this is
* a list
* with a nested list
* and some subitems
* and here the parent list
continues
1. This is a numbered list.
2. It has two items too.
#. This is a numbered list.
#. It has two items too.
More Formatting
.. This is a comment.
.. This whole indented
block is a comment.
Still in the comment.
.. image:: path/to/image.png
.. raw:: html
<div>This is raw HTML</div>
This is a paragraph that contains `a link`_.
.. _a link: https://domain.invalid/
:: some literal text
This may also be used inline at the end of a paragraph, like so::
some more literal text
Tables
+------------------------+------------+----------+----------+
| Header row, column 1 | Header 2 | Header 3 | Header 4 |
| (header rows optional) | | | |
+========================+============+==========+==========+
| body row 1, column 1 | column 2 | column 3 | column 4 |
+------------------------+------------+----------+----------+
| body row 2 | ... | ... | |
+------------------------+------------+----------+----------+
===== ===== =======
A B A and B
===== ===== =======
False False False
True False False
False True False
True True True
===== ===== =======
Other supported Table formats:
CSV Table:
https://docutils.sourceforge.io/docs/ref/rst/directives.html#csv-table
List Table:
https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table
Cautions
Use a plain-text
editor only
• Notepad++, Vim
etc.
1
Don’t use
WYSIWYG
editors
• MS word, textEdit,
Notepad etc.
2
Use uniform
underlines for
headings in all
files
3
Keep track for
indentation,
whitespace &
blank-lines in rst
file
4
Sphinx
• Tool that converts rst to HTML
• Multiple skins (themes) available
• Plugins available for extending
• Complete list of formatting options supported by sphinx
https://www.sphinx-
doc.org/en/master/usage/restructuredtext/basics.html
One-time
Setup
Customize customize conf.py
Create Create Documentation Structure
Install Install required Sphinx plugins e.g. rtdtheme
Install Install Sphinx in virtual env
Create Create Python virtual env (best practice)
Install Install Python
Additional Best Practice – Use GIT
• Version control source files
• rst files
• conf.py
• GIT is common version control system
• Keeps the data safe
• Allows to pull old versions
• Allow seamless collaboration
More about source control and Git at
https://www.slideshare.net/AkshayMathur7/git-workshop-26088242
Resources
• Down & Install Python - No need to learn Python!
• https://www.python.org/downloads/
• Download & Install GIT [this also provides Linux shell on Windows]
• https://git-scm.com/downloads
• Create and activate virtual env
• https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments
• Install Sphinx from pypi
• pip install -U sphinx
• https://www.sphinx-doc.org/en/master/usage/installation.html#installation-from-
pypi
• Install RTD Theme
• pip install sphinx_rtd_theme
• https://pypi.org/project/sphinx-rtd-theme/
• Theme config: https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html
Resources
• Setup documentation source structure
• sphinx-quickstart
• https://www.sphinx-doc.org/en/master/usage/quickstart.html#setting-up-
the-documentation-sources
• Build Configuration file [conf.py]
• The file is generated with documentation source structure
• Options in file have include description
• https://www.sphinx-doc.org/en/master/usage/configuration.html
• Building [converting RST to HTML]
• sphinx-build sourcedir builddir
• https://www.sphinx-doc.org/en/master/usage/quickstart.html#running-the-
build
Documentation with Sphinx

More Related Content

What's hot (20)

PDF
Python Basics | Python Tutorial | Edureka
Edureka!
 
PDF
Object Oriented Programming Using C++ Practical File
Harjinder Singh
 
PPTX
Features of 'c' program
veer patel
 
PPTX
Python ppt
Anush verma
 
PPTX
Unix shell scripting basics
Manav Prasad
 
PPT
Chapter 4 5
ahmed22dg
 
PPT
Class 7 - PHP Object Oriented Programming
Ahmed Swilam
 
PPTX
Constructor overloading in C++
Learn By Watch
 
PPTX
Memory reference
rajshreemuthiah
 
PDF
How to Install Python on Windows
Vinita Silaparasetty
 
DOCX
GPA calculator and grading program in c++
Taimur Muhammad
 
PPTX
C vs c++
Gaurav Badhan
 
PDF
How to think like a computer scientist - Learn with python
Rajendra Kumar Uppal
 
PPT
Lec 14. Call by Reference
Rushdi Shams
 
PPT
01 knapsack using backtracking
mandlapure
 
PPTX
Python Strings.pptx
M Vishnuvardhan Reddy
 
PPTX
Python in 30 minutes!
Fariz Darari
 
ODP
Introduction to Perl - Day 1
Dave Cross
 
PPTX
Css ppt
Nidhi mishra
 
PDF
1 R Tutorial Introduction
Sakthi Dasans
 
Python Basics | Python Tutorial | Edureka
Edureka!
 
Object Oriented Programming Using C++ Practical File
Harjinder Singh
 
Features of 'c' program
veer patel
 
Python ppt
Anush verma
 
Unix shell scripting basics
Manav Prasad
 
Chapter 4 5
ahmed22dg
 
Class 7 - PHP Object Oriented Programming
Ahmed Swilam
 
Constructor overloading in C++
Learn By Watch
 
Memory reference
rajshreemuthiah
 
How to Install Python on Windows
Vinita Silaparasetty
 
GPA calculator and grading program in c++
Taimur Muhammad
 
C vs c++
Gaurav Badhan
 
How to think like a computer scientist - Learn with python
Rajendra Kumar Uppal
 
Lec 14. Call by Reference
Rushdi Shams
 
01 knapsack using backtracking
mandlapure
 
Python Strings.pptx
M Vishnuvardhan Reddy
 
Python in 30 minutes!
Fariz Darari
 
Introduction to Perl - Day 1
Dave Cross
 
Css ppt
Nidhi mishra
 
1 R Tutorial Introduction
Sakthi Dasans
 

Similar to Documentation with Sphinx (8)

KEY
Sphinx-quickstart
Daigo Shitara
 
PPTX
Markup languages and warp-speed documentation
Lois Patterson
 
PDF
Lois Patterson: Markup Languages and Warp-Speed Documentation
Jack Molisani
 
PPTX
Moving from Publican to Read The Docs
Sebastien Goasguen
 
PDF
cauldron-2022-docs-bof at gcc cauldron in 2022
ssuser866937
 
PPTX
Life with Sphinx 2012 #sphinxconjp
Takeshi Komiya
 
PDF
sphinx demo
ak013
 
PDF
Scale2016
Dru Lavigne
 
Sphinx-quickstart
Daigo Shitara
 
Markup languages and warp-speed documentation
Lois Patterson
 
Lois Patterson: Markup Languages and Warp-Speed Documentation
Jack Molisani
 
Moving from Publican to Read The Docs
Sebastien Goasguen
 
cauldron-2022-docs-bof at gcc cauldron in 2022
ssuser866937
 
Life with Sphinx 2012 #sphinxconjp
Takeshi Komiya
 
sphinx demo
ak013
 
Scale2016
Dru Lavigne
 
Ad

More from Akshay Mathur (20)

PPTX
Kubernetes Journey of a Large FinTech
Akshay Mathur
 
PPTX
Security and Observability of Application Traffic in Kubernetes
Akshay Mathur
 
PPTX
Enhanced Security and Visibility for Microservices Applications
Akshay Mathur
 
PPTX
Considerations for East-West Traffic Security and Analytics for Kubernetes En...
Akshay Mathur
 
PPTX
Kubernetes as Orchestrator for A10 Lightning Controller
Akshay Mathur
 
PPTX
Cloud Bursting with A10 Lightning ADS
Akshay Mathur
 
PPTX
Shared Security Responsibility Model of AWS
Akshay Mathur
 
PPTX
Techniques for scaling application with security and visibility in cloud
Akshay Mathur
 
PPTX
Introduction to Node js
Akshay Mathur
 
PPTX
Object Oriented Programing in JavaScript
Akshay Mathur
 
PPTX
Getting Started with Angular JS
Akshay Mathur
 
PDF
Releasing Software Without Testing Team
Akshay Mathur
 
PPTX
Getting Started with jQuery
Akshay Mathur
 
PPTX
CoffeeScript
Akshay Mathur
 
PPTX
Creating Single Page Web App using Backbone JS
Akshay Mathur
 
PPTX
Getting Started with Web
Akshay Mathur
 
PPTX
Getting Started with Javascript
Akshay Mathur
 
PPTX
Using Google App Engine Python
Akshay Mathur
 
PPTX
Working with GIT
Akshay Mathur
 
PPTX
Testing Single Page Webapp
Akshay Mathur
 
Kubernetes Journey of a Large FinTech
Akshay Mathur
 
Security and Observability of Application Traffic in Kubernetes
Akshay Mathur
 
Enhanced Security and Visibility for Microservices Applications
Akshay Mathur
 
Considerations for East-West Traffic Security and Analytics for Kubernetes En...
Akshay Mathur
 
Kubernetes as Orchestrator for A10 Lightning Controller
Akshay Mathur
 
Cloud Bursting with A10 Lightning ADS
Akshay Mathur
 
Shared Security Responsibility Model of AWS
Akshay Mathur
 
Techniques for scaling application with security and visibility in cloud
Akshay Mathur
 
Introduction to Node js
Akshay Mathur
 
Object Oriented Programing in JavaScript
Akshay Mathur
 
Getting Started with Angular JS
Akshay Mathur
 
Releasing Software Without Testing Team
Akshay Mathur
 
Getting Started with jQuery
Akshay Mathur
 
CoffeeScript
Akshay Mathur
 
Creating Single Page Web App using Backbone JS
Akshay Mathur
 
Getting Started with Web
Akshay Mathur
 
Getting Started with Javascript
Akshay Mathur
 
Using Google App Engine Python
Akshay Mathur
 
Working with GIT
Akshay Mathur
 
Testing Single Page Webapp
Akshay Mathur
 
Ad

Recently uploaded (20)

PDF
NewsWireJet-Case-Study-VARA-restaurant.pdf
NewswireJet
 
PDF
Google & Meta Ads Latest Updates Every Marketer Should Know
First DigiAdd
 
PPT
Marketing Mix - Mrs.S.Shree Nithi - BBA-02.07.2025.ppt
shreenithis2
 
PPTX
"Driving Business Growth Through Marketing"
PrinceRaj706711
 
PPTX
"Mastering Success Through Digital Marketing"
PrinceRaj706711
 
PPT
👉Python Programming Course – Complete Overview 3.ppt
satsahibsatshib9
 
PDF
Best Cloud Computing Course in Jalandhar.pdf
prabhkiran684
 
PPT
Class4_444444444444444444444The Internal Organization.ppt
yusufrehankhan
 
PPTX
How to Grow Twitter Followers: Proven Strategies for Success
phpcodingmaster
 
PDF
The best Linux course in Jalandhar.pdf
prabhkiran684
 
PDF
Demystifying Agentic AI & GEO for SEO: Unlock Rankings in the Generative Sear...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
PDF
The Digital Survival Guide for Service-Based Businesses in 2025
BIMA, Inc.
 
PDF
Using AI to Enhance (Not Create) Marketing Content - Ginger Shimp, SAP
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
PDF
KFC Brand Audit and Marketing Strategies
ASHITHA P R
 
PPTX
Brand Archetype for better understanding
Siddharth Misra
 
PPTX
Are You Missing Out on Voice Search Traffic? The AEO Solution
First DigiAdd
 
PPTX
ADVERTISING AND SALES MANAGEMENTS SYSTEM
sindhupremalatha98
 
PDF
Account-Based Marketing Master Class - Scott Hemmons, Sodexo
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
PPTX
INTEGRATED MARKETING COMMUNICATION - MS. SINDHU PREMALATHA
sindhupremalatha98
 
PDF
Best Digital Marketing Course in Jalandhar
prabhkiran684
 
NewsWireJet-Case-Study-VARA-restaurant.pdf
NewswireJet
 
Google & Meta Ads Latest Updates Every Marketer Should Know
First DigiAdd
 
Marketing Mix - Mrs.S.Shree Nithi - BBA-02.07.2025.ppt
shreenithis2
 
"Driving Business Growth Through Marketing"
PrinceRaj706711
 
"Mastering Success Through Digital Marketing"
PrinceRaj706711
 
👉Python Programming Course – Complete Overview 3.ppt
satsahibsatshib9
 
Best Cloud Computing Course in Jalandhar.pdf
prabhkiran684
 
Class4_444444444444444444444The Internal Organization.ppt
yusufrehankhan
 
How to Grow Twitter Followers: Proven Strategies for Success
phpcodingmaster
 
The best Linux course in Jalandhar.pdf
prabhkiran684
 
Demystifying Agentic AI & GEO for SEO: Unlock Rankings in the Generative Sear...
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
The Digital Survival Guide for Service-Based Businesses in 2025
BIMA, Inc.
 
Using AI to Enhance (Not Create) Marketing Content - Ginger Shimp, SAP
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
KFC Brand Audit and Marketing Strategies
ASHITHA P R
 
Brand Archetype for better understanding
Siddharth Misra
 
Are You Missing Out on Voice Search Traffic? The AEO Solution
First DigiAdd
 
ADVERTISING AND SALES MANAGEMENTS SYSTEM
sindhupremalatha98
 
Account-Based Marketing Master Class - Scott Hemmons, Sodexo
DigiMarCon - Digital Marketing, Media and Advertising Conferences & Exhibitions
 
INTEGRATED MARKETING COMMUNICATION - MS. SINDHU PREMALATHA
sindhupremalatha98
 
Best Digital Marketing Course in Jalandhar
prabhkiran684
 

Documentation with Sphinx

  • 2. Authoring Workflow Write RST using any 'text' editor Compile RST to HTML using Sphinx Host HTML using any web server
  • 3. ReStructured Text • A plain text format • Also known as RST • Authored using plain-text editors • Markdown is used for formatting • Compiles into HTML • Intro to simple formatting options at https://en.wikipedia.org/wiki/ReStructuredText#Ex amples_of_reST_markup
  • 4. Basic Formatting First Heading ============= Sub-heading ----------- Third Heading ~~~~~~~~~~~~~ Paragraphs are separated by a blank line. Two spaces at the end of a line produces a line break. *text* for emphasis (italics) **text** for strong emphasis (boldface) ``text`` for code samples. * this is * a list * with a nested list * and some subitems * and here the parent list continues 1. This is a numbered list. 2. It has two items too. #. This is a numbered list. #. It has two items too.
  • 5. More Formatting .. This is a comment. .. This whole indented block is a comment. Still in the comment. .. image:: path/to/image.png .. raw:: html <div>This is raw HTML</div> This is a paragraph that contains `a link`_. .. _a link: https://domain.invalid/ :: some literal text This may also be used inline at the end of a paragraph, like so:: some more literal text
  • 6. Tables +------------------------+------------+----------+----------+ | Header row, column 1 | Header 2 | Header 3 | Header 4 | | (header rows optional) | | | | +========================+============+==========+==========+ | body row 1, column 1 | column 2 | column 3 | column 4 | +------------------------+------------+----------+----------+ | body row 2 | ... | ... | | +------------------------+------------+----------+----------+ ===== ===== ======= A B A and B ===== ===== ======= False False False True False False False True False True True True ===== ===== ======= Other supported Table formats: CSV Table: https://docutils.sourceforge.io/docs/ref/rst/directives.html#csv-table List Table: https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table
  • 7. Cautions Use a plain-text editor only • Notepad++, Vim etc. 1 Don’t use WYSIWYG editors • MS word, textEdit, Notepad etc. 2 Use uniform underlines for headings in all files 3 Keep track for indentation, whitespace & blank-lines in rst file 4
  • 8. Sphinx • Tool that converts rst to HTML • Multiple skins (themes) available • Plugins available for extending • Complete list of formatting options supported by sphinx https://www.sphinx- doc.org/en/master/usage/restructuredtext/basics.html
  • 9. One-time Setup Customize customize conf.py Create Create Documentation Structure Install Install required Sphinx plugins e.g. rtdtheme Install Install Sphinx in virtual env Create Create Python virtual env (best practice) Install Install Python
  • 10. Additional Best Practice – Use GIT • Version control source files • rst files • conf.py • GIT is common version control system • Keeps the data safe • Allows to pull old versions • Allow seamless collaboration More about source control and Git at https://www.slideshare.net/AkshayMathur7/git-workshop-26088242
  • 11. Resources • Down & Install Python - No need to learn Python! • https://www.python.org/downloads/ • Download & Install GIT [this also provides Linux shell on Windows] • https://git-scm.com/downloads • Create and activate virtual env • https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments • Install Sphinx from pypi • pip install -U sphinx • https://www.sphinx-doc.org/en/master/usage/installation.html#installation-from- pypi • Install RTD Theme • pip install sphinx_rtd_theme • https://pypi.org/project/sphinx-rtd-theme/ • Theme config: https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html
  • 12. Resources • Setup documentation source structure • sphinx-quickstart • https://www.sphinx-doc.org/en/master/usage/quickstart.html#setting-up- the-documentation-sources • Build Configuration file [conf.py] • The file is generated with documentation source structure • Options in file have include description • https://www.sphinx-doc.org/en/master/usage/configuration.html • Building [converting RST to HTML] • sphinx-build sourcedir builddir • https://www.sphinx-doc.org/en/master/usage/quickstart.html#running-the- build