summaryrefslogtreecommitdiffstats
path: root/doxygen/siphon-process
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2016-10-05 15:45:19 -0400
committerChris Luke <chris_luke@comcast.com>2016-11-28 18:23:35 +0000
commitc3f92adf6be41263eb466e074e4136d29b50b59a (patch)
tree7eecad6aa039bb8a2f6ec5b068d6be9914a8815b /doxygen/siphon-process
parent39f9973f89fe6d44ee3be5d1dd4457d20530d4aa (diff)
Add support for using documentation siphons in multiple ways
Experiental support for generating multiple output formats from the same siphoned data. Adds a contrived example to generate a plain list of all CLI commands (the "itemlist" format). Eventually we can consider moving the tempate procesisng into the Output class as well as a way to override how the data is traversed (ordered). Change-Id: I77629a74a8fa0c7e583993469dc50491f72f13e7 Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'doxygen/siphon-process')
-rwxr-xr-xdoxygen/siphon-process6
1 files changed, 5 insertions, 1 deletions
diff --git a/doxygen/siphon-process b/doxygen/siphon-process
index ea9df96fe26..698da8828e1 100755
--- a/doxygen/siphon-process
+++ b/doxygen/siphon-process
@@ -23,6 +23,7 @@ import siphon
DEFAULT_LOGFILE = None
DEFAULT_LOGLEVEL = "info"
DEFAULT_SIPHON ="clicmd"
+DEFAULT_FORMAT = "markdown"
DEFAULT_OUTPUT = None
DEFAULT_TEMPLATES = os.path.dirname(__file__) + "/siphon_templates"
@@ -36,6 +37,9 @@ ap.add_argument("--log-level", default=DEFAULT_LOGLEVEL,
ap.add_argument("--type", '-t', metavar="siphon_type", default=DEFAULT_SIPHON,
choices=siphon.process.siphons.keys(),
help="Siphon type to process [%s]" % DEFAULT_SIPHON)
+ap.add_argument("--format", '-f', default=DEFAULT_FORMAT,
+ choices=siphon.process.formats.keys(),
+ help="Output format to generate [%s]" % DEFAULT_FORMAT)
ap.add_argument("--output", '-o', metavar="file", default=DEFAULT_OUTPUT,
help="Output file (uses stdout if not defined) [%s]" % DEFAULT_OUTPUT)
ap.add_argument("--templates", metavar="directory", default=DEFAULT_TEMPLATES,
@@ -56,7 +60,7 @@ else:
# Get our processor
klass = siphon.process.siphons[args.type]
-processor = klass(template_directory=args.templates)
+processor = klass(template_directory=args.templates, format=args.format)
# Load the input files
processor.load_json(args.input)