• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

Use Sphinx To Create Documentation In Multiple Formats On CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
18
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1: Update the system
  3. Step 2: Install pip and Sphinx
  4. Step 3: Setup the basic configuration for your documentation
  5. Step 4: Construct the hierarchy for your documentation
  6. Step 5: Create source files specified above
  7. Step 6: Output the HTML version of your documentation
  8. Want to contribute?


Sphinx is a useful Python-based tool for technicians and writers that allows them to easily create elegant, fully-functional documentation in various formats. With Sphinx, you write documents using reStructuredText — a lightweight markup language — for starters, then you can get the output in multiple formats, including HTML, LaTeX, PDF, ePub, and others.

In this tutorial, we will be covering the process of installing and using Sphinx on a CentOS 7 x64 instance on Vult’s platform.

Prerequisites

  • A CentOS 7 x64 instance.
  • A sudo user.

Step 1: Update the system

sudo yum update
sudo shutdown -r now

Step 2: Install pip and Sphinx

sudo yum install -y python-devel python-setuptools python-pip
sudo pip install --upgrade pip
sudo pip install -U Sphinx

Step 3: Setup the basic configuration for your documentation

Before starting to use Sphinx, you need to specify your source directory in which Sphinx will run and save all your documentation. Once you have created the directory you intend to use, you can then run sphinx-quickstart which will initialize Sphinx and create the required basic configuration.

sphinx-quickstart is similar to a setup wizard which will prompt you with questions that determine the aspects of your project.

cd ~
mkdir doc1
cd doc1
sphinx-quickstart

Step 4: Construct the hierarchy for your documentation

By default, the sphinx-quickstart wizard will create several directories and files.

_build           # The directory for containing Sphinx output
conf.py          # The file containing your project configurations
index.rst        # The master file containing the hierarchy of your documentation
make.bat         # A Windows command file
Makefile         # A file necessary for running the make command
_static          # The directory for static files, including custom stylesheets, pictures, etc.
_templates       # The directory for custom templates

Let’s have a look at the master file, index.rst, which contains the hierarchy of your documentation; namely, the table of contents tree or toctree.

Open it with a text editor:

vi index.rst

As you review the file, you will notice a section called toctree. If you have other source files (*.rst) for your documentation, you will need to specify them in the toctree section:
.. toctree::
:maxdepth: 2

   introduction
   chapter1
   chapter2
   chapter3
   more

It is imperative to:

  • Leave a blank row above your input.
  • Do not suffix your source files with .rst.
  • Place your source files in their respective order.
  • Use only one file name per row.
  • Indent your file names with :maxdepth: 2.

Once you have completed your modifications, save your file and exit the text editor.

ESC
:!wq

Step 5: Create source files specified above

The source files must be created with names that match what was previously specified in index.rst, otherwise they will not be included in the final output.

All of the source files must be compatible with the reStructuredText markup language. For more information, please refer to reStructuredText Primer.

Step 6: Output the HTML version of your documentation

Once you have finished composing your documentation, you can output your work in HTML format by executing the below command:

make html

The output will be saved in the directory .//_build/html which includes everything necessary for viewing the file in a web browsing.

This concludes our tutorial.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Mailtrain Newsletter Application on CentOS 7

Next Post

Setting up WordPress With WooCommerce on CentOS 6

Next Post

Setting up WordPress With WooCommerce on CentOS 6

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet