Skip to content

Feature/issue 95 update mktools #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 36 additions & 46 deletions custom-theme/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid">
<div class="md-flex">
<div class="md-flex__cell md-flex__cell--shrink">
<a href="{{ config.site_url | default(nav.homepage.url, true) }}" title="{{ config.site_name }}" class="md-header-nav__button md-logo">
{% if config.theme.logo.icon %}
<i class="md-icon">{{ config.theme.logo.icon }}</i>
{% elif config.theme.logo.startswith("http") %}
<img src="{{ config.theme.logo }}" height="21">
{% else %}
<img src="{{ base_url }}/{{ config.theme.logo }}" height="21">
{% endif %}
</a>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">
<a href="{{ config.site_url | default(nav.homepage.url, true) | url }}" title="{{ config.site_name }} Version {{ config.extra.guideline_version }}" class="md-header-nav__button md-logo" aria-label="{{ config.site_name }}">
{% include "partials/logo.html" %}
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
</label>
<div class="md-header-nav__title" data-md-component="header-title">
{% if config.site_name == page.title %}
<div class="md-header-nav__ellipsis md-ellipsis">
{{ config.site_name }} Version {{ config.extra.guideline_version }}
</div>
<div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
{% block site_name %}
{% if config.site_name == page.title %}
{{ config.site_name }} Version {{ config.extra.guideline_version }}
{% else %}
<span class="md-header-nav__topic">
{{ config.site_name }} Version {{ config.extra.guideline_version }}
</span>
<span class="md-header-nav__topic">
{{ page.title }}
</span>
{% endif %}
{% endblock %}
</div>
</div>
<div class="md-flex__cell md-flex__cell--shrink">
{% block search_box %}
{% if "search" in config["plugins"] %}
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
{% include "partials/search.html" %}
{% else %}
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
{{ config.site_name }} Version {{ config.extra.guideline_version }}
</span>
<span class="md-header-nav__topic md-ellipsis">
{% if page and page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
{% endblock %}
</span>
</div>
{% if config.repo_url %}
<div class="md-flex__cell md-flex__cell--shrink">
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
</div>
{% endif %}
{% endif %}
</div>
{% if "search" in config["plugins"] %}
<label class="md-header-nav__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
</label>
{% include "partials/search.html" %}
{% endif %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
</nav>
</header>
{% endif %}
</nav>
</header>
36 changes: 17 additions & 19 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
FROM centos:7.6.1810
FROM centos:8

LABEL maintainer="[email protected]"
LABEL description="Tools to generate HTML and PDF using Materials for MkDocs and wkhtmltopdf."
LABEL build.command="docker build . --tag trivadis/mktools:latest"

# install python, not part of centos
# see https://www.osetc.com/en/how-to-install-the-latest-python-3-3-6-x-3-7-x-on-centos-7-or-rhel-7.html
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm
RUN yum update -y
RUN yum install -y python36u python36u-libs python36u-devel python36u-pip

# install git and wget
# see https://computingforgeeks.com/how-to-install-python-on-3-on-centos/
RUN yum -y update
RUN yum -y groupinstall "Development Tools"
RUN yum -y install openssl-devel bzip2-devel libffi-devel
RUN yum -y install wget
RUN wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
RUN tar xvf Python-3.8.3.tgz
RUN /bin/bash -c 'cd Python-3.8*/; ./configure --enable-optimizations; make altinstall'

# install git
RUN yum install -y git
RUN yum install -y wget

# install wkhtmltox 0.12.4 since 0.12.5 cannot create TOCs, see https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3995
# RUN yum install -y https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
RUN yum install -y yum install -y wkhtmltopdf
RUN wget -q https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -O /tmp/wkhtmltox.tar.xz && \
tar xvf /tmp/wkhtmltox.tar.xz -C /tmp && \
cp -rp /tmp/wkhtmltox/* /usr/local && \
rm -rf /tmp/wkhtmltox*

# install python modules (most recent versions)
RUN pip3.6 install --upgrade pip
RUN pip3.6 install mkdocs \
RUN pip3.8 install --upgrade pip
RUN pip3.8 install mkdocs \
mkdocs-material \
mkdocs-awesome-pages-plugin \
pymdown-extensions \
mike

ENV LC_ALL=en_US.utf8
# install wkhtmltox 0.12.6
RUN yum install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm

# set environment
ENV LANG=en_US.utf8

# volume for GitHub project's root folder containing docs folder
Expand Down
138 changes: 126 additions & 12 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/* fix logo size */
.md-header-nav__button.md-logo img, .md-header-nav__button.md-logo svg {
width: auto;
height: 21px;
}

/* fix image border */
.md-typeset img[align=left], .md-typeset svg[align=left] {
margin: auto;
}

.md-typeset a {
color: #ff1744;
word-break: break-word;
Expand All @@ -10,6 +21,7 @@
text-decoration: underline;
}

.md-nav__item
.md-nav__link--active,
.md-nav__link:active {
color: #ff1744;
Expand All @@ -29,8 +41,20 @@
word-break: keep-all;
}

.md-typeset a {
color: #ff1744;
word-break: break-word;
}


/* fixing colors because wkhtmltopdf does not understand colors such as "var(--md-typeset-a-color);" */
@media print {

/* fix image size */
.md-typeset img, .md-typeset svg {
zoom: 80%;
}

/* disable menu */
.md-md-header {
display: none;
Expand All @@ -41,23 +65,111 @@
display: none;
}

/* fix font size of normal text */
.md-typeset {
font-size: 10pt;
}

/* fix font size of text in tables */
.md-typeset table:not([class]) {
font-size: 8pt;
}

/* fix colors of table headers */
.md-typeset table:not([class]) th {
color: white;
background-color: rgba(0, 0, 0, 0.54);
min-width: 60pt;
}

/* fix color of footnote and font */
.md-typeset .footnote {
color: black;
font-size: 8pt;
}

/* fix font of code in footnote */
.md-typeset .footnote code {
font-size: 8pt;
}

/* hide footnode link */
.md-typeset .footnote-backref::before {
display: none;
}

/* fix code background color */
.md-typeset code {
font-size: 8pt;
background-color: whitesmoke;
}

/* fix code foreground color */
.md-typeset code, .md-typeset pre, .md-typeset kbd {
color: #36464e;
}

/* fix code color for line numbers */
.highlighttable .linenodiv pre {
color: rgba(0, 0, 0, 0.54);
text-align: right;
}

/* fix settings for line numbers */
.highlighttable .linenos {
padding: 6pt 6pt;
font-size: 8pt;
background-color: rgba(0,0,0,.07);
}

/* fix code highlighting colors */
.codehilite .k, .highlight .k, .codehilite .kd, .highlight .kd, .codehilite .kn, .highlight .kn, .codehilite .kp, .highlight .kp, .codehilite .kr, .highlight .kr, .codehilite .kt, .highlight .kt {
color: #3f6ec6;
}
.codehilite .kc, .highlight .kc, .codehilite .n, .highlight .n {
color: #36464e;
}
.codehilite .p, .highlight .p {
color: rgba(0, 0, 0, 0.54);
}
.codehilite .o, .highlight .o, .codehilite .ow, .highlight .ow {
color: rgba(0, 0, 0, 0.54);
}
.codehilite .c, .highlight .c, .codehilite .cm, .highlight .cm, .codehilite .c1, .highlight .c1, .codehilite .ch, .highlight .ch, .codehilite .cs, .highlight .cs, .codehilite .sd, .highlight .sd {
color: rgba(0, 0, 0, 0.54)
}
.codehilite .m, .highlight .m, .codehilite .mf, .highlight .mf, .codehilite .mh, .highlight .mh, .codehilite .mi, .highlight .mi, .codehilite .il, .highlight .il, .codehilite .mo, .highlight .mo {
color: #d52a2a;
}
.codehilite .cpf, .highlight .cpf, .codehilite .l, .highlight .l, .codehilite .s, .highlight .s, .codehilite .sb, .highlight .sb, .codehilite .sc, .highlight .sc, .codehilite .s2, .highlight .s2, .codehilite .si, .highlight .si, .codehilite .s1, .highlight .s1, .codehilite .ss, .highlight .ss {
color: #1c7d4d;
}
.codehilite .no, .highlight .no, .codehilite .nb, .highlight .nb, .codehilite .bp, .highlight .bp {
color: #6e59d9;
}

/* add space between line numbers and code */
span.linenos {
padding-right: 12pt;
}

/* fix background color in body */
body {
background-color: white;
}

/* fix row seperators */
.md-typeset table:not([class]) td {
padding: .6rem .8rem;
border-top: .05rem solid rgba(0,0,0,.07);
vertical-align: top;
}

/* do not show link details in brackets content: " [" attr(href) "]" */
.md-typeset a:after {
display: none;
}

/* disable scrollbar */
.md-typeset__scrollwrap,
.md-typeset table:not([class]),
.md-typeset
.md-typeset__table table,
.md-container,
.md-main,
html {
overflow-x: hidden;
-webkit-overflow-scrolling: hidden
}

/* table-header-group leads to overlap with content */
thead {
display: table-row-group;
Expand All @@ -75,6 +187,8 @@
page-break-before: avoid;
}

[id="severity-of-the-rule"],
[id="keywords-used"],
[id="we-do-not-agree-with-all-your-standards"],
[id="column"],
[id="function"],
Expand Down
10 changes: 5 additions & 5 deletions docs/stylesheets/toc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
h1 {
text-align: center;
font-size: 20px;
font-size: 16px;
}
div {
border-bottom: 1px dashed rgb(200,200,200);
Expand All @@ -27,24 +27,24 @@
}
li {
list-style: none;
padding-top: 20px;
padding-top: 16px;
}
li li {
padding-top: 5px;
padding-top: 4px;
}
li li li {
padding-top: 0px;
}
ul {
font-size: 20px;
font-size: 16px;
padding-left: 0em;
}
ul ul {
font-size: 80%;
padding-left: 1em;
}
ul ul ul ul {
font-size: 12.8px;
font-size: 10px;
margin-top: 0px;
margin-bottom: 0px;
}
Expand Down
13 changes: 9 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ repo_url: https://github.com/trivadis/plsql-and-sql-coding-guidelines
edit_uri: ""

theme:
logo: images/trivadis-logo.svg
icon:
repo: fontawesome/brands/github-alt
name: 'material'
custom_dir: custom-theme
logo: images/trivadis-logo.svg
favicon: images/favicon.ico
palette:
primary: 'white'
Expand All @@ -22,17 +24,20 @@ extra_javascript:

markdown_extensions:
- admonition
- codehilite:
- pymdownx.highlight:
linenums: true
linenums_style: table
- pymdownx.superfences
- pymdownx.inlinehilite
- pymdownx.arithmatex
- footnotes

extra:
guideline_version: 4.0-SNAPSHOT
social:
- type: github-alt
- icon: fontawesome/brands/github-alt
link: https://github.com/Trivadis
- type: twitter
- icon: fontawesome/brands/twitter
link: https://twitter.com/trivadis

plugins:
Expand Down
Loading