Skip to content

Commit 5ed21e1

Browse files
authored
Build files use for PDF crestion
Build files use for PDF crestion
1 parent 5a28b91 commit 5ed21e1

File tree

10 files changed

+3136
-0
lines changed

10 files changed

+3136
-0
lines changed

Build/Sysmon.md

Lines changed: 2389 additions & 0 deletions
Large diffs are not rendered by default.

Build/bullet_style.tex

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% https://stackoverflow.com/questions/22156999/how-to-change-the-style-of-bullets-in-pandoc-markdown
2+
3+
\usepackage{enumitem}
4+
\usepackage{amsfonts}
5+
6+
\setlist[itemize,1]{label=$\bullet$}
7+
\setlist[itemize,2]{label=$\circ$}
8+
\setlist[itemize,3]{label=$\star$}
9+
10+
%% \setlist[itemize,2]{label=$\diamond$}
11+
%% \setlist[itemize,1]{label=$\star$}
12+
%% \setlist[itemize,1]{label=$\bullet$}
13+
%% \setlist[itemize,1]{label=$\checkmark$}
14+

Build/chapter_break.tex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
%% Adds pagebreak between chapters
2+
% from comments of accepted answer
3+
% https://superuser.com/questions/601469/getting-chapters-to-start-on-a-new-page-in-a-pandoc-generated-pdf
4+
\usepackage{sectsty}
5+
\sectionfont{\clearpage}
6+
7+
% accepted answer gave error
8+
%\usepackage{titlesec}
9+
%\newcommand{\sectionbreak}{\clearpage}
10+

Build/inline_code.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
%% https://stackoverflow.com/questions/40975004/pandoc-latex-change-backtick-highlight
2+
\usepackage{fancyvrb,newverbs,xcolor}
3+
4+
%\definecolor{Light}{gray}{.90}
5+
%% https://martin-thoma.com/colors-in-latex/
6+
%% https://en.wikibooks.org/wiki/LaTeX/Colors
7+
\definecolor{Light}{HTML}{F4F4F4}
8+
9+
\let\oldtexttt\texttt
10+
\renewcommand{\texttt}[1]{
11+
\colorbox{Light}{\oldtexttt{#1}}
12+
}
13+

Build/listings-setup.tex

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
\lstset{
2+
basicstyle=\ttfamily,
3+
numbers=left,
4+
numberstyle=\footnotesize,
5+
stepnumber=1,
6+
numbersep=5pt,
7+
backgroundcolor=\color[RGB]{248,248,248},
8+
showspaces=false,
9+
showstringspaces=false,
10+
showtabs=false,
11+
tabsize=2,
12+
captionpos=b,
13+
breaklines=true,
14+
breakatwhitespace=true,
15+
breakautoindent=true,
16+
escapeinside={\%*}{*)},
17+
linewidth=\textwidth,
18+
basewidth=0.5em,
19+
postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space},
20+
}
21+
22+
\definecolor{maroon}{rgb}{0.5,0,0}
23+
\definecolor{darkgreen}{rgb}{0,0.5,0}
24+
25+
\lstdefinelanguage{XML}
26+
{
27+
basicstyle=\ttfamily,
28+
morestring=[s]{"}{"},
29+
morecomment=[s]{?}{?},
30+
morecomment=[s]{!--}{--},
31+
commentstyle=\color{darkgreen},
32+
moredelim=[s][\color{black}]{>}{<},
33+
moredelim=[s][\color{red}]{\ }{=},
34+
stringstyle=\color{blue},
35+
identifierstyle=\color{maroon}
36+
}
37+
38+
\definecolor{dkgreen}{rgb}{0,0.6,0}
39+
\definecolor{ltgray}{rgb}{0.5,0.5,0.5}
40+
41+
\usepackage{listings}
42+
\lstset{%
43+
backgroundcolor=\color{white},
44+
basicstyle=\footnotesize,
45+
breakatwhitespace=false,
46+
breaklines=true,
47+
captionpos=b,
48+
commentstyle=\color{dkgreen},
49+
deletekeywords={...},
50+
escapeinside={\%*}{*)},
51+
extendedchars=true,
52+
frame=single,
53+
keepspaces=true,
54+
keywordstyle=\color{blue},
55+
language=SQL,
56+
morekeywords={*,modify,MODIFY,...},
57+
numbers=left,
58+
numbersep=15pt,
59+
numberstyle=\tiny,
60+
rulecolor=\color{ltgray},
61+
showspaces=false,
62+
showstringspaces=false,
63+
showtabs=false,
64+
stepnumber=1,
65+
tabsize=4,
66+
title=\lstname
67+
}
68+
69+
\lstdefinelanguage{powershell}{
70+
morekeywords={Add-Content,Add-PSSnapin,Clear-Content,%
71+
Clear-History,Clear-Host,Clear-Item,%
72+
Clear-ItemProperty,Clear-Variable,%
73+
Compare-Object,Connect-PSSession,ConvertFrom-String,%
74+
Convert-Path,Copy-Item,Copy-ItemProperty,%
75+
Disable-PSBreakpoint,Disconnect-PSSession,%
76+
Enable-PSBreakpoint,Enter-PSSession,Exit-PSSession,%
77+
Export-Alias,Export-Csv,Export-PSSession,ForEach-Object,%
78+
Format-Custom,Format-Hex,Format-List,Format-Table,%
79+
Format-Wide,Get-Alias,Get-ChildItem,Get-Clipboard,%
80+
Get-Command,Get-ComputerInfo,Get-Content,Get-History,%
81+
Get-Item,Get-ItemProperty,Get-ItemPropertyValue,Get-Job,%
82+
Get-Location,Get-Member,Get-Module,Get-Process,%
83+
Get-PSBreakpoint,Get-PSCallStack,Get-PSDrive,Get-PSSession,%
84+
Get-PSSnapin,Get-Service,Get-TimeZone,Get-Unique,Get-Variable,%
85+
Get-WmiObject,Group-Object,help,Import-Alias,Import-Csv,%
86+
Import-Module,Import-PSSession,Invoke-Command,Invoke-Expression,%
87+
Invoke-History,Invoke-Item,Invoke-RestMethod,Invoke-WebRequest,%
88+
Invoke-WmiMethod,Measure-Object,mkdir,Move-Item,Move-ItemProperty,%
89+
New-object,New-Alias,New-Item,New-Module,New-PSDrive,New-PSSession,%
90+
New-PSSessionConfigurationFile,New-Variable,Out-GridView,%
91+
Out-Host,Out-Printer,Pop-Location,powershell_ise.exe,%
92+
Push-Location,Receive-Job,Receive-PSSession,Remove-Item,%
93+
Remove-ItemProperty,Remove-Job,Remove-Module,Remove-PSBreakpoint,%
94+
Remove-PSDrive,Remove-PSSession,Remove-PSSnapin,Remove-Variable,%
95+
Remove-WmiObject,Rename-Item,Rename-ItemProperty,Resolve-Path,%
96+
Resume-Job,Select-Object,Select-String,Set-Alias,Set-Clipboard,%
97+
Set-Content,Set-Item,Set-ItemProperty,Set-Location,%
98+
Set-PSBreakpoint,Set-TimeZone,Set-Variable,Set-WmiInstance,%
99+
Show-Command,Sort-Object,Start-Job,Start-Process,Start-Service,%
100+
Start-Sleep,Stop-Job,Stop-Process,Stop-Service,Suspend-Job,%
101+
Tee-Object,Trace-Command,Wait-Job,Where-Object,Write-Output%
102+
},
103+
morekeywords={Do,Else,For,ForEach,Function,If,In,Until,While},
104+
alsodigit={-},
105+
sensitive=false,
106+
morecomment=[l]{\#},
107+
morecomment=[n]{<\#}{\#>},
108+
morestring=[b]{"},
109+
morestring=[b]{'},
110+
morestring=[s]{@'}{'@},
111+
morestring=[s]{@"}{"@}
112+
}
113+

Build/md2pdf.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# Script based on https://learnbyexample.github.io/tutorial/ebook-generation/customizing-pandoc/
3+
SCRIPT=$(readlink -f "$0")
4+
SCRIPTPATH=$(dirname "$SCRIPT")
5+
6+
pandoc "$tfl" \
7+
-f gfm \
8+
--toc \
9+
--listings \
10+
--include-in-header ${SCRIPTPATH}/Build/chapter_break.tex \
11+
--include-in-header ${SCRIPTPATH}/Build/inline_code.tex \
12+
--include-in-header ${SCRIPTPATH}/Build/bullet_style.tex \
13+
--include-in-header ${SCRIPTPATH}/Build/pdf_properties.tex \
14+
--include-in-header ${SCRIPTPATH}/Build/listings-setup.tex \
15+
--highlight-style ${SCRIPTPATH}/Build/pygments.theme \
16+
-V toc-title='Table of contents' \
17+
-V linkcolor:blue \
18+
-V geometry:a4paper \
19+
-V geometry:margin=2cm \
20+
-V mainfont="DejaVu Serif" \
21+
-V monofont="DejaVu Sans Mono" \
22+
--pdf-engine=xelatex \
23+
-o temp.tex
24+
25+
fn="${2%.*}"
26+
27+
perl -0777 -pe 's/begin\{document\}\n\n\K(.*?^\}$)(.+?)\n/$2\n\\thispagestyle{empty}\n\n$1\n/ms' temp.tex > ${fn}.tex
28+
29+
xelatex ${SCRIPTPATH}/${fn}.tex &> /dev/null
30+
xelatex ${SCRIPTPATH}/${fn}.tex &> /dev/null
31+
32+
rm temp.tex "$fn".{tex,toc,aux,log}
33+
34+

Build/metadata.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Sysmon Missing Manual"
3+
author: "Carlos Perez"
4+
rights: "TrustedSec LLC, Creative Commons Non-Commercial Share Alike 4.0"
5+
language: "en-US"
6+
subtitle: Open Source Sysinternals Sysmon Community Guide
7+
date: 28.01.2020
8+
publisher: TrustedSec Inc.
9+
ibooks:
10+
version: 1.0
11+
stylesheet: pandoc.css
12+
cover-image: media/cover.png
13+
---

0 commit comments

Comments
 (0)