mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-27 01:15:34 +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:
		| @@ -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: | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -0,0 +1,9 @@ | ||||
| man1 | ||||
| ==== | ||||
|  | ||||
|  | ||||
| .. toctree:: | ||||
|    :maxdepth: 1 | ||||
|    :glob: | ||||
|  | ||||
|    * | ||||
| @@ -0,0 +1,8 @@ | ||||
| man3 | ||||
| ==== | ||||
|  | ||||
| .. toctree:: | ||||
|    :maxdepth: 1 | ||||
|    :glob: | ||||
|  | ||||
|    * | ||||
| @@ -0,0 +1,8 @@ | ||||
| man5 | ||||
| ==== | ||||
|  | ||||
| .. toctree:: | ||||
|    :maxdepth: 1 | ||||
|    :glob: | ||||
|  | ||||
|    * | ||||
| @@ -0,0 +1,8 @@ | ||||
| man8 | ||||
| ==== | ||||
|  | ||||
| .. toctree:: | ||||
|    :maxdepth: 1 | ||||
|    :glob: | ||||
|  | ||||
|    * | ||||
		Reference in New Issue
	
	Block a user