diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-04-22 09:10:58 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-04-22 09:10:58 -0600 |
commit | e044e9c90a7eab7406a31831b3c661a80eb05b17 (patch) | |
tree | fff4add300ed8ffe4b704012c92f22a30e385b33 /nuttx/tools | |
parent | 11278c31a01b6fdfb09e2a3109a20d38ef793055 (diff) | |
download | px4-nuttx-e044e9c90a7eab7406a31831b3c661a80eb05b17.tar.gz px4-nuttx-e044e9c90a7eab7406a31831b3c661a80eb05b17.tar.bz2 px4-nuttx-e044e9c90a7eab7406a31831b3c661a80eb05b17.zip |
New Kconfig convention: Extra indentation in comments will render as HTML preformatted text
Diffstat (limited to 'nuttx/tools')
-rw-r--r-- | nuttx/tools/kconfig2html.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/nuttx/tools/kconfig2html.c b/nuttx/tools/kconfig2html.c index 05e09663d..dc22e7efb 100644 --- a/nuttx/tools/kconfig2html.c +++ b/nuttx/tools/kconfig2html.c @@ -1100,10 +1100,13 @@ static inline void process_help(FILE *stream) bool blank; bool done; bool newpara; + bool preformatted; /* Read each comment line */ newpara = true; + preformatted = false; + for (;;) { /* Read the next line of comment text */ @@ -1165,7 +1168,7 @@ static inline void process_help(FILE *stream) if (!newpara) { - body("</p>\n"); + body("\n</p>\n"); newpara = true; } @@ -1193,16 +1196,45 @@ static inline void process_help(FILE *stream) if (newpara) { - body("</p>\n"); + body("<p>\n"); newpara = false; } - body(" %s", htmlize_text(ptr)); + /* Lines that are indented at greater levels are assumed to be + * pre-formatted text. This is not part of the Kconfig language but + * rather simply a NuttX Kconfig convention. + */ + + if (indent > help_indent) + { + if (!preformatted) + { + body("\n <ul><pre>\n"); + preformatted = true; + } + + body("%s\n", htmlize_text(ptr)); + } + else + { + if (preformatted) + { + body("</pre></ul>\n"); + preformatted = false; + } + + body(" %s", htmlize_text(ptr)); + } } if (!newpara) { - body("</p>\n"); + body("\n</p>\n"); + } + + if (preformatted) + { + body("</pre></ul>\n"); } } @@ -1761,7 +1793,7 @@ static inline char *process_choice(FILE *stream, const char *kconfigdir) const char *paranum; char *token = NULL; char *ptr; - bool help; + bool help = false; int i; /* Get the choice information */ |