From c3f92adf6be41263eb466e074e4136d29b50b59a Mon Sep 17 00:00:00 2001 From: Chris Luke Date: Wed, 5 Oct 2016 15:45:19 -0400 Subject: 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 --- doxygen/siphon-process | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doxygen/siphon-process') diff --git a/doxygen/siphon-process b/doxygen/siphon-process index ea9df96f..698da882 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) -- cgit 1.2.3-korg