From: Jaroslav Kysela Date: Tue, 5 Apr 2016 09:30:56 +0000 (+0200) Subject: mdhelp: more work, copied more markdown files from tvheadend-documentation X-Git-Tag: v4.2.1~740 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07eb547b10306b3602d7398b818f84e39838c6ac;p=thirdparty%2Ftvheadend.git mdhelp: more work, copied more markdown files from tvheadend-documentation --- diff --git a/Makefile b/Makefile index e5e4a2048..576c41c18 100644 --- a/Makefile +++ b/Makefile @@ -696,6 +696,8 @@ src/docs_inc.c: $(BUILDDIR)/docs-timestamp src/docs_inc.h: $(BUILDDIR)/docs-timestamp +src/docs.c: src/docs_inc.c src/docs_inc.h + $(BUILDDIR)/src/docs.o: $(BUILDDIR)/docs-timestamp $(I18N-DOCS) support/doc/md_to_c.py # Internationalization diff --git a/src/webui/static/app/ext.css b/src/webui/static/app/ext.css index f9462b1ed..dc2082f11 100644 --- a/src/webui/static/app/ext.css +++ b/src/webui/static/app/ext.css @@ -773,18 +773,27 @@ } .hts-doc-text p { + margin-left: 1em; margin-top: 1em; margin-bottom: 1em; - margin-left: 1em } .hts-doc-text h2, h3, h4 { + margin-top: 1em; + margin-bottom: 1em; font-size: larger } .hts-doc-text h4 { + margin-top: 1em; + margin-bottom: 1em; + color: #2163A6; +} + +.hts-doc-text h5 { + margin-top: .7em; + margin-bottom: .7em; color: #2163A6; - margin-top: 15px } .hts-doc-text strong { @@ -812,6 +821,11 @@ padding-bottom: 10px; } +.hts-doc-text ol { + list-style-type: arabic; + padding-left:3em +} + .hts-doc-text li { padding-top: 5px; padding-bottom: 5px; @@ -827,6 +841,46 @@ padding-bottom: 0px } +/* Additional image and caption styles for webUI help */ + +.hts-doc-text img { + margin: 0px auto; + /* display: block; */ + border: none; + padding: 10px; + max-width: 97% +} + +.hts-doc-text p.caption { + font-weight: bold; + color: #2163A6; + font-style: italic; + text-align: center; + text-decoration: underline +} + +/* Inline/block code styles for webUI help */ + +.hts-doc-text code { + background-color: white; + border-color: #E1E4E5; + border-style: solid; + border-width: 1px; + color: darkred; + font-family: 'Courier New', Courier, monospace; + margin-left: 2em; + padding-bottom: 0px; + padding-left: 5px; + padding-right: 5px; + padding-top: 0px; + display: inline-block; +} + +.hts-doc-text p code { + margin-left: 0; + display: initial; +} + /* Styles for help TOC */ .hts-doc-toc { @@ -891,95 +945,6 @@ padding-bottom: 0px } -/* Additional image and caption styles for webUI help */ - -.hts-doc-text img { - margin: 0px auto; - /* display: block; */ - border: none; - padding: 10px; - max-width: 97% -} - -.hts-doc-text p.caption { - font-weight: bold; - color: #2163A6; - font-style: italic; - text-align: center; - text-decoration: underline -} - -/* Inline/block code styles for webUI help */ - -.hts-doc-text code { - background-color: white; - border-color: #E1E4E5; - border-style: solid; - border-width: 1px; - color: darkred; - font-family: 'Courier New', Courier, monospace; - padding-bottom: 0px; - padding-left: 5px; - padding-right: 5px; - padding-top: 0px; -} - -/* Admonition styles for webUI help */ - -.hts-doc-text .admonition { - margin: 20px; - border: 0px solid; - border-left-width: 5px; - padding-top: 0px;padding-bottom: 5px -} - -.hts-doc-text .admonition-title { - font-size: larger; - font-weight: bolder; - padding-top: 5px;padding-bottom: 5px; - margin: 0px -} - -.hts-doc-text .admonition.note { - background-color: #D6EBFF; - border-left-color: #4575A6 -} - -.hts-doc-text .admonition.note .admonition-title { - background-color: #4575A6; - color: white -} - -.hts-doc-text .admonition.tip { - background-color: #CDF1E9; - border-left-color: #1ABC9C -} - -.hts-doc-text .admonition.tip .admonition-title { - background-color: #1ABC9C; - color: white -} - -.hts-doc-text .admonition.warning { - background-color: #FFD0B0; - border-left-color: #FF9147 -} - -.hts-doc-text .admonition.warning .admonition-title { - background-color: #FF9147; - color: white -} - -.hts-doc-text .admonition.danger { - background-color: #E8AFAF; - border-left-color: #FF3333 -} - -.hts-doc-text .admonition.danger .admonition-title { - background-color: #FF3333; - color: white -} - .tv-video-idle { background-image : url(../../static/img/logobig.png); background-repeat : no-repeat; diff --git a/support/doc/md_to_c.py b/support/doc/md_to_c.py index f96779cfc..f35c465c9 100755 --- a/support/doc/md_to_c.py +++ b/support/doc/md_to_c.py @@ -139,11 +139,13 @@ class TVH_C_Renderer(Renderer): def list(self, text, ordered=True): r = '\n' + idx = 1 while text: text, type, t = self.get_block(text) if DEBUG: debug('list[' + type + ']: ' + repr(t)) if type == 'l': - r += self.get_nolang(ordered and '# ' or '* ') + t + r += self.get_nolang(ordered and str(idx) + '. ' or '* ') + t + if ordered: idx += 1 return r def list_item(self, text): @@ -158,8 +160,11 @@ class TVH_C_Renderer(Renderer): return 'l' + str(len(text)) + ':' + text def block_code(self, code, lang=None): - return self.get_nolang('```no-highlight') + '\n' + \ - code + '\n' + self.get_nolang('```') + '\n' + if DEBUG: debug('block code: ' + repr(code)) + r = self.get_nolang('```no-highlight') + '\n' + for line in code.splitlines(): + r += self.get_nolang(line) + '\n' + return r + self.get_nolang('```') + '\n' def block_quote(self, text): r = ''