Skip to content

Commit adfbb06

Browse files
Merge branch 'main' into images_dir
2 parents f4ee9d6 + 6a215a4 commit adfbb06

File tree

3 files changed

+246
-21
lines changed

3 files changed

+246
-21
lines changed

makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ lint: toc.md
99
toc.md: secure_software_development_fundamentals.md tocignore
1010
grep -E '^#{1,3} ' secure_software_development_fundamentals.md | \
1111
grep -E -v -f tocignore | while read line; do echo "$$line"; echo; done > toc.md
12+
13+
# This requires wkhtmltopdf because it goes via HTML
14+
# https://plaintextproject.online/articles/2022/04/06/pdf.html
15+
# https://stackoverflow.com/questions/38455078/specifying-papersize-for-md-to-pdf-conversion
16+
# We don't include this because it shows the title twice:
17+
# --metadata title="Secure Software Development Fundamentals"
18+
book.pdf: secure_software_development_fundamentals.md
19+
pandoc -f gfm --pdf-engine=wkhtmltopdf \
20+
--css=print.css -V geometry:a4paper -o book.pdf \
21+
secure_software_development_fundamentals.md

print.css

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/**
2+
* Print Stylesheet fuer Deinewebsite.de
3+
* @version 1.0
4+
* @lastmodified 16.06.2016
5+
* https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/
6+
*/
7+
8+
@media print {
9+
10+
/* Inhaltsbreite setzen, Floats und Margins aufheben */
11+
/* Achtung: Die Klassen und IDs variieren von Theme zu Theme. Hier also eigene Klassen setzen */
12+
#content, #page {
13+
width: 100%;
14+
margin: 0;
15+
float: none;
16+
}
17+
18+
/** Seitenränder einstellen */
19+
@page { margin: 2cm }
20+
21+
/* Font auf 16px/13pt setzen, Background auf Weiß und Schrift auf Schwarz setzen.*/
22+
/* Das spart Tinte */
23+
body {
24+
font: 16pt Georgia, "Times New Roman", Times, serif;
25+
line-height: 1.3;
26+
background: #fff !important;
27+
color: #000;
28+
}
29+
30+
h1 {
31+
font-size: 24pt;
32+
}
33+
34+
h2, h3, h4 {
35+
font-size: 18pt;
36+
margin-top: 25px;
37+
}
38+
39+
/* Alle Seitenumbrüche definieren */
40+
a {
41+
page-break-inside:avoid
42+
}
43+
blockquote {
44+
page-break-inside: avoid;
45+
}
46+
h1, h2, h3, h4, h5, h6 { page-break-after:avoid;
47+
page-break-inside:avoid }
48+
img { page-break-inside:avoid;
49+
page-break-after:avoid; }
50+
table, pre { page-break-inside:avoid }
51+
ul, ol, dl { page-break-before:avoid }
52+
53+
/* Linkfarbe und Linkverhalten darstellen */
54+
a:link, a:visited, a {
55+
background: transparent;
56+
color: #520;
57+
font-weight: bold;
58+
text-decoration: underline;
59+
text-align: left;
60+
}
61+
62+
a {
63+
page-break-inside:avoid
64+
}
65+
66+
a[href^=http]:after {
67+
content:" <" attr(href) "> ";
68+
}
69+
70+
$a:after > img {
71+
content: "";
72+
}
73+
74+
article a[href^="#"]:after {
75+
content: "";
76+
}
77+
78+
a:not(:local-link):after {
79+
content:" <" attr(href) "> ";
80+
}
81+
82+
/**
83+
* Eingebundene Videos verschwinden lassen und den Whitespace der iframes auf null reduzieren.
84+
*/
85+
.entry iframe, ins {
86+
display: none;
87+
width: 0 !important;
88+
height: 0 !important;
89+
overflow: hidden !important;
90+
line-height: 0pt !important;
91+
white-space: nowrap;
92+
}
93+
.embed-youtube, .embed-responsive {
94+
position: absolute;
95+
height: 0;
96+
overflow: hidden;
97+
}
98+
99+
/* Unnötige Elemente ausblenden für den Druck */
100+
101+
#header-widgets, nav, aside.mashsb-container,
102+
.sidebar, .mashshare-top, .mashshare-bottom,
103+
.content-ads, .make-comment, .author-bio,
104+
.heading, .related-posts, #decomments-form-add-comment,
105+
#breadcrumbs, #footer, .post-byline, .meta-single,
106+
.site-title img, .post-tags, .readability
107+
{
108+
display: none;
109+
}
110+
111+
/* Benutzerdefinierte Nachrichten vor und nach dem Inhalt einfügen */
112+
.entry:after {
113+
content: "\ Alle Rechte vorbehalten. (c) 2014 - 2016 TechBrain - techbrain.de";
114+
color: #999 !important;
115+
font-size: 1em;
116+
padding-top: 30px;
117+
}
118+
#header:before {
119+
content: "\ Vielen herzlichen Dank für das Ausdrucken unseres Artikels. Wir hoffen, dass auch andere Artikel von uns Ihr Interesse wecken können.";
120+
color: #777 !important;
121+
font-size: 1em;
122+
padding-top: 30px;
123+
text-align: center !important;
124+
}
125+
126+
/* Wichtige Elemente definieren */
127+
p, address, li, dt, dd, blockquote {
128+
font-size: 100%
129+
}
130+
131+
/* Zeichensatz fuer Code Beispiele */
132+
code, pre { font-family: "Courier New", Courier, mono}
133+
134+
ul, ol {
135+
list-style: square; margin-left: 18pt;
136+
margin-bottom: 20pt;
137+
}
138+
139+
li {
140+
line-height: 1.6em;
141+
}
142+
143+
}

0 commit comments

Comments
 (0)