Permalink
Browse files

Merge pull request #26 from pettter/master

Some automation changes
  • Loading branch information...
2 parents d8515c8 + 6bcdd9b commit e968924e11c65aca9db98a550b372ca531d57c5b @pettter pettter committed Oct 22, 2012
Showing with 45 additions and 178 deletions.
  1. +9 −6 src/Makefile
  2. +36 −3 src/convert_to_tex.sh
  3. +0 −169 src/main.tex
View
15 src/Makefile
@@ -6,20 +6,23 @@ BOOK_DIR=${BUILD_DIR}/.
all: latex-pdf combined
-tex:
+${BUILD_DIR}:
+ mkdir ${BUILD_DIR}
+
+${TEX_DIR}/main.tex: ${BUILD_DIR} convert_to_tex.sh
./convert_to_tex.sh ${TEX_DIR}
- cp main.tex ${TEX_DIR}
-latex-pdf: tex
+
+latex-pdf: ${TEX_DIR}/main.tex
pdflatex --output-dir=${TEX_DIR} ${TEX_DIR}/main.tex
pdflatex --output-dir=${TEX_DIR} ${TEX_DIR}/main.tex
-book.md:
+${BOOK_DIR}/book.md: ${BUILD_DIR}
cat chapter*/*.md > ${BOOK_DIR}/book.md
-combined: book.md
+combined: ${BOOK_DIR}/book.md
-install: book.md latex-pdf
+install: combined latex-pdf
cp ${TEX_DIR}/main.pdf ${INSTALL_DIR}/cryptoparty-handbook-`date +%F`.pdf
cp ${BOOK_DIR}/book.md ${INSTALL_DIR}/cryptoparty-handbook-`date +%F`.md
View
39 src/convert_to_tex.sh
@@ -5,9 +5,42 @@ else
DIR=$1
fi
mkdir $DIR
+
+cat > $DIR/main.tex <<EOF
+\documentclass[oribibl,a4paper]{book}
+
+\usepackage{amsmath,amssymb,latexsym}
+\usepackage{algorithm, algorithmic}
+\usepackage{a4}
+\usepackage{graphicx}
+\usepackage{varioref}
+\usepackage{hyperref}
+\usepackage{paralist}
+\usepackage{eurosym}
+
+
+
+\begin{document}
+
+\title{The Cryptoparty Handbook}
+\author{Various authors}
+
+\maketitle
+\tableofcontents
+\clearpage
+EOF
+
+
for d in chapter*; do
mkdir $DIR/$d
+ echo "\\graphicspath{{./$d/}}" >> $DIR/main.tex
+ title=`echo $d | sed 's/chapter_[0-9][0-9]_//; s/_/ /g; s/^./\U&/; s/ ./\U&/g'`
+ echo "\\chapter{$title}" >> $DIR/main.tex
+ for f in $d/*.md; do
+ pandoc -f markdown -t latex $f -o $DIR/$f.tex
+ echo "\\clearpage
+\\input{$f.tex}" >> $DIR/main.tex
+ done
done
-for f in */*.md; do
- pandoc -f markdown -t latex $f -o $DIR/$f.tex
-done
+
+echo '\end{document}' >> $DIR/main.tex
View
169 src/main.tex
@@ -1,169 +0,0 @@
-\documentclass[oribibl,a4paper]{book}
-
-\usepackage{amsmath,amssymb,latexsym}
-\usepackage{algorithm, algorithmic}
-\usepackage{a4}
-\usepackage{graphicx}
-\usepackage{varioref}
-\usepackage{hyperref}
-\usepackage{paralist}
-\usepackage{eurosym}
-
-
-
-\begin{document}
-
-\title{The Cryptoparty Handbook}
-\author{Various authors}
-
-\maketitle
-\tableofcontents
-\clearpage
-
-\graphicspath{{chapter_00_cryptoparty_handbook}}
-\chapter{Cryptoparty Handbook}
-\input{chapter_00_cryptoparty_handbook/00_a_cryptoparty_history_party_like_its_1984.md.tex}
-\clearpage
-\input{chapter_00_cryptoparty_handbook/01_a_cryptoparty_manifesto.md.tex}
-\clearpage
-\input{chapter_00_cryptoparty_handbook/02_how_to_cryptoparty.md.tex}
-\clearpage
-\input{chapter_00_cryptoparty_handbook/03_why_privacy_matters.md.tex}
-\clearpage
-\input{chapter_00_cryptoparty_handbook/04_about_this_book.md.tex}
-\clearpage
-\graphicspath{{chapter_01_understanding_email}}
-\chapter{Understanding E-mail}
-\input{chapter_01_understanding_email/00_basic_tips.md.tex}
-\clearpage
-\input{chapter_01_understanding_email/01_types_of_email.md.tex}
-\clearpage
-\input{chapter_01_understanding_email/02_fears.md.tex}
-\clearpage
-\input{chapter_01_understanding_email/03_secure_connections.md.tex}
-\clearpage
-\input{chapter_01_understanding_email/04_secure_emails.md.tex}
-\clearpage
-\graphicspath{{chapter_02_understanding_browsing}}
-\chapter{Understanding Browsing}
-\input{chapter_02_understanding_browsing/00_basic_tips.md.tex}
-\clearpage
-\input{chapter_02_understanding_browsing/01_fears.md.tex}
-\clearpage
-\input{chapter_02_understanding_browsing/02_what_happens_when_you_browse.md.tex}
-\clearpage
-\input{chapter_02_understanding_browsing/03_accounts_and_security.md.tex}
-\clearpage
-\input{chapter_02_understanding_browsing/04_tracking.md.tex}
-\clearpage
-\input{chapter_02_understanding_browsing/05_anonymity.md.tex}
-\clearpage
-\input{chapter_02_understanding_browsing/06_vpn.md.tex}
-\clearpage
-\chapter{Publishing and Distribution}
-\input{chapter_03_publishing_and_distribution/00_publishing_anonymously.md.tex}
-\clearpage
-\input{chapter_03_publishing_and_distribution/01_anonymous_email.md.tex}
-\clearpage
-\input{chapter_03_publishing_and_distribution/02_file_sharing.md.tex}
-\clearpage
-\chapter{Secure Calls and SMS}
-\input{chapter_04_secure_calls_and_sms/00_secure_calls.md.tex}
-\clearpage
-\input{chapter_04_secure_calls_and_sms/01_secure_messaging_and_chat.md.tex}
-\clearpage
-\graphicspath{{./chapter_05_basic_email_security/}}
-\chapter{Basic E-mail Security}
-\input{chapter_05_basic_email_security/00_start_using_thunderbird_mail.md.tex}
-\clearpage
-\input{chapter_05_basic_email_security/01_setting_up_secure_connections.md.tex}
-\clearpage
-\input{chapter_05_basic_email_security/02_some_additional_security_settings.md.tex}
-\clearpage
-\graphicspath{{./chapter_06_email_encryption/}}
-\chapter{E-mail Encryption}
-\input{chapter_06_email_encryption/00_introducing_email_encryption_gpg.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/01_installing_gpg_on_windows.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/02_installing_gpg_on_osx.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/03_installing_gpg_on_ubuntu.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/04_installing_gpg_on_android.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/05_creating_your_gpg_keys.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/06_daily_gpg_usage.md.tex}
-\clearpage
-\input{chapter_06_email_encryption/07_webmail_and_gpg.md.tex}
-\clearpage
-\graphicspath{{./chapter_07_safer_browsing/}}
-\chapter{Safer Browsing}
-\input{chapter_07_safer_browsing/00_accessing_firefox_on_ubuntu.md.tex}
-\clearpage
-\input{chapter_07_safer_browsing/01_installing_firefox_on_mac_os_x.md.tex}
-\clearpage
-\input{chapter_07_safer_browsing/02_installing_firefox_on_windows.md.tex}
-\clearpage
-\input{chapter_07_safer_browsing/03_extending_firefox.md.tex}
-\clearpage
-\input{chapter_07_safer_browsing/04_proxy_settings.md.tex}
-\clearpage
-\input{chapter_07_safer_browsing/05_using_tor.md.tex}
-\clearpage
-\input{chapter_07_safer_browsing/06_extending_chrome.md.tex}
-\clearpage
-\graphicspath{{./chapter_08_passwords/}}
-\chapter{Passwords}
-\input{chapter_08_passwords/00_keeping_passwords_safe.md.tex}
-\clearpage
-\input{chapter_08_passwords/01_installing_keepass.md.tex}
-\clearpage
-\input{chapter_08_passwords/02_encrypting_passwords_with_a_password_manager.md.tex}
-\clearpage
-\graphicspath{{./chapter_09_using_vpn/}}
-\chapter{Using VPN}
-\input{chapter_09_using_vpn/00_getting_setting_up_and_testing_a_vpn_account.md.tex}
-\clearpage
-\input{chapter_09_using_vpn/01_vpn_on_ubuntu.md.tex}
-\clearpage
-\input{chapter_09_using_vpn/02_vpn_on_osx.md.tex}
-\clearpage
-\input{chapter_09_using_vpn/03_vpn_on_windows.md.tex}
-\clearpage
-\input{chapter_09_using_vpn/04_make_sure_it_works.md.tex}
-\clearpage
-\graphicspath{{./chapter_10_disk_encryption/}}
-\chapter{Disk Encryption}
-\input{chapter_10_disk_encryption/00_installing_truecrypt.md.tex}
-\clearpage
-\input{chapter_10_disk_encryption/01_using_truecrypt.md.tex}
-\clearpage
-\input{chapter_10_disk_encryption/02_setting_up_a_hidden_volume.md.tex}
-\clearpage
-\input{chapter_10_disk_encryption/03_securely_destroying_data.md.tex}
-\clearpage
-\graphicspath{{./chapter_11_call_encryption/}}
-\chapter{Call Encryption}
-\input{chapter_11_call_encryption/00_installing_csipsimple.md.tex}
-\clearpage
-\graphicspath{{./chapter_12_instant_messaging_encryption/}}
-\chapter{Instant Messaging Encryption}
-\input{chapter_12_instant_messaging_encryption/00_setting_up_encrypted_messaging.md.tex}
-\clearpage
-\graphicspath{{./chapter_13_secure_file_sharing/}}
-\chapter{Secure File Sharing}
-\input{chapter_13_secure_file_sharing/00_installing_i2p_on_ubuntu.md.tex}
-\clearpage
-\graphicspath{{./chapter_14_appendices/}}
-\chapter{Appendices}
-\appendix
-\input{chapter_14_appendices/00_the_necessity_of_open_source.md.tex}
-\clearpage
-\input{chapter_14_appendices/01_cryptography.md.tex}
-\clearpage
-\input{chapter_14_appendices/02_glossary.md.tex}
-\clearpage
-
-\end{document}

0 comments on commit e968924

Please sign in to comment.