# Generate clicmd formatted output
from . import process, parsers
-
+import os
class SiphonCLICMD(process.Siphon):
# Output renderers
+ def separate_page_names(self, group):
+ return self.page_label(group) + ".rst"
+
def index_sort_key(self, group):
_global = self._cmds['_global']
if group not in self._group:
self.sanitize_label(self._cmds[group][item]['value']['path'])
))
+ def page_title(self, group):
+ _global = self._cmds['_global']
+ (directory, file) = self._group[group]
+
+ if file and file in _global and 'group_label' in _global[file]:
+ return _global[file]['group_label']
+
+ if directory in _global and 'group_label' in _global[directory]:
+ return _global[directory]['group_label']
+
+ file_ext = os.path.basename(directory)
+ fname, ext = os.path.splitext(file_ext)
+ return "%s cli reference" % fname.capitalize()
+
# Register our processor
process.siphons["clicmd"] = SiphonCLICMD