adjusted makefile to support multifile sources

This commit is contained in:
quak
2025-02-02 16:56:49 +01:00
parent c4619ffc06
commit 7fffb463b4
8 changed files with 53 additions and 44 deletions

View File

@@ -1,20 +1,37 @@
OUT_DIR = ./output
SRC_FILES = $(wildcard *.md)
OUT_FILES = $(SRC_FILES:.md=.pdf)
TARGETS = $(SRC_FILES:.md=)
OUTPUT := output
SINGLE := $(wildcard *.md)
MULTI := $(wildcard *.txt)
TARGET_S := $(SINGLE:.md=)
TARGET_M := $(MULTI:.txt=)
PANDOC_OPT = --standalone
PANDOC_OPT = --standalone \
-V linkcolor:blue \
-V geometry:a4paper \
-V geometry:margin=2cm \
-V monofont="JetBrainsMono Nerd Font" \
--pdf-engine=xelatex
.PHONY: all clean test
.PHONY: all clean out_dir test $(DIRECTORIES)
all: $(TARGETS)
all: $(TARGET_S) $(TARGETS_M)
clean:
rm -f $(OUT_DIR)/*
rm -f $(OUTPUT)/*
$(TARGETS): %: $(OUT_DIR)/%.pdf
test:
@echo "test test :)"
@echo "$(MULTI)"
$(TARGET_S): out_dir
@pandoc $(PANDOC_OPT) $@.md -o $(OUTPUT)/$@.pdf
$(TARGET_M): out_dir
@pandoc $(PANDOC_OPT) $(shell cat $@.txt | xargs) -o $(OUTPUT)/$@.pdf
out_dir:
@if [[ ! -d $(OUTPUT) ]]; then\
mkdir $(OUTPUT);\
fi
$(OUT_DIR)/%.pdf: %.md
pandoc $(PANDOC_OPT) $^ -o $@

3
git.md
View File

@@ -3,7 +3,6 @@
## Table of contents
- [glossary](#glossary)
- [terminology](#terminology)
- [branches](#branches)
- [create a branch](#create-a-branch)
- [submodules](#submodules)
@@ -13,7 +12,7 @@
- [merge](#merge)
- [rebase](#rebase)
## terminology
## glossary
| term | description |
| :--- | :---------- |

5
linux.txt Normal file
View File

@@ -0,0 +1,5 @@
./linux/linux.md
./linux/setup.md
./linux/commands.md
./linux/permissions.md
./linux/terminal.md

View File

@@ -1,9 +1,9 @@
# Linux commands
## Linux commands
- [Linux commands](#linux-commands)
- [combine commands with *xargs*](#combine-commands-with-xargs)
## combine commands with *xargs*
### combine commands with *xargs*
Some commands (e.g. `chmod`) can't handle input via pipe and require the input as arguments. `xargs` takes the standard input as list of arguments seperated by spaces or newlines and executes the given command with the input parsed to a list of arguments.

View File

@@ -6,3 +6,4 @@ This document collects knowledge, tips and tricks on all things Linux, that don'
- [Linux commands](linux/commands.md)
- [Permissions](linux/permissions.md)
- [Terminal](linux/terminal.md)

View File

@@ -1,11 +1,11 @@
# permissions
## permissions
Linux permissions are ordered as follows:
- owner
- group
- others
## octal permissions
### octal permissions
In octal representation the actions (read, write, execute) have the values:
- read = 4

View File

@@ -1,7 +1,7 @@
# Setup and Configuration
## Setup and Configuration
## Locales and Keyboard Layouts
### Locales and Keyboard Layouts
Use `localectl` to display and configure locales and keyboard layout:
@@ -11,7 +11,8 @@ localectl status
```
### configure layout 'US intl. with deadkeys'
#### configure layout 'US intl. with deadkeys'
To configure `US intl. with deadkeys`, set the following values:
```sh
X11 Layout: us

View File

@@ -1,16 +1,16 @@
# Terminal
## Terminal
- [ANSI escape sequences](#ansi-escape-sequences)
## ANSI escape sequences
### ANSI escape sequences
Ansi escape sequences are used to format output in a terminal. They **are prefixed with an escape character**, which can be written in a few ways:
- Ctrl-Key `^[`
- Octal `\033` (\0 for octal)
- Hexadecimal `\x1B` (\x for hexadecimal)
- Unicode `\u001b
- Hexadecimal `\x1B` (\\x for hexadecimal)
- Unicode `\u001b`
The sequences is started with a `[` followed by the command and arguments. Arguments are separated with `;`. **Sequences are terminated with `m`.**
@@ -20,7 +20,7 @@ The sequences is started with a `[` followed by the command and arguments. Argum
```
For the following tables we define `ESC = \x1B`
### Text Style
#### Text Style
| ESC Code Sequence | Reset Sequence | Description |
| :---------------- | :------------- | :---------- |
@@ -39,12 +39,12 @@ For the following tables we define `ESC = \x1B`
> **Note:** Both dim and bold modes are reset with the `ESC[22m` sequence. The `ESC[21m` sequence is a non-specified sequence for double underline mode and only works in some terminals and is reset with `ESC[24m`.
### Color codes
#### Color codes
Most terminals support 8 and 16 colors, as well as 256 (8-bit) colors. These colors are set by the user, but have commonly defined meanings.
#### 8-16 Colors
##### 8-16 Colors
| Color Name | Foreground Color Code | Background Color Code |
| :--------- | :-------------------- | :-------------------- |
@@ -83,7 +83,7 @@ Terminals that support the [aixterm specification](https://sites.ualberta.ca/dep
| Bright Cyan | `96` | `106` |
| Bright White | `97` | `107` |
#### 256 Colors
##### 256 Colors
The following escape codes tells the terminal to use the given color ID:
@@ -104,7 +104,7 @@ The final 24 colors (232-255) are grayscale starting from a shade slighly lighte
Some emulators interpret these steps as linear increments (`256 / 24`) on all three channels, although some emulators may explicitly define these values.
#### RGB Colors
##### RGB Colors
More modern terminals supports [Truecolor](https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29) (24-bit RGB), which allows you to set foreground and background colors using RGB.
@@ -115,19 +115,5 @@ These escape sequences are usually not well documented.
| `ESC[38;2;{r};{g};{b}m` | Set foreground color as RGB. |
| `ESC[48;2;{r};{g};{b}m` | Set background color as RGB. |
> Note that `;38` and `;48` corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as `;2` and `;5` sets the color format.
#### RGB Colors
More modern terminals supports [Truecolor](https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29) (24-bit RGB), which allows you to set foreground and background colors using RGB.
These escape sequences are usually not well documented.
| ESC Code Sequence | Description |
| :---------------------- | :--------------------------- |
| `ESC[38;2;{r};{g};{b}m` | Set foreground color as RGB. |
| `ESC[48;2;{r};{g};{b}m` | Set background color as RGB. |
> Note that `;38` and `;48` corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as `;2` and `;5` sets the color format.
> Note that `38` and `48` corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as `;2` and `;5` sets the color format.