One of my clients asked me for a printable book to accompany one of my workshops. My teaching style is more fluid and we write a lot of code in class. I wanted a quick way to take all the source code files and some images and make a book out of them.
Since I already work with markdown, I looked for a solution that can convert markdown to PDF. The winner was Pandoc (which can be installed with conda). Of course the out-of-the-box results weren't satisfactory and some tweaking was required. Mostly to make images appear where they are define in the markdown and not where pandoc/LaTex thinks is the optimal location.
The solution is composed of an awk script to add an include directive to markdown, a custom LaTex header to inline images and a Makefile to bind them all.
You can view the whole project here, including a example book. You can view the output here (decorators anyone?).
$ wifi-menu
$ netctl start <profile>
$ ping archlinux.org
$ timedatectl set-ntp true
$ fdisk /dev/sda
g (create new GPT)
n (new partition, id 1, size +512M)
t (change type to 1 - EFI)
n (new partition, id 2, rest)
w (save)
$ mkfs.fat -F32 /dev/sda1
$ mdfs.ext4 /dev/sda2
$ mount /dev/sda2 /mnt
$ mkdir /mnt/boot
$ mount /dev/sda1 /mnt/boot
$ pacstrap /mnt base
$ genfstab -U /mnt >> /mnt/etc/fstab
$ arch-chroot /mnt
$ ln -sf /usr/share/zoneinfo/Asia/Jerusalem /etc/localtime
$ hwclock --systohc
$ vi /etc/locale.gen
$ locale-gen
$ echo 'LANG=en_US.UTF-8' > /etc/locale.conf
$ echo archie > /etc/hostname
$ cat << EOF >> /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 archie.localdomain archie
EOF
$ pacman -S networkmanager
$ systemctl enable NetworkManager
$ passwd (root password)
$ pacman -S grub efibootmgr
$ grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --removable
$ grub-mkconfig -o /boot/grub/grub.cfg
$ exit
$ umount /mnt/boot
$ umount /mnt
$ reboot
$ nmcli dev wifi connect <SSID> password <password>
$ pacman -S sudo zsh
$ useradd -m -s /bin/zsh miki
$ passwd miki
$ usermod -aG wheel miki
$ pacman -S gdm
$ systemctl enable gdm.service
$ pacman -S xfce4 xfce4-goodies gvfs udisks2 exfat-utils xorg
$ reboot
$ pacman -S base-devel go
# I'd probably use trizen today
$ curl -LO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz
$ tar xzf yay.tar.gz
$ cd yay
$ makepkg -si
$ yay -S gvfs ttf-liberation chroimum gvim
$ yay -S xfce-theme-greybird elementary-icon-theme
$ yay -S dockerW
$ usermod -aG docker miki
$ yay -S cups hplip
$ systemctl enable org.cups.cupsd
$ systemctl start org.cups.cupsd
$ usermod -aG adm miki
$ yay -S gvim direnv atool zip openssh dropbox