Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mdhelp: more work, copied more markdown files from tvheadend-document…
…ation
  • Loading branch information
perexg committed Apr 5, 2016
1 parent 3b0db57 commit 07eb547
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 94 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -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
Expand Down
147 changes: 56 additions & 91 deletions src/webui/static/app/ext.css
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 8 additions & 3 deletions support/doc/md_to_c.py
Expand Up @@ -139,11 +139,13 @@ def paragraph(self, text):

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):
Expand All @@ -158,8 +160,11 @@ def list_item(self, text):
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 = ''
Expand Down

0 comments on commit 07eb547

Please sign in to comment.