2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Modify the create_man_page script to generate the files into

the man1,man3,man5,man8 subdirectories.  Created the index file to
display a glob of the generated rst files
This commit is contained in:
Victor Hu 2015-10-23 22:39:39 -04:00
parent 8b72f41df0
commit b6b8a5d50c
6 changed files with 52 additions and 9 deletions

View File

@ -4,6 +4,8 @@ import glob
import os
import sys
import subprocess
from glob import glob
import shutil
#TODO: Delete the old files to support removing a man page
@ -18,6 +20,18 @@ if not cmd_exists("pod2rst"):
# the location relativate to xcat-core where the man pages will go
MANPAGE_DEST="./docs/source/guides/admin-guides/references/man"
#
# add the following to delete the generate files before creating them
# essentially this allows us to remove man pages and they will be
# removed in the generation
print "Cleaning up the generated man pages in %s" %(MANPAGE_DEST)
allfiles = glob("%s*/*.rst" %(MANPAGE_DEST))
for d in allfiles:
# Skip over the index.rst file
if not "index.rst" in d:
print "Removing file %s" %(d)
os.remove(d)
# List the xCAT component directory which contain pod pages
COMPONENTS = ['xCAT-SoftLayer', 'xCAT-test', 'xCAT-client', 'xCAT-vlan']
@ -35,14 +49,7 @@ for component in COMPONENTS:
# title is needed to pass to pod2rst
title = filename.split('.')[0]
#
# Wanted to have DESTINATION contain the man version,
# but we currently have man1,man3,man5,man8, etc in
# the .gitignore file. Need to fix Ubuntu builds
#
# DESTINATION = "%s%s" %(MANPAGE_DEST, man_ver)
#
DESTINATION = "%s" %(MANPAGE_DEST)
DESTINATION = "%s%s" %(MANPAGE_DEST, man_ver)
try:
os.stat(DESTINATION)
except:

View File

@ -13,7 +13,10 @@ xCAT Man Pages
:maxdepth: 1
:glob:
man/*
man1/index.rst
man3/index.rst
man5/index.rst
man8/index.rst
xCAT Database Tables

View File

@ -0,0 +1,9 @@
man1
====
.. toctree::
:maxdepth: 1
:glob:
*

View File

@ -0,0 +1,8 @@
man3
====
.. toctree::
:maxdepth: 1
:glob:
*

View File

@ -0,0 +1,8 @@
man5
====
.. toctree::
:maxdepth: 1
:glob:
*

View File

@ -0,0 +1,8 @@
man8
====
.. toctree::
:maxdepth: 1
:glob:
*