initial commit

This commit is contained in:
Adam Skotarczak 2025-05-18 19:33:42 +02:00
commit 22086eec9e
Signed by: realAscot
GPG Key ID: 4CB9B8D93A96A538
22 changed files with 541 additions and 0 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
# Custom
# Files
*.zip
# Folders
# .vscode/**
build/**
!build/.gitkeep

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"makefile.configureOnOpen": false
}

5
CHANGELOG.md Normal file
View File

@ -0,0 +1,5 @@
# Changelog TS-Tutorial
- **2025-05-13**
- v0.1.0 - Style und Struktur überarbeitet
- initial commit

0
LICENSE Normal file
View File

94
Makefile Normal file
View File

@ -0,0 +1,94 @@
# Makefile für Markdown-eBook-Projekt mit Pandoc
# === Allgemeine Konfiguration ===
TITLE := JS-TS-Tutorial
MANUSCRIPT := manuscript
OUTPUT := build
METADATA := metadata/ebook.yaml
CSS := styles/ebook.css
TEX_EBOOK := styles/ebook-template.tex
TEX_PRINT := styles/print-template.tex
LOGO := media/logo/logo-v2.png
# === Quelldateien (geordnet nach Nummerierung) ===
MD_FILES := $(wildcard $(MANUSCRIPT)/*.md)
MD_SORTED := $(sort $(MD_FILES))
# === Standardziel: Alles bauen ===
all: epub pdf html docx
# === EPUB-Ausgabe ===
epub: $(OUTPUT)
pandoc $(MD_SORTED) \
--metadata-file=$(METADATA) \
--resource-path=media \
--toc --toc-depth=2 \
--css=$(CSS) \
--epub-chapter-level=1 \
--epub-cover-image=$(LOGO) \
-o $(OUTPUT)/$(TITLE).epub
# === PDF über LaTeX (Print-Version) ===
# --highlight-style=
#| Stilname | Beschreibung / Anmutung |
#| ------------ | --------------------------------------------- |
#| `pygments` | Klassischer Stil, angelehnt an Pygments |
#| `tango` | Kontrastreich, an das Tango-Theme angelehnt |
#| `kate` | Stil des Kate-Editors (KDE) |
#| `monochrome` | Schwarzweiß, ohne Farben (druckfreundlich) |
#| `espresso` | Dunkler Hintergrund, helles Code-Highlighting |
#| `zenburn` | Weicher, augenfreundlicher Dunkelstil |
#| `haddock` | Stil von Haddock-Dokumentation |
#| `breezedark` | KDE-Breeze-Dark-inspiriert (dunkel, modern) |
pdf:
pandoc $(MD_SORTED) \
--columns=1000 \
--metadata-file=$(METADATA) \
--resource-path=media \
--toc --number-sections \
--template=$(TEX_PRINT) \
--pdf-engine=xelatex \
--highlight-style=tango \
-o $(OUTPUT)/$(TITLE).pdf
# === HTML-Vorschau oder Export ===
html: $(OUTPUT)
pandoc $(MD_SORTED) \
--metadata-file=$(METADATA) \
--resource-path=media \
--toc --number-sections \
--css=$(CSS) \
-o $(OUTPUT)/$(TITLE).html
# === Word-Version (Lektorat etc.) ===
docx: $(OUTPUT)
pandoc $(MD_SORTED) \
--metadata-file=$(METADATA) \
--resource-path=media \
--toc --number-sections \
-o $(OUTPUT)/$(TITLE).docx
plain: $(OUTPUT)
pandoc $(MD_SORTED) \
--metadata-file=$(METADATA) \
--resource-path=media \
--wrap=none \
-t plain \
-o $(OUTPUT)/$(TITLE)_reintext.txt
# === Vorschau im Terminal (reines Markdown) ===
preview:
cat $(MD_SORTED) | less
# === Sicherstellen, dass der Ausgabeordner existiert ===
$(OUTPUT):
mkdir -p $(OUTPUT)
# === Bereinigen der Ausgaben ===
clean:
rm -rf $(OUTPUT)/*
.PHONY: all epub pdf html docx preview clean

178
README.md Normal file
View File

@ -0,0 +1,178 @@
# eBook - Dokumentation Vorlage
**Gleichzeitig eBook-Template für Maniskripte in Markdown**
![Buch-Logo](./media/logo/logo-v2-256x256.png)
Dieses Manuskript dient mir persönlich auch als Template für andere eBooks daher sind viele Stellen explizit sehr detailiert beschrieben.
## Inhalt
- [eBook - Dokumentation Vorlage](#ebook---dokumentation-vorlage)
- [Inhalt](#inhalt)
- [Infos](#infos)
- [Struktur](#struktur)
- [Installation und Build](#installation-und-build)
- [Nötige Software für den Build](#nötige-software-für-den-build)
- [Templates](#templates)
- [PDF](#pdf)
- [eBook (epub)](#ebook-epub)
- [DOCX (Office/ Word)](#docx-office-word)
- [Build](#build)
- [Lizenz](#lizenz)
---
## Infos
---
## Struktur
```plaintext
book/
├── manuscript/ # Hauptinhalt in Markdown-Dateien
│ ├── 00_vorwort.md
│ ├── 01_einleitung.md
│ ├── 02_kapitel1.md
│ ├── ...
│ └── 99_anhang.md
├── media/ # Bilder, Grafiken, Diagramme usw.
│ ├── kapitel1/
│ │ └── bild1.png
│ └── kapitel2/
│ └── diagramm.svg
├── styles/ # Pandoc-Templates, LaTeX-Vorlagen, CSS
│ ├── ebook-template.tex
│ ├── ebook.css
│ └── print-template.tex
├── build/
├── metadata/
│ ├── title.txt
│ ├── author.txt
│ └── ebook.yaml
├── Makefile #
├── README.md # Projektdokumentation
└── LICENSE # Lizenz für das Buch (z.B. CC-BY)
📁 ./ #
├── 📁 build # Ausgabeordner (wird vom Build-Prozess befüllt)
│ └── 📄 .gitkeep # Platzhalter damit git leere Verzeichnisse trackt
├── 📁 manuscript #
│ ├── 📄 00_deckblatt.md #
│ ├── 📄 05_vorwort.md #
│ ├── 📄 10_kapitel1.md #
│ ├── 📄 20_kapitel2.md #
│ └── 📄 30_kapitel2.md #
├── 📁 media #
│ ├── 📁 logo #
│ │ ├── 📄 logo-v1.png #
│ │ ├── 📄 logo-v2-256x256.png #
│ │ └── 📄 logo-v2.png #
│ └── 📄 favicon.ico #
├── 📁 metadata # Metadaten für eBook, Titelblatt, Author etc
│ ├── 📄 author.txt #
│ └── 📄 ebook.yaml #
├── 📁 styles #
│ ├── 📄 ebook-template.tex #
│ ├── 📄 ebook.css #
│ ├── 📄 print-template.tex #
│ └── 📄 reference.docx #
├── 📄 .gitignore #
├── 📄 CHANGELOG.md #
├── 📄 desktop.ini #
├── 📄 LICENSE #
├── 📄 Makefile # Automatisierter Build-Prozess mit Pandoc etc.
├── 📄 README.md # Diese Datei - Erklärung zum Build des Buchs
└── 📄 VERSION # Paketversion (ohne Zeilenumbruch einzeilig 0.0.0)
```
---
## Installation und Build
### Nötige Software für den Build
**Hinweis: TeX unter Windows?**
Obwohl es grundsätzlich möglich ist, TeX unter Windows zu installieren und auch entsprechende Distributionen wie MiKTeX oder TeX Live für Windows existieren rate ich dringend davon ab, auf diesem Weg zu starten.
Für einen stabilen und reproduzierbaren Build-Prozess empfiehlt sich stattdessen der Einsatz eines Linux-Systems. Wenn du kein dediziertes Linux verwendest, ist das Windows Subsystem for Linux (WSL) eine ausgezeichnete Alternative.
>Voraussetzung:
>Du solltest mit `apt` umgehen können und wissen, dass ein `update` vor dem `install` obligatorisch ist.
Falls der Build trotzdem scheitert oder du dir den Aufwand sparen möchtest, lade dir einfach die fertige PDF-Version herunter oder bestelle dir direkt ein gedrucktes Exemplar des Buchs.
- **✅ Pandoc installieren:**
```sh
sudo apt install pandoc
```
- **✅ Empfohlene Installation: TeX Live Full** (ca.8GB)
```sh
sudo apt install texlive-full
```
Wenn NICHT `texlive-full`, dann aber:
- Zusätzlich deutsche Sprache (falls babel fehlt):
```bash
sudo apt install texlive-lang-german
```
Ich empfehle aber dringend `texlive-full` zu installieren da man erfahrungsgemäss am Anfang auf viele Fehler mit fehlenden Abhängigkeiten stößt wenn man Templates testet.
- **✅ Make installieren:**
Make oder besser die Anwendung `make` wird benötigt um die Erstellung der Ziele wie PDF zu automatisiern.
Dafür liegt auch das vorbereitete Skript `Makefile` im Hauptverzeichnis. Die ist nur optional und man kann es selbstverständlich auch manuell durchführen.
```sh
sudo apt install make
```
Ich verwende Version:
```sh
> make -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
```
### Templates
#### PDF
#### eBook (epub)
#### DOCX (Office/ Word)
### Build
Schau mal ins [`Makefile`](./Makefile), dort findest Du einige Kandidaten um aus dem vorliegenden Markdown Manuskript eine entsprechende Version zu konvertieren. Es stehen zum aktuellen Zeitpunkt folgende zur Verfügung:
```sh
make pdf
make epub
make docx
```
---
## Lizenz
**(C) 2025 - Adam Skotarczak**
---

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.1.0

0
build/.gitkeep Normal file
View File

6
desktop.ini Normal file
View File

@ -0,0 +1,6 @@
[.ShellClassInfo]
IconResource=.\media\favicon.ico,0
[ViewState]
Mode=
Vid=
FolderType=Documents

View File

3
manuscript/05_vorwort.md Normal file
View File

@ -0,0 +1,3 @@
# Vorwort
Gibt nix zu sagen ...

45
manuscript/10_kapitel1.md Normal file
View File

@ -0,0 +1,45 @@
# Kapitel 1
## kurzer Schwenk nach Javascript
### Variablen
#### Deklaration
```javascript
var name = "Max"; // Alt, meiden!
let zahl = 42; // Modern, veränderbar
const pi = 3.1415; // Konstant, nicht veränderbar
```
| Schlüsselwort | Veränderbar | Gültigkeitsbereich | Empfehlung |
| ------------- | ----------- | ---------------------- | ----------------------- |
| `var` | ✔ | Funktion (funktional) | ✖ Nicht mehr verwenden |
| `let` | ✔ | Block (z.B. Schleife) | ✔ Standard |
| `const` | ✖ | Block | ✔ Für Konstanten |
#### Typen (vereinfacht)
JS ist dynamisch typisiert, aber man sollte Typen trotzdem kennen:
| Typ | Beispiel |
| ----------- | ------------------------ |
| `string` | `"Hallo"` |
| `number` | `42`, `3.14` |
| `boolean` | `true`, `false` |
| `object` | `{ name: "Max" }` |
| `array` | `[1, 2, 3]` |
| `undefined` | `let x;` (nicht gesetzt) |
| `null` | `let x = null;` |
---
### Funktionen
1. Klassische Deklaration
```javascript
function greet(name) {
return "Hallo " + name;
}
```

View File

@ -0,0 +1,3 @@
# Kapitel 2 - Typescript
Im Kapitel 1 haben wir gesehen was Javascript in seiner Rohform leistet.

View File

BIN
media/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
media/logo/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

10
metadata/author.txt Normal file
View File

@ -0,0 +1,10 @@
Adam Skotarczak
Elektroniker, Programmierer, Tüftler
Autor dieses Buches mit Fokus auf praxisnahe Softwareentwicklung, Systemintegration und moderne Technologien.
Besonderes Interesse gilt dem Zusammenspiel aus effizientem Code, durchdachtem Design und reproduzierbaren Workflows bevorzugt unter Linux.
Kontakt: adam@skotarczak.net
Web: https://www.ionivation.com
© 2025 Adam Skotarczak. Alle Rechte vorbehalten.

8
metadata/ebook.yaml Normal file
View File

@ -0,0 +1,8 @@
title: "eBook Vorlage"
subtitle: "wir scheiben ein Buch"
author: "Adam Skotarczak"
lang: de-DE
rights: "© 2025 Adam Skotarczak. CC BY-SA 4.0"
date: 2025-05-13
description: |
Eine Vorlage zum erstellen eines Buchs.

53
styles/ebook-template.tex Normal file
View File

@ -0,0 +1,53 @@
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont{DejaVu Sans}
\usepackage[ngerman]{babel}
\usepackage{parskip}
\usepackage{geometry}
\geometry{margin=2.5cm}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{emptypage}
% Kapitel auf neuer Seite
\newcommand{\sectionbreak}{\clearpage}
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
% Layout-Kopfzeile
\pagestyle{fancy}
\fancyhf{}
\rhead{$title$}
\lhead{$author$}
\rfoot{\thepage}
% Titelseite
\title{
\includegraphics[width=0.3\textwidth]{media/logo/logo.png} \\[2em]
{\Huge $title$} \\
\vspace{1em}
\Large $subtitle$
}
\author{$for(author)$$author$$sep$ \and $endfor$}
\date{$date$}
\begin{document}
\thispagestyle{empty}
\maketitle
\clearpage
\pagestyle{empty}
\tableofcontents
\clearpage
\pagestyle{fancy}
\setcounter{page}{1}
$body$
\end{document}

53
styles/ebook.css Normal file
View File

@ -0,0 +1,53 @@
/* Basislayout für eBook-Reader & Browser */
body {
font-family: "DejaVu Sans", sans-serif;
font-size: 1.05em;
line-height: 1.6;
color: #111;
background: #fff;
margin: 1em;
padding: 0;
}
/* Kapitelüberschriften */
h1, h2, h3 {
font-family: "DejaVu Sans", sans-serif;
font-weight: bold;
margin-top: 2em;
page-break-before: always;
}
/* Inhaltsverzeichnis-Stil */
nav.toc {
font-size: 0.95em;
margin-bottom: 2em;
}
/* Bilder */
img {
max-width: 100%;
height: auto;
display: block;
margin: 1.5em auto;
border: 0;
}
/* Code und Inline-Code */
code {
font-family: monospace;
background-color: #f4f4f4;
padding: 0.2em 0.4em;
border-radius: 3px;
}
pre {
background-color: #f4f4f4;
padding: 1em;
overflow-x: auto;
border-radius: 4px;
}
/* Seitenumbruch vor jedem Kapitel */
h1 {
page-break-before: always;
}

69
styles/print-template.tex Normal file
View File

@ -0,0 +1,69 @@
\documentclass[11pt,a4paper]{article}
\usepackage{xfp} % <-- ganz nach oben!
\usepackage{expl3} % <-- optional, bei manchen TeX-Installationen nötig
\usepackage{fontspec}
\setmainfont{DejaVu Sans}
\usepackage[ngerman]{babel}
\usepackage{parskip}
\usepackage{geometry}
\geometry{margin=2.5cm}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{emptypage}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{calc}
% Fallback-Makros für Pandoc Highlighting
$if(highlighting-macros)$
$highlighting-macros$
$endif$
% Codeblöcke (Pandoc Highlighting)
\usepackage{color}
\usepackage{framed}
\usepackage{fancyvrb}
% Kapitel auf neuer Seite
\newcommand{\sectionbreak}{\clearpage}
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
% Titel
\title{
\includegraphics[width=0.3\textwidth]{media/logo/logo.png} \\[2em]
{\Huge $title$} \\
\vspace{1em}
\Large $subtitle$
}
\author{$for(author)$$author$$sep$ \and $endfor$}
\date{$date$}
\begin{document}
% Titelseite OHNE Seitenzahl
\pagestyle{empty}
\maketitle
\thispagestyle{empty}
\clearpage
% Inhaltsverzeichnis OHNE Seitenzahl
\tableofcontents
\clearpage
% Seitenzahlen ab hier: fancy mit Kopf-/Fußzeile
\pagestyle{fancy}
\fancyhf{}
\rhead{$title$}
\lhead{$author$}
\rfoot{\thepage}
\setcounter{page}{1}
$body$
\end{document}

BIN
styles/reference.docx Normal file

Binary file not shown.