Skip to content

Commit 74ee439

Browse files
Merge pull request #96 from Trivadis/feature/issue-95-update-mktools
Feature/issue 95 update mktools
2 parents e8042bd + 2dcfcbe commit 74ee439

File tree

11 files changed

+215
-93
lines changed

11 files changed

+215
-93
lines changed

custom-theme/partials/header.html

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,41 @@
11
<header class="md-header" data-md-component="header">
2-
<nav class="md-header-nav md-grid">
3-
<div class="md-flex">
4-
<div class="md-flex__cell md-flex__cell--shrink">
5-
<a href="{{ config.site_url | default(nav.homepage.url, true) }}" title="{{ config.site_name }}" class="md-header-nav__button md-logo">
6-
{% if config.theme.logo.icon %}
7-
<i class="md-icon">{{ config.theme.logo.icon }}</i>
8-
{% elif config.theme.logo.startswith("http") %}
9-
<img src="{{ config.theme.logo }}" height="21">
10-
{% else %}
11-
<img src="{{ base_url }}/{{ config.theme.logo }}" height="21">
12-
{% endif %}
13-
</a>
14-
</div>
15-
<div class="md-flex__cell md-flex__cell--shrink">
16-
<label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
2+
<nav class="md-header-nav md-grid" aria-label="{{ lang.t('header.title') }}">
3+
<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 }}">
4+
{% include "partials/logo.html" %}
5+
</a>
6+
<label class="md-header-nav__button md-icon" for="__drawer">
7+
{% include ".icons/material/menu" ~ ".svg" %}
8+
</label>
9+
<div class="md-header-nav__title" data-md-component="header-title">
10+
{% if config.site_name == page.title %}
11+
<div class="md-header-nav__ellipsis md-ellipsis">
12+
{{ config.site_name }} Version {{ config.extra.guideline_version }}
1713
</div>
18-
<div class="md-flex__cell md-flex__cell--stretch">
19-
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
20-
{% block site_name %}
21-
{% if config.site_name == page.title %}
22-
{{ config.site_name }} Version {{ config.extra.guideline_version }}
23-
{% else %}
24-
<span class="md-header-nav__topic">
25-
{{ config.site_name }} Version {{ config.extra.guideline_version }}
26-
</span>
27-
<span class="md-header-nav__topic">
28-
{{ page.title }}
29-
</span>
30-
{% endif %}
31-
{% endblock %}
32-
</div>
33-
</div>
34-
<div class="md-flex__cell md-flex__cell--shrink">
35-
{% block search_box %}
36-
{% if "search" in config["plugins"] %}
37-
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
38-
{% include "partials/search.html" %}
14+
{% else %}
15+
<div class="md-header-nav__ellipsis">
16+
<span class="md-header-nav__topic md-ellipsis">
17+
{{ config.site_name }} Version {{ config.extra.guideline_version }}
18+
</span>
19+
<span class="md-header-nav__topic md-ellipsis">
20+
{% if page and page.meta and page.meta.title %}
21+
{{ page.meta.title }}
22+
{% else %}
23+
{{ page.title }}
3924
{% endif %}
40-
{% endblock %}
25+
</span>
4126
</div>
42-
{% if config.repo_url %}
43-
<div class="md-flex__cell md-flex__cell--shrink">
44-
<div class="md-header-nav__source">
45-
{% include "partials/source.html" %}
46-
</div>
47-
</div>
48-
{% endif %}
27+
{% endif %}
28+
</div>
29+
{% if "search" in config["plugins"] %}
30+
<label class="md-header-nav__button md-icon" for="__search">
31+
{% include ".icons/material/magnify.svg" %}
32+
</label>
33+
{% include "partials/search.html" %}
34+
{% endif %}
35+
{% if config.repo_url %}
36+
<div class="md-header-nav__source">
37+
{% include "partials/source.html" %}
4938
</div>
50-
</nav>
51-
</header>
39+
{% endif %}
40+
</nav>
41+
</header>

docker/Dockerfile

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
1-
FROM centos:7.6.1810
1+
FROM centos:8
22

33
LABEL maintainer="philipp.salvisberg@trivadis.com"
44
LABEL description="Tools to generate HTML and PDF using Materials for MkDocs and wkhtmltopdf."
55
LABEL build.command="docker build . --tag trivadis/mktools:latest"
66

77
# install python, not part of centos
8-
# 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
9-
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm
10-
RUN yum update -y
11-
RUN yum install -y python36u python36u-libs python36u-devel python36u-pip
12-
13-
# install git and wget
8+
# see https://computingforgeeks.com/how-to-install-python-on-3-on-centos/
9+
RUN yum -y update
10+
RUN yum -y groupinstall "Development Tools"
11+
RUN yum -y install openssl-devel bzip2-devel libffi-devel
12+
RUN yum -y install wget
13+
RUN wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
14+
RUN tar xvf Python-3.8.3.tgz
15+
RUN /bin/bash -c 'cd Python-3.8*/; ./configure --enable-optimizations; make altinstall'
16+
17+
# install git
1418
RUN yum install -y git
15-
RUN yum install -y wget
16-
17-
# install wkhtmltox 0.12.4 since 0.12.5 cannot create TOCs, see https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3995
18-
# RUN yum install -y https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
19-
RUN yum install -y yum install -y wkhtmltopdf
20-
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 && \
21-
tar xvf /tmp/wkhtmltox.tar.xz -C /tmp && \
22-
cp -rp /tmp/wkhtmltox/* /usr/local && \
23-
rm -rf /tmp/wkhtmltox*
2419

2520
# install python modules (most recent versions)
26-
RUN pip3.6 install --upgrade pip
27-
RUN pip3.6 install mkdocs \
21+
RUN pip3.8 install --upgrade pip
22+
RUN pip3.8 install mkdocs \
2823
mkdocs-material \
2924
mkdocs-awesome-pages-plugin \
3025
pymdown-extensions \
3126
mike
3227

33-
ENV LC_ALL=en_US.utf8
28+
# install wkhtmltox 0.12.6
29+
RUN yum install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm
30+
31+
# set environment
3432
ENV LANG=en_US.utf8
3533

3634
# volume for GitHub project's root folder containing docs folder

docs/stylesheets/extra.css

Lines changed: 126 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/* fix logo size */
2+
.md-header-nav__button.md-logo img, .md-header-nav__button.md-logo svg {
3+
width: auto;
4+
height: 21px;
5+
}
6+
7+
/* fix image border */
8+
.md-typeset img[align=left], .md-typeset svg[align=left] {
9+
margin: auto;
10+
}
11+
112
.md-typeset a {
213
color: #ff1744;
314
word-break: break-word;
@@ -10,6 +21,7 @@
1021
text-decoration: underline;
1122
}
1223

24+
.md-nav__item
1325
.md-nav__link--active,
1426
.md-nav__link:active {
1527
color: #ff1744;
@@ -29,8 +41,20 @@
2941
word-break: keep-all;
3042
}
3143

44+
.md-typeset a {
45+
color: #ff1744;
46+
word-break: break-word;
47+
}
48+
49+
50+
/* fixing colors because wkhtmltopdf does not understand colors such as "var(--md-typeset-a-color);" */
3251
@media print {
3352

53+
/* fix image size */
54+
.md-typeset img, .md-typeset svg {
55+
zoom: 80%;
56+
}
57+
3458
/* disable menu */
3559
.md-md-header {
3660
display: none;
@@ -41,23 +65,111 @@
4165
display: none;
4266
}
4367

68+
/* fix font size of normal text */
69+
.md-typeset {
70+
font-size: 10pt;
71+
}
72+
73+
/* fix font size of text in tables */
74+
.md-typeset table:not([class]) {
75+
font-size: 8pt;
76+
}
77+
78+
/* fix colors of table headers */
79+
.md-typeset table:not([class]) th {
80+
color: white;
81+
background-color: rgba(0, 0, 0, 0.54);
82+
min-width: 60pt;
83+
}
84+
85+
/* fix color of footnote and font */
86+
.md-typeset .footnote {
87+
color: black;
88+
font-size: 8pt;
89+
}
90+
91+
/* fix font of code in footnote */
92+
.md-typeset .footnote code {
93+
font-size: 8pt;
94+
}
95+
96+
/* hide footnode link */
97+
.md-typeset .footnote-backref::before {
98+
display: none;
99+
}
100+
101+
/* fix code background color */
102+
.md-typeset code {
103+
font-size: 8pt;
104+
background-color: whitesmoke;
105+
}
106+
107+
/* fix code foreground color */
108+
.md-typeset code, .md-typeset pre, .md-typeset kbd {
109+
color: #36464e;
110+
}
111+
112+
/* fix code color for line numbers */
113+
.highlighttable .linenodiv pre {
114+
color: rgba(0, 0, 0, 0.54);
115+
text-align: right;
116+
}
117+
118+
/* fix settings for line numbers */
119+
.highlighttable .linenos {
120+
padding: 6pt 6pt;
121+
font-size: 8pt;
122+
background-color: rgba(0,0,0,.07);
123+
}
124+
125+
/* fix code highlighting colors */
126+
.codehilite .k, .highlight .k, .codehilite .kd, .highlight .kd, .codehilite .kn, .highlight .kn, .codehilite .kp, .highlight .kp, .codehilite .kr, .highlight .kr, .codehilite .kt, .highlight .kt {
127+
color: #3f6ec6;
128+
}
129+
.codehilite .kc, .highlight .kc, .codehilite .n, .highlight .n {
130+
color: #36464e;
131+
}
132+
.codehilite .p, .highlight .p {
133+
color: rgba(0, 0, 0, 0.54);
134+
}
135+
.codehilite .o, .highlight .o, .codehilite .ow, .highlight .ow {
136+
color: rgba(0, 0, 0, 0.54);
137+
}
138+
.codehilite .c, .highlight .c, .codehilite .cm, .highlight .cm, .codehilite .c1, .highlight .c1, .codehilite .ch, .highlight .ch, .codehilite .cs, .highlight .cs, .codehilite .sd, .highlight .sd {
139+
color: rgba(0, 0, 0, 0.54)
140+
}
141+
.codehilite .m, .highlight .m, .codehilite .mf, .highlight .mf, .codehilite .mh, .highlight .mh, .codehilite .mi, .highlight .mi, .codehilite .il, .highlight .il, .codehilite .mo, .highlight .mo {
142+
color: #d52a2a;
143+
}
144+
.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 {
145+
color: #1c7d4d;
146+
}
147+
.codehilite .no, .highlight .no, .codehilite .nb, .highlight .nb, .codehilite .bp, .highlight .bp {
148+
color: #6e59d9;
149+
}
150+
151+
/* add space between line numbers and code */
152+
span.linenos {
153+
padding-right: 12pt;
154+
}
155+
156+
/* fix background color in body */
157+
body {
158+
background-color: white;
159+
}
160+
161+
/* fix row seperators */
162+
.md-typeset table:not([class]) td {
163+
padding: .6rem .8rem;
164+
border-top: .05rem solid rgba(0,0,0,.07);
165+
vertical-align: top;
166+
}
167+
44168
/* do not show link details in brackets content: " [" attr(href) "]" */
45169
.md-typeset a:after {
46170
display: none;
47171
}
48172

49-
/* disable scrollbar */
50-
.md-typeset__scrollwrap,
51-
.md-typeset table:not([class]),
52-
.md-typeset
53-
.md-typeset__table table,
54-
.md-container,
55-
.md-main,
56-
html {
57-
overflow-x: hidden;
58-
-webkit-overflow-scrolling: hidden
59-
}
60-
61173
/* table-header-group leads to overlap with content */
62174
thead {
63175
display: table-row-group;
@@ -75,6 +187,8 @@
75187
page-break-before: avoid;
76188
}
77189

190+
[id="severity-of-the-rule"],
191+
[id="keywords-used"],
78192
[id="we-do-not-agree-with-all-your-standards"],
79193
[id="column"],
80194
[id="function"],

docs/stylesheets/toc.xsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
h1 {
1818
text-align: center;
19-
font-size: 20px;
19+
font-size: 16px;
2020
}
2121
div {
2222
border-bottom: 1px dashed rgb(200,200,200);
@@ -27,24 +27,24 @@
2727
}
2828
li {
2929
list-style: none;
30-
padding-top: 20px;
30+
padding-top: 16px;
3131
}
3232
li li {
33-
padding-top: 5px;
33+
padding-top: 4px;
3434
}
3535
li li li {
3636
padding-top: 0px;
3737
}
3838
ul {
39-
font-size: 20px;
39+
font-size: 16px;
4040
padding-left: 0em;
4141
}
4242
ul ul {
4343
font-size: 80%;
4444
padding-left: 1em;
4545
}
4646
ul ul ul ul {
47-
font-size: 12.8px;
47+
font-size: 10px;
4848
margin-top: 0px;
4949
margin-bottom: 0px;
5050
}

mkdocs.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ repo_url: https://github.com/trivadis/plsql-and-sql-coding-guidelines
66
edit_uri: ""
77

88
theme:
9+
logo: images/trivadis-logo.svg
10+
icon:
11+
repo: fontawesome/brands/github-alt
912
name: 'material'
1013
custom_dir: custom-theme
11-
logo: images/trivadis-logo.svg
1214
favicon: images/favicon.ico
1315
palette:
1416
primary: 'white'
@@ -22,17 +24,20 @@ extra_javascript:
2224

2325
markdown_extensions:
2426
- admonition
25-
- codehilite:
27+
- pymdownx.highlight:
2628
linenums: true
29+
linenums_style: table
30+
- pymdownx.superfences
31+
- pymdownx.inlinehilite
2732
- pymdownx.arithmatex
2833
- footnotes
2934

3035
extra:
3136
guideline_version: 4.0-SNAPSHOT
3237
social:
33-
- type: github-alt
38+
- icon: fontawesome/brands/github-alt
3439
link: https://github.com/Trivadis
35-
- type: twitter
40+
- icon: fontawesome/brands/twitter
3641
link: https://twitter.com/trivadis
3742

3843
plugins:

0 commit comments

Comments
 (0)