SlideShare a Scribd company logo
1 of 13
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

What's hot (20)

Exception handling in JAVA
Exception handling in JAVAException handling in JAVA
Exception handling in JAVA
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introducción a Voldemort - Innova4j
Introducción a Voldemort - Innova4jIntroducción a Voldemort - Innova4j
Introducción a Voldemort - Innova4j
 
What Is Agile Scrum
What Is Agile ScrumWhat Is Agile Scrum
What Is Agile Scrum
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
Le Wagon - Web 101
Le Wagon - Web 101Le Wagon - Web 101
Le Wagon - Web 101
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Qué es Bootstrap.pptx
Qué es Bootstrap.pptxQué es Bootstrap.pptx
Qué es Bootstrap.pptx
 
Java Collection Framework: lo que todo Java Dev debe conocer
Java Collection Framework: lo que todo Java Dev debe conocerJava Collection Framework: lo que todo Java Dev debe conocer
Java Collection Framework: lo que todo Java Dev debe conocer
 
Git101
Git101Git101
Git101
 
Git undo
Git undoGit undo
Git undo
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Agile Software Development Model
Agile Software Development ModelAgile Software Development Model
Agile Software Development Model
 
Strings in Java
Strings in Java Strings in Java
Strings in Java
 
Java notes
Java notesJava notes
Java notes
 
Java Strings
Java StringsJava Strings
Java Strings
 
Técnicas avanzadas de control de versiones
Técnicas avanzadas de control de versionesTécnicas avanzadas de control de versiones
Técnicas avanzadas de control de versiones
 
Introduction to CMake
Introduction to CMakeIntroduction to CMake
Introduction to CMake
 
HTML + CSS Examples
HTML + CSS ExamplesHTML + CSS Examples
HTML + CSS Examples
 

Similar to Documentation with Sphinx

Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchAndrew Lowe
 
Style guideshell
Style guideshellStyle guideshell
Style guideshellblaap
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API DocumentationSelvakumar T S
 
Easy Blogging With Emacs
Easy Blogging With EmacsEasy Blogging With Emacs
Easy Blogging With EmacsDashamir Hoxha
 
BASH Guide Summary
BASH Guide SummaryBASH Guide Summary
BASH Guide SummaryOhgyun Ahn
 
Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...webhostingguy
 
Using existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsUsing existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsMicrosoft Tech Community
 
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...Redis Labs
 

Similar to Documentation with Sphinx (20)

Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Style guideshell
Style guideshellStyle guideshell
Style guideshell
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API Documentation
 
Easy Blogging With Emacs
Easy Blogging With EmacsEasy Blogging With Emacs
Easy Blogging With Emacs
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Php1
Php1Php1
Php1
 
BASH Guide Summary
BASH Guide SummaryBASH Guide Summary
BASH Guide Summary
 
Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...
 
Using existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analyticsUsing existing language skillsets to create large-scale, cloud-based analytics
Using existing language skillsets to create large-scale, cloud-based analytics
 
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
 
abc12
abc12abc12
abc12
 
popopo
popopopopopo
popopo
 
abc
abcabc
abc
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Php1
Php1Php1
Php1
 

More from Akshay Mathur

Kubernetes Journey of a Large FinTech
Kubernetes Journey of a Large FinTechKubernetes Journey of a Large FinTech
Kubernetes Journey of a Large FinTechAkshay Mathur
 
Security and Observability of Application Traffic in Kubernetes
Security and Observability of Application Traffic in KubernetesSecurity and Observability of Application Traffic in Kubernetes
Security and Observability of Application Traffic in KubernetesAkshay Mathur
 
Enhanced Security and Visibility for Microservices Applications
Enhanced Security and Visibility for Microservices ApplicationsEnhanced Security and Visibility for Microservices Applications
Enhanced Security and Visibility for Microservices ApplicationsAkshay Mathur
 
Considerations for East-West Traffic Security and Analytics for Kubernetes En...
Considerations for East-West Traffic Security and Analytics for Kubernetes En...Considerations for East-West Traffic Security and Analytics for Kubernetes En...
Considerations for East-West Traffic Security and Analytics for Kubernetes En...Akshay Mathur
 
Kubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerKubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerAkshay Mathur
 
Cloud Bursting with A10 Lightning ADS
Cloud Bursting with A10 Lightning ADSCloud Bursting with A10 Lightning ADS
Cloud Bursting with A10 Lightning ADSAkshay Mathur
 
Shared Security Responsibility Model of AWS
Shared Security Responsibility Model of AWSShared Security Responsibility Model of AWS
Shared Security Responsibility Model of AWSAkshay Mathur
 
Techniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloudTechniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloudAkshay Mathur
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptAkshay Mathur
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JSAkshay Mathur
 
Releasing Software Without Testing Team
Releasing Software Without Testing TeamReleasing Software Without Testing Team
Releasing Software Without Testing TeamAkshay Mathur
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQueryAkshay Mathur
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSCreating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSAkshay Mathur
 
Getting Started with Web
Getting Started with WebGetting Started with Web
Getting Started with WebAkshay Mathur
 
Getting Started with Javascript
Getting Started with JavascriptGetting Started with Javascript
Getting Started with JavascriptAkshay Mathur
 
Using Google App Engine Python
Using Google App Engine PythonUsing Google App Engine Python
Using Google App Engine PythonAkshay Mathur
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page WebappAkshay Mathur
 

More from Akshay Mathur (20)

Kubernetes Journey of a Large FinTech
Kubernetes Journey of a Large FinTechKubernetes Journey of a Large FinTech
Kubernetes Journey of a Large FinTech
 
Security and Observability of Application Traffic in Kubernetes
Security and Observability of Application Traffic in KubernetesSecurity and Observability of Application Traffic in Kubernetes
Security and Observability of Application Traffic in Kubernetes
 
Enhanced Security and Visibility for Microservices Applications
Enhanced Security and Visibility for Microservices ApplicationsEnhanced Security and Visibility for Microservices Applications
Enhanced Security and Visibility for Microservices Applications
 
Considerations for East-West Traffic Security and Analytics for Kubernetes En...
Considerations for East-West Traffic Security and Analytics for Kubernetes En...Considerations for East-West Traffic Security and Analytics for Kubernetes En...
Considerations for East-West Traffic Security and Analytics for Kubernetes En...
 
Kubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerKubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning Controller
 
Cloud Bursting with A10 Lightning ADS
Cloud Bursting with A10 Lightning ADSCloud Bursting with A10 Lightning ADS
Cloud Bursting with A10 Lightning ADS
 
Shared Security Responsibility Model of AWS
Shared Security Responsibility Model of AWSShared Security Responsibility Model of AWS
Shared Security Responsibility Model of AWS
 
Techniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloudTechniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloud
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScript
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
 
Releasing Software Without Testing Team
Releasing Software Without Testing TeamReleasing Software Without Testing Team
Releasing Software Without Testing Team
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSCreating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JS
 
Getting Started with Web
Getting Started with WebGetting Started with Web
Getting Started with Web
 
Getting Started with Javascript
Getting Started with JavascriptGetting Started with Javascript
Getting Started with Javascript
 
Using Google App Engine Python
Using Google App Engine PythonUsing Google App Engine Python
Using Google App Engine Python
 
Working with GIT
Working with GITWorking with GIT
Working with GIT
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
 

Recently uploaded

9654467111 Call Girls In Mahipalpur Women Seeking Men
9654467111 Call Girls In Mahipalpur Women Seeking Men9654467111 Call Girls In Mahipalpur Women Seeking Men
9654467111 Call Girls In Mahipalpur Women Seeking MenSapana Sha
 
Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...
Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...
Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...Search Engine Journal
 
GreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web RevolutionGreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web RevolutionWilliam Barnes
 
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...Benjamin Szturmaj
 
Branding strategies of new company .pptx
Branding strategies of new company .pptxBranding strategies of new company .pptx
Branding strategies of new company .pptxVikasTiwari846641
 
Call Us ➥9654467111▻Call Girls In Delhi NCR
Call Us ➥9654467111▻Call Girls In Delhi NCRCall Us ➥9654467111▻Call Girls In Delhi NCR
Call Us ➥9654467111▻Call Girls In Delhi NCRSapana Sha
 
Kraft Mac and Cheese campaign presentation
Kraft Mac and Cheese campaign presentationKraft Mac and Cheese campaign presentation
Kraft Mac and Cheese campaign presentationtbatkhuu1
 
Unraveling the Mystery of the Hinterkaifeck Murders.pptx
Unraveling the Mystery of the Hinterkaifeck Murders.pptxUnraveling the Mystery of the Hinterkaifeck Murders.pptx
Unraveling the Mystery of the Hinterkaifeck Murders.pptxelizabethella096
 
How To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot SetupHow To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot Setupssuser4571da
 
marketing strategy of tanishq word PPROJECT.pdf
marketing strategy of tanishq word PPROJECT.pdfmarketing strategy of tanishq word PPROJECT.pdf
marketing strategy of tanishq word PPROJECT.pdfarsathsahil
 
Beyond Resumes_ How Volunteering Shapes Career Trajectories by Kent Kubie
Beyond Resumes_ How Volunteering Shapes Career Trajectories by Kent KubieBeyond Resumes_ How Volunteering Shapes Career Trajectories by Kent Kubie
Beyond Resumes_ How Volunteering Shapes Career Trajectories by Kent KubieKent Kubie
 
Cost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surgesCost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surgesPushON Ltd
 
Social Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdfSocial Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdfSocial Samosa
 
Enjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Avoid the 2025 web accessibility rush: do not fear WCAG compliance
Avoid the 2025 web accessibility rush: do not fear WCAG complianceAvoid the 2025 web accessibility rush: do not fear WCAG compliance
Avoid the 2025 web accessibility rush: do not fear WCAG complianceDamien ROBERT
 
Brand experience Peoria City Soccer Presentation.pdf
Brand experience Peoria City Soccer Presentation.pdfBrand experience Peoria City Soccer Presentation.pdf
Brand experience Peoria City Soccer Presentation.pdftbatkhuu1
 
Mastering SEO in the Evolving AI-driven World
Mastering SEO in the Evolving AI-driven WorldMastering SEO in the Evolving AI-driven World
Mastering SEO in the Evolving AI-driven WorldScalenut
 

Recently uploaded (20)

How to Create a Social Media Plan Like a Pro - Jordan Scheltgen
How to Create a Social Media Plan Like a Pro - Jordan ScheltgenHow to Create a Social Media Plan Like a Pro - Jordan Scheltgen
How to Create a Social Media Plan Like a Pro - Jordan Scheltgen
 
9654467111 Call Girls In Mahipalpur Women Seeking Men
9654467111 Call Girls In Mahipalpur Women Seeking Men9654467111 Call Girls In Mahipalpur Women Seeking Men
9654467111 Call Girls In Mahipalpur Women Seeking Men
 
Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...
Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...
Do More with Less: Navigating Customer Acquisition Challenges for Today's Ent...
 
GreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web RevolutionGreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web Revolution
 
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
 
Branding strategies of new company .pptx
Branding strategies of new company .pptxBranding strategies of new company .pptx
Branding strategies of new company .pptx
 
Turn Digital Reputation Threats into Offense Tactics - Daniel Lemin
Turn Digital Reputation Threats into Offense Tactics - Daniel LeminTurn Digital Reputation Threats into Offense Tactics - Daniel Lemin
Turn Digital Reputation Threats into Offense Tactics - Daniel Lemin
 
Call Us ➥9654467111▻Call Girls In Delhi NCR
Call Us ➥9654467111▻Call Girls In Delhi NCRCall Us ➥9654467111▻Call Girls In Delhi NCR
Call Us ➥9654467111▻Call Girls In Delhi NCR
 
Generative AI Master Class - Generative AI, Unleash Creative Opportunity - Pe...
Generative AI Master Class - Generative AI, Unleash Creative Opportunity - Pe...Generative AI Master Class - Generative AI, Unleash Creative Opportunity - Pe...
Generative AI Master Class - Generative AI, Unleash Creative Opportunity - Pe...
 
Kraft Mac and Cheese campaign presentation
Kraft Mac and Cheese campaign presentationKraft Mac and Cheese campaign presentation
Kraft Mac and Cheese campaign presentation
 
Unraveling the Mystery of the Hinterkaifeck Murders.pptx
Unraveling the Mystery of the Hinterkaifeck Murders.pptxUnraveling the Mystery of the Hinterkaifeck Murders.pptx
Unraveling the Mystery of the Hinterkaifeck Murders.pptx
 
How To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot SetupHow To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot Setup
 
marketing strategy of tanishq word PPROJECT.pdf
marketing strategy of tanishq word PPROJECT.pdfmarketing strategy of tanishq word PPROJECT.pdf
marketing strategy of tanishq word PPROJECT.pdf
 
Beyond Resumes_ How Volunteering Shapes Career Trajectories by Kent Kubie
Beyond Resumes_ How Volunteering Shapes Career Trajectories by Kent KubieBeyond Resumes_ How Volunteering Shapes Career Trajectories by Kent Kubie
Beyond Resumes_ How Volunteering Shapes Career Trajectories by Kent Kubie
 
Cost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surgesCost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surges
 
Social Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdfSocial Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdf
 
Enjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 4 Gurgaon >༒8448380779 Escort Service
 
Avoid the 2025 web accessibility rush: do not fear WCAG compliance
Avoid the 2025 web accessibility rush: do not fear WCAG complianceAvoid the 2025 web accessibility rush: do not fear WCAG compliance
Avoid the 2025 web accessibility rush: do not fear WCAG compliance
 
Brand experience Peoria City Soccer Presentation.pdf
Brand experience Peoria City Soccer Presentation.pdfBrand experience Peoria City Soccer Presentation.pdf
Brand experience Peoria City Soccer Presentation.pdf
 
Mastering SEO in the Evolving AI-driven World
Mastering SEO in the Evolving AI-driven WorldMastering SEO in the Evolving AI-driven World
Mastering SEO in the Evolving AI-driven World
 

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