Add reDocs GUI support (#1117)

* Adding support for reDocs GUI to Clear Linux Docs repo.

1. Added .tox and MANIFEST to .gitignore
2. Added py rule to make.bat to enable building of bundles.html.txt in Windows
3. Added .tox to exclude_patterns in conf.py
4. Added tox.ini and setup.py support files to project.

Signed-off-by: Kevin Putnam <kevin.putnam@intel.com>

* Updated setup.py with Clear Linux docs info.

Signed-off-by: Kevin Putnam <kevin.putnam@intel.com>

* Small adjustment.

Signed-off-by: Kevin Putnam <kevin.putnam@intel.com>
This commit is contained in:
Kevin Putnam
2020-05-12 17:45:00 -07:00
committed by GitHub
parent 179a464571
commit aa214223a5
6 changed files with 43 additions and 3 deletions

4
.gitignore vendored
View File

@@ -18,6 +18,10 @@ bundles.html.txt
# ignore the venv, used for running make py
venv
#ignore for reDocs GUI
.tox
MANIFEST
# ignore artifacts of man page generation
source/_scripts/_python/manpages/*.rst
source/reference/manpages

View File

@@ -5,6 +5,8 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SCRIPTDIR=source\_scripts\_python
set BUILDDIR=source\_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
set I18NSPHINXOPTS=%SPHINXOPTS% source
@@ -81,6 +83,16 @@ if "%1" == "html" (
goto end
)
if "%1" == "py" (
cd %SCRIPTDIR%
python.exe bundle_lister.py
copy bundles.html.txt ..\..\reference\bundles
for /d %%i in (cloned_repo\*) do rmdir /q /s %%i
del /q /s bundles.html.txt
echo "Python bundle script finished successfully!"
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1

11
setup.py Normal file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env python
from distutils.core import setup
setup(name='Clear Linux Documentation',
version='',
description='Sphinx build of Clear Linux documentation',
author='Many',
author_email='kevin.putnam@intel.com',
url='https://github.com/clearlinux/clear-linux-documentation/',
)

View File

@@ -138,7 +138,7 @@ def updateManPages():
#makeSeeAlsoReplacements()
for file in manFiles:
manFile = ""
with open(file,'r') as f:
with open(file,'r',encoding="utf8") as f:
manFile = f.read()
#manFile = addTOC(manFile,file) # Not convinced adding TOC adds value.
#
@@ -153,7 +153,7 @@ def updateManPages():
manFile = manFile.replace(perm,buildManName(nameAndSection[0],nameAndSection[1]))
for manName, doNotUse in manNamePerms.items():
manFile = manFile.replace(buildManName(manName[0],manName[1]),linkToMan(manName[0],manName[1]))
with open(file,'w') as w:
with open(file,'w',encoding="utf8") as w:
w.write(manFile)
def addTOC(manContent,file):

View File

@@ -81,7 +81,7 @@ language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build','_themes','_scripts']
exclude_patterns = ['_build','_themes','.tox','_scripts']
# The reST default role (used for this markup: `text`) to use for all
# documents.

13
tox.ini Normal file
View File

@@ -0,0 +1,13 @@
[tox]
envlist = py3-{mylinux,mywindows}
[testenv]
platform = mylinux: linux
mywindows: win32
whitelist_externals = make.bat
/usr/bin/make
deps = -rrequirements.txt
commands =
mylinux: make {posargs}
mywindows: make.bat {posargs}