~javiljoen/ebk-find

67cbf06ca2955d30a11a0cf6ba5a21d6950349a5 — JA Viljoen 7 months ago d6f34ff
docs: add logo to first page
2 files changed, 11 insertions(+), 0 deletions(-)

M docs/www/style.css
M scripts/md2html.py
M docs/www/style.css => docs/www/style.css +3 -0
@@ 25,6 25,9 @@ nav > a:first-child {
footer {
  padding: 0 1ch;
}
#logo {
  padding-right: 1ch
}
#gif + figcaption {
  display: none;
}

M scripts/md2html.py => scripts/md2html.py +8 -0
@@ 63,6 63,10 @@ class Markdown:

    def render(self, toc, meta):
        main = self.to_html().fix_refs()

        if self.name == "index":
            main = main.insert_logo(self.title)

        title = (
            self.title + " documentation"
            if self.name == "index"


@@ 101,6 105,10 @@ class HTML:
    def inject(self, **kwargs):
        return HTML(self.s.format(**kwargs))

    def insert_logo(self, title):
        img = '<img src="logo.svg" id="logo" height="20" alt="Ebookrack logo" />'
        return HTML(self.s.replace(title, img + "<wbr />" + title, 1))


DOC = """\
<!DOCTYPE html>