Skip to content

Instantly share code, notes, and snippets.

@RobbiNespu
Created December 9, 2020 15:33
Show Gist options
  • Save RobbiNespu/cf132ac07eaafba8c0d5d8c6f43b9558 to your computer and use it in GitHub Desktop.
Save RobbiNespu/cf132ac07eaafba8c0d5d8c6f43b9558 to your computer and use it in GitHub Desktop.
Setup sphinx + ablog
[robbi@r0x ~]$ sudo dnf info python3-virtualenv
Name : python3-virtualenv
Version : 20.0.30
Release : 1.fc33
Architecture : noarch
Size : 221 k
Source : python-virtualenv-20.0.30-1.fc33.src.rpm
Repository : fedora
Summary : Tool to create isolated Python environments
URL : http://pypi.python.org/pypi/virtualenv
License : MIT
Description : virtualenv is a tool to create isolated Python environments. virtualenv
: is a successor to workingenv, and an extension of virtual-python. It is
: written by Ian Bicking, and sponsored by the Open Planning Project. It is
: licensed under an MIT-style permissive license
[robbi@r0x ~]$ sudo dnf install python3-virtualenv
Last metadata expiration check: 0:01:25 ago on Wed 09 Dec 2020 05:38:11 PM +08.
Dependencies resolved.
=====================================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================================
Installing:
python3-virtualenv noarch 20.0.30-1.fc33 fedora 221 k
Installing dependencies:
python-wheel-wheel noarch 1:0.34.2-1.fc33 fedora 33 k
python3-appdirs noarch 1.4.3-15.fc33 fedora 22 k
python3-distlib noarch 0.3.1-2.fc33 fedora 187 k
python3-filelock noarch 3.0.12-8.fc33 fedora 22 k
Transaction Summary
=====================================================================================================================================================================
Install 5 Packages
Total download size: 485 k
Installed size: 1.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): python3-appdirs-1.4.3-15.fc33.noarch.rpm 19 kB/s | 22 kB 00:01
(2/5): python-wheel-wheel-0.34.2-1.fc33.noarch.rpm 28 kB/s | 33 kB 00:01
(3/5): python3-filelock-3.0.12-8.fc33.noarch.rpm 179 kB/s | 22 kB 00:00
(4/5): python3-distlib-0.3.1-2.fc33.noarch.rpm 98 kB/s | 187 kB 00:01
(5/5): python3-virtualenv-20.0.30-1.fc33.noarch.rpm 314 kB/s | 221 kB 00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 150 kB/s | 485 kB 00:03
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-filelock-3.0.12-8.fc33.noarch 1/5
Installing : python3-distlib-0.3.1-2.fc33.noarch 2/5
Installing : python3-appdirs-1.4.3-15.fc33.noarch 3/5
Installing : python-wheel-wheel-1:0.34.2-1.fc33.noarch 4/5
Installing : python3-virtualenv-20.0.30-1.fc33.noarch 5/5
Running scriptlet: python3-virtualenv-20.0.30-1.fc33.noarch 5/5
Verifying : python-wheel-wheel-1:0.34.2-1.fc33.noarch 1/5
Verifying : python3-appdirs-1.4.3-15.fc33.noarch 2/5
Verifying : python3-distlib-0.3.1-2.fc33.noarch 3/5
Verifying : python3-filelock-3.0.12-8.fc33.noarch 4/5
Verifying : python3-virtualenv-20.0.30-1.fc33.noarch 5/5
Installed:
python-wheel-wheel-1:0.34.2-1.fc33.noarch python3-appdirs-1.4.3-15.fc33.noarch python3-distlib-0.3.1-2.fc33.noarch python3-filelock-3.0.12-8.fc33.noarch
python3-virtualenv-20.0.30-1.fc33.noarch
Complete!
[robbi@r0x python]$ pwd
/home/robbi/Documents/workspace/python
[robbi@r0x python]$ git clone https://github.com/RobbiNespu/fedoramy.github.io.git
Cloning into 'fedoramy.github.io'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
[robbi@r0x python]$ cd fedoramy.github.io/ && git checkout -b sphinx_ablog && cd ..
Switched to a new branch 'sphinx_ablog'
[robbi@r0x python]$ python -m virtualenv fedoramy.github.io
created virtual environment CPython3.9.0.final.0-64 in 1199ms
creator CPython3Posix(dest=/home/robbi/Documents/workspace/python/fedoramy.github.io, clear=False, global=False)
seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/robbi/.local/share/virtualenv)
added seed packages: pip==20.2.2, setuptools==49.1.3, wheel==0.34.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
[robbi@r0x python]$ ls -lrta fedoramy.github.io/
total 36
drwxr-xr-x. 3 robbi robbi 4096 Dec 9 17:43 ..
-rw-r--r--. 1 robbi robbi 20 Dec 9 17:43 README.md
drwxr-xr-x. 8 robbi robbi 4096 Dec 9 17:44 .git
drwxr-xr-x. 3 robbi robbi 4096 Dec 9 17:45 lib64
drwxr-xr-x. 3 robbi robbi 4096 Dec 9 17:45 lib
-rw-r--r--. 1 robbi robbi 40 Dec 9 17:45 .gitignore
drwxr-xr-x. 6 robbi robbi 4096 Dec 9 17:45 .
drwxr-xr-x. 2 robbi robbi 4096 Dec 9 17:45 bin
-rw-r--r--. 1 robbi robbi 201 Dec 9 17:45 pyvenv.cfg
[robbi@r0x python]$ cd fedoramy.github.io/ && source bin/activate
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ python -V
Python 3.9.0
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ pip install -U sphinx
Collecting sphinx
Downloading Sphinx-3.3.1-py3-none-any.whl (2.9 MB)
|████████████████████████████████| 2.9 MB 359 kB/s
Collecting packaging
Downloading packaging-20.7-py2.py3-none-any.whl (35 kB)
Collecting babel>=1.3
Downloading Babel-2.9.0-py2.py3-none-any.whl (8.8 MB)
|████████████████████████████████| 8.8 MB 91 kB/s
Collecting sphinxcontrib-applehelp
Downloading sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl (121 kB)
|████████████████████████████████| 121 kB 578 kB/s
Requirement already satisfied, skipping upgrade: setuptools in ./lib/python3.9/site-packages (from sphinx) (49.1.3)
Collecting docutils>=0.12
Downloading docutils-0.16-py2.py3-none-any.whl (548 kB)
|████████████████████████████████| 548 kB 486 kB/s
Collecting sphinxcontrib-jsmath
Downloading sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB)
Collecting sphinxcontrib-qthelp
Downloading sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 669 kB/s
Collecting alabaster<0.8,>=0.7
Downloading alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
Collecting sphinxcontrib-serializinghtml
Downloading sphinxcontrib_serializinghtml-1.1.4-py2.py3-none-any.whl (89 kB)
|████████████████████████████████| 89 kB 608 kB/s
Collecting sphinxcontrib-htmlhelp
Downloading sphinxcontrib_htmlhelp-1.0.3-py2.py3-none-any.whl (96 kB)
|████████████████████████████████| 96 kB 1.3 MB/s
Collecting requests>=2.5.0
Downloading requests-2.25.0-py2.py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 1.2 MB/s
Collecting Jinja2>=2.3
Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
|████████████████████████████████| 125 kB 596 kB/s
Collecting sphinxcontrib-devhelp
Downloading sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl (84 kB)
|████████████████████████████████| 84 kB 814 kB/s
Collecting snowballstemmer>=1.1
Downloading snowballstemmer-2.0.0-py2.py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 1.3 MB/s
Collecting Pygments>=2.0
Downloading Pygments-2.7.3-py3-none-any.whl (950 kB)
|████████████████████████████████| 950 kB 857 kB/s
Collecting imagesize
Downloading imagesize-1.2.0-py2.py3-none-any.whl (4.8 kB)
Collecting pyparsing>=2.0.2
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
|████████████████████████████████| 67 kB 1.3 MB/s
Collecting pytz>=2015.7
Downloading pytz-2020.4-py2.py3-none-any.whl (509 kB)
|████████████████████████████████| 509 kB 864 kB/s
Collecting certifi>=2017.4.17
Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
|████████████████████████████████| 147 kB 943 kB/s
Collecting chardet<4,>=3.0.2
Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 640 kB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
|████████████████████████████████| 136 kB 1.0 MB/s
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 1.5 MB/s
Collecting MarkupSafe>=0.23
Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Building wheels for collected packages: MarkupSafe
Building wheel for MarkupSafe (setup.py) ... done
Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-py3-none-any.whl size=12629 sha256=6276383906dc30b6d61bef5ab72cce8ec95345e02de8d7fc08009693a04380e7
Stored in directory: /home/robbi/.cache/pip/wheels/e0/19/6f/6ba857621f50dc08e084312746ed3ebc14211ba30037d5e44e
Successfully built MarkupSafe
Installing collected packages: pyparsing, packaging, pytz, babel, sphinxcontrib-applehelp, docutils, sphinxcontrib-jsmath, sphinxcontrib-qthelp, alabaster, sphinxcontrib-serializinghtml, sphinxcontrib-htmlhelp, certifi, chardet, urllib3, idna, requests, MarkupSafe, Jinja2, sphinxcontrib-devhelp, snowballstemmer, Pygments, imagesize, sphinx
Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 Pygments-2.7.3 alabaster-0.7.12 babel-2.9.0 certifi-2020.12.5 chardet-3.0.4 docutils-0.16 idna-2.10 imagesize-1.2.0 packaging-20.7 pyparsing-2.4.7 pytz-2020.4 requests-2.25.0 snowballstemmer-2.0.0 sphinx-3.3.1 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-1.0.3 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.4 urllib3-1.26.2
WARNING: You are using pip version 20.2.2; however, version 20.3.1 is available.
You should consider upgrading via the '/home/robbi/Documents/workspace/python/fedoramy.github.io/bin/python -m pip install --upgrade pip' command.
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ sphinx-quickstart
Welcome to the Sphinx 3.3.1 quickstart utility.
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).
Selected root path: .
You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Separate source and build directories (y/n) [n]: y
The project name will occur in several places in the built documentation.
> Project name: Fedora Malaysia
> Author name(s): Robbi Nespu
> Project release []:
If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.
For a list of supported codes, see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language.
> Project language [en]:
Creating file /home/robbi/Documents/workspace/python/fedoramy.github.io/source/conf.py.
Creating file /home/robbi/Documents/workspace/python/fedoramy.github.io/source/index.rst.
Creating file /home/robbi/Documents/workspace/python/fedoramy.github.io/Makefile.
Creating file /home/robbi/Documents/workspace/python/fedoramy.github.io/make.bat.
Finished: An initial directory structure has been created.
You should now populate your master file /home/robbi/Documents/workspace/python/fedoramy.github.io/source/index.rst and create other documentation
source files. Use the Makefile to build the docs, like so:
make builder
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ make html
Running Sphinx v3.3.1
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in build/html.
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ pip install -U ablog
Collecting ablog
Downloading ablog-0.10.12-py3-none-any.whl (50 kB)
|████████████████████████████████| 50 kB 330 kB/s
Requirement already satisfied, skipping upgrade: docutils in ./lib/python3.9/site-packages (from ablog) (0.16)
Collecting invoke
Downloading invoke-1.4.1-py3-none-any.whl (210 kB)
|████████████████████████████████| 210 kB 469 kB/s
Collecting python-dateutil
Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
|████████████████████████████████| 227 kB 1.1 MB/s
Collecting feedgen
Downloading feedgen-0.9.0.tar.gz (217 kB)
|████████████████████████████████| 217 kB 377 kB/s
Collecting watchdog
Downloading watchdog-0.10.4.tar.gz (98 kB)
|████████████████████████████████| 98 kB 560 kB/s
Requirement already satisfied, skipping upgrade: sphinx in ./lib/python3.9/site-packages (from ablog) (3.3.1)
Collecting six>=1.5
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting lxml
Downloading lxml-4.6.2-cp39-cp39-manylinux1_x86_64.whl (5.4 MB)
|████████████████████████████████| 5.4 MB 172 kB/s
Collecting pathtools>=0.1.1
Downloading pathtools-0.1.2.tar.gz (11 kB)
Requirement already satisfied, skipping upgrade: sphinxcontrib-jsmath in ./lib/python3.9/site-packages (from sphinx->ablog) (1.0.1)
Requirement already satisfied, skipping upgrade: sphinxcontrib-serializinghtml in ./lib/python3.9/site-packages (from sphinx->ablog) (1.1.4)
Requirement already satisfied, skipping upgrade: sphinxcontrib-applehelp in ./lib/python3.9/site-packages (from sphinx->ablog) (1.0.2)
Requirement already satisfied, skipping upgrade: sphinxcontrib-qthelp in ./lib/python3.9/site-packages (from sphinx->ablog) (1.0.3)
Requirement already satisfied, skipping upgrade: packaging in ./lib/python3.9/site-packages (from sphinx->ablog) (20.7)
Requirement already satisfied, skipping upgrade: sphinxcontrib-devhelp in ./lib/python3.9/site-packages (from sphinx->ablog) (1.0.2)
Requirement already satisfied, skipping upgrade: Jinja2>=2.3 in ./lib/python3.9/site-packages (from sphinx->ablog) (2.11.2)
Requirement already satisfied, skipping upgrade: setuptools in ./lib/python3.9/site-packages (from sphinx->ablog) (49.1.3)
Requirement already satisfied, skipping upgrade: sphinxcontrib-htmlhelp in ./lib/python3.9/site-packages (from sphinx->ablog) (1.0.3)
Requirement already satisfied, skipping upgrade: imagesize in ./lib/python3.9/site-packages (from sphinx->ablog) (1.2.0)
Requirement already satisfied, skipping upgrade: alabaster<0.8,>=0.7 in ./lib/python3.9/site-packages (from sphinx->ablog) (0.7.12)
Requirement already satisfied, skipping upgrade: babel>=1.3 in ./lib/python3.9/site-packages (from sphinx->ablog) (2.9.0)
Requirement already satisfied, skipping upgrade: snowballstemmer>=1.1 in ./lib/python3.9/site-packages (from sphinx->ablog) (2.0.0)
Requirement already satisfied, skipping upgrade: Pygments>=2.0 in ./lib/python3.9/site-packages (from sphinx->ablog) (2.7.3)
Requirement already satisfied, skipping upgrade: requests>=2.5.0 in ./lib/python3.9/site-packages (from sphinx->ablog) (2.25.0)
Requirement already satisfied, skipping upgrade: pyparsing>=2.0.2 in ./lib/python3.9/site-packages (from packaging->sphinx->ablog) (2.4.7)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in ./lib/python3.9/site-packages (from Jinja2>=2.3->sphinx->ablog) (1.1.1)
Requirement already satisfied, skipping upgrade: pytz>=2015.7 in ./lib/python3.9/site-packages (from babel>=1.3->sphinx->ablog) (2020.4)
Requirement already satisfied, skipping upgrade: urllib3<1.27,>=1.21.1 in ./lib/python3.9/site-packages (from requests>=2.5.0->sphinx->ablog) (1.26.2)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in ./lib/python3.9/site-packages (from requests>=2.5.0->sphinx->ablog) (3.0.4)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in ./lib/python3.9/site-packages (from requests>=2.5.0->sphinx->ablog) (2020.12.5)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in ./lib/python3.9/site-packages (from requests>=2.5.0->sphinx->ablog) (2.10)
Building wheels for collected packages: feedgen, watchdog, pathtools
Building wheel for feedgen (setup.py) ... done
Created wheel for feedgen: filename=feedgen-0.9.0-py2.py3-none-any.whl size=44383 sha256=93a59feeb9a8298e8da1add03f0147ef1e976b51df392c9c345ca6b492254513
Stored in directory: /home/robbi/.cache/pip/wheels/f5/e1/0c/e7f6d7602caeffb70f544de8376a5e8fb966b43b4ef17860a7
Building wheel for watchdog (setup.py) ... done
Created wheel for watchdog: filename=watchdog-0.10.4-py3-none-any.whl size=74839 sha256=cd8c13dbe763053f170186ded60490845e9414fa722892573800ca6a12d9b072
Stored in directory: /home/robbi/.cache/pip/wheels/90/16/40/a17039cf4da316182497c249b987b6168c74da7f56b01ffd98
Building wheel for pathtools (setup.py) ... done
Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8784 sha256=e0ae3b85a23099357cd040eb822b66dcc41bce3d03851055024a64244bded0b9
Stored in directory: /home/robbi/.cache/pip/wheels/b7/0a/67/ada2a22079218c75a88361c0782855cc72aebc4d18d0289d05
Successfully built feedgen watchdog pathtools
Installing collected packages: invoke, six, python-dateutil, lxml, feedgen, pathtools, watchdog, ablog
Successfully installed ablog-0.10.12 feedgen-0.9.0 invoke-1.4.1 lxml-4.6.2 pathtools-0.1.2 python-dateutil-2.8.1 six-1.15.0 watchdog-0.10.4
WARNING: You are using pip version 20.2.2; however, version 20.3.1 is available.
You should consider upgrading via the '/home/robbi/Documents/workspace/python/fedoramy.github.io/bin/python -m pip install --upgrade pip' command.
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ mv ./source/conf.py ./source/conf.py.BAK
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ mv source/index.rst source/index.rst.BAK
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ ablog start
Welcome to the ABlog 0.10.12 quick start utility.
Please enter values for the following settings (just press Enter to accept a
default value, if one is given in brackets).
Enter the root path for your blog project (path has to exist).
> Root path for your project (path has to exist) [.]:
Project name will occur in several places in the website, including blog archive
pages and atom feeds. Later, you can set separate names for different parts of
the website in configuration file.
> Project name: Fedora Malaysia
This of author as the copyright holder of the content. If your blog has multiple
authors, you might want to enter a team name here. Later, you can specify
individual authors using `blog_authors` configuration option.
> Author name(s): Robbi Nespu
Please enter the base URL for your project. Blog feeds will be generated
relative to this URL. If you don't have one yet, you can set it in configuration
file later.
> Base URL for your project:
Creating file ./conf.py.
Creating file ./index.rst.
Creating file ./about.rst.
Creating file ./first-post.rst.
Finished: An initial directory structure has been created.
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ mv about.rst source/
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ mv conf.py source/
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ mv index.rst source/
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ mv first-post.rst source/
(fedoramy.github.io) [robbi@r0x fedoramy.github.io]$ make html
Running Sphinx v3.3.1
loading translations [en]... done
loading pickled environment... failed
failed: build environment version not current
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in build/html.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment