Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
geraldb committed Mar 6, 2024
1 parent 8c56220 commit 5ccef13
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Crypto Collectibles Series -

# Programming (Crypto) Pixel Punk Profile Pictures & (Generative) Art - Step-by-Step Book / Guide

_Inside Unique 24×24 Pixel Art on the Blockchain..._
_Inside Unique 24×24 Pixel Art on (and off) the Blockchain..._

by [Gerald Bauer](https://github.com/geraldb), et al

Expand Down
9 changes: 9 additions & 0 deletions book/00_meta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Programming (Crypto) Pixel Punk Profile Pictures & (Generative) Art
subtitle: A Step-by-Step Book / Guide - Inside Unique 24×24 Pixel Art on (and off) the Blockchain
author: Gerald Bauer
date: March 2024
## or use only 2024 - why? why not?

## add more variable here - why? why not?
---
50 changes: 50 additions & 0 deletions book/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
TARGET = programming-cryptopunks
SRC = book/00_meta.md \
01_crop.md \
02_attributes.md \
03_generate.md \
05_alien_invasion.md \
06_palette_8bit.md \
07_humans.md \
08_composite.md \
09_monalisa.md \
10_hair.md \
A1_special_effects.md



PANDOC = c:/prg/pandoc3.1.11.1/pandoc.exe



all: pdf pdf_std


pdf_std: $(SRC) build
$(PANDOC) --verbose $(SRC) \
-f gfm \
--toc \
--number-sections \
--pdf-engine=xelatex \
-o build/$(TARGET)_std.pdf


pdf: $(SRC) build
$(PANDOC) --verbose $(SRC) \
-f gfm \
--lua-filter book/numbering.lua \
--toc \
--number-sections \
--include-in-header book/fonts.tex \
--include-in-header book/chapter_break.tex \
--include-in-header book/inline_code.tex \
--highlight-style book/pygments.theme \
-V linkcolor:blue \
-V geometry:a4paper \
-V geometry:margin=2cm \
--pdf-engine=xelatex \
-o build/$(TARGET).pdf

build:
mkdir build

17 changes: 17 additions & 0 deletions book/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build Scripts Notes

let's try to build a pdf booklet via pandoc (and latex).
run / try:


$ make -f book/Makefile pdf

and

$ make -f book/Makefile pdf_std

gets you a "vanilla" booklet with no pandoc/latex customizations




10 changes: 10 additions & 0 deletions book/chapter_break.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%% Adds pagebreak between chapters
% from comments of accepted answer
% https://superuser.com/questions/601469/getting-chapters-to-start-on-a-new-page-in-a-pandoc-generated-pdf
\usepackage{sectsty}
\sectionfont{\clearpage}

% accepted answer gave error
%\usepackage{titlesec}
%\newcommand{\sectionbreak}{\clearpage}

36 changes: 36 additions & 0 deletions book/fonts.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

\usepackage{fontspec}


\setmainfont{DejaVuSerif}[
Path=/sites/tex/dejavu-fonts-ttf-2.37/ttf/,
Extension = .ttf,
UprightFont=*,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic
]

\setsansfont{DejaVuSans}[
Path=/sites/tex/dejavu-fonts-ttf-2.37/ttf/,
Extension = .ttf,
UprightFont=*,
BoldFont=*-Bold,
ItalicFont=*-Oblique,
BoldItalicFont=*-BoldOblique
]

\setmonofont{DejaVuSansMono}[
Path=/sites/tex/dejavu-fonts-ttf-2.37/ttf/,
Extension = .ttf,
UprightFont=*,
BoldFont=*-Bold,
ItalicFont=*-Oblique,
BoldItalicFont=*-BoldOblique
]


% Oblique characters follow the structure of the upright styles,
% while italics have a different structure, informed by cursive writing.
% Obliques are not merely digitally slanted—optical corrections
% are made to avoid distortions and an incorrect distribution of weight.
13 changes: 13 additions & 0 deletions book/inline_code.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%% https://stackoverflow.com/questions/40975004/pandoc-latex-change-backtick-highlight
\usepackage{fancyvrb,newverbs,xcolor}

%\definecolor{Light}{gray}{.90}
%% https://martin-thoma.com/colors-in-latex/
%% https://en.wikibooks.org/wiki/LaTeX/Colors
\definecolor{Light}{HTML}{F4F4F4}

\let\oldtexttt\texttt
\renewcommand{\texttt}[1]{
\colorbox{Light}{\oldtexttt{#1}}
}

11 changes: 11 additions & 0 deletions book/numbering.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- adjust as needed
-- turn off numbering for sections below max treshhold
local max_numbering_level = 1

function Header(h)
if h.level > max_numbering_level then
h.classes:insert 'unnumbered'
end
return h
end

211 changes: 211 additions & 0 deletions book/pygments.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"text-color": null,
"background-color": "#f8f8f8",
"line-number-color": "#aaaaaa",
"line-number-background-color": null,
"text-styles": {
"Alert": {
"text-color": "#ff0000",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Annotation": {
"text-color": "#60a0b0",
"background-color": null,
"bold": true,
"italic": true,
"underline": false
},
"Attribute": {
"text-color": "#7d9029",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"BaseN": {
"text-color": "#40a070",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"BuiltIn": {
"text-color": "#008000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Char": {
"text-color": "#4070a0",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Comment": {
"text-color": "#60a0b0",
"background-color": null,
"bold": false,
"italic": true,
"underline": false
},
"CommentVar": {
"text-color": "#60a0b0",
"background-color": null,
"bold": true,
"italic": true,
"underline": false
},
"Constant": {
"text-color": "#880000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"ControlFlow": {
"text-color": "#007020",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"DataType": {
"text-color": "#902000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"DecVal": {
"text-color": "#40a070",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Documentation": {
"text-color": "#ba2121",
"background-color": null,
"bold": false,
"italic": true,
"underline": false
},
"Error": {
"text-color": "#ff0000",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Extension": {
"text-color": null,
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Float": {
"text-color": "#40a070",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Function": {
"text-color": "#06287e",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Import": {
"text-color": "#008000",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Information": {
"text-color": "#60a0b0",
"background-color": null,
"bold": true,
"italic": true,
"underline": false
},
"Keyword": {
"text-color": "#007020",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Operator": {
"text-color": "#666666",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Other": {
"text-color": "#007020",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Preprocessor": {
"text-color": "#bc7a00",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"SpecialChar": {
"text-color": "#4070a0",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"SpecialString": {
"text-color": "#bb6688",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"String": {
"text-color": "#4070a0",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Variable": {
"text-color": "#19177c",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"VerbatimString": {
"text-color": "#4070a0",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Warning": {
"text-color": "#60a0b0",
"background-color": null,
"bold": true,
"italic": true,
"underline": false
}
}
}
20 changes: 0 additions & 20 deletions script/NOTES.md

This file was deleted.

Loading

0 comments on commit 5ccef13

Please sign in to comment.