From 66081dfabb81ab37092df2c4733d7b55612f2408 Mon Sep 17 00:00:00 2001 From: Mara Karagianni Date: Mon, 13 Dec 2021 00:05:45 +0200 Subject: [PATCH] Add extra info --- README.md | 116 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 38e125d..041ae4b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ -## To Download the project, near the top of the page, click on the download icon next to "WEB IDE". -You can choose which type of archived folder you want, and then open it in your filesystem. +# Introduction +This zine helps in navigating the zine_maker code, a small software tool derived from pyPDF library. The code is written in Python, and provides a few scripts for creating covers, colophones, content, and also signatures for preparing a PDF for the printer. The scripts run with python version 3.x.x and we can feed to the scripts inputs and outputs. As an input, we give the path to a text file, which shall create the text and images content of the zine, and as an output we give a the path/filename of our choice. We can also run the scripts with no input nor output, in which case, they take as default parameters the readme text from the text/ folder and produce an output to either of the folders covers, colophones, body, or zines, depending on which script we are running every time. + +# Get the code! +## Download the source code +It is being under active development by the author and can be cloned and/or downloaded from https://git.systerserver.net/mara/zine_maker. +To download the project, near the top of the gitlab page, click on the download icon next to "Find file". +You can choose which type of archived folder you want, and then open it in your filesystem, by right clicking the archived folder, or from the terminal: +``` +tar -xvf zine_maker.tar -C /home/user/destination # for tarred file +unzip zinme_maker.zip -d /home/user/destination # for zipped file +``` ## OR use git clone: ``` @@ -7,9 +17,8 @@ git clone https://zine:DskM_8XxtKt-Wym1xHd1@git.systerserver.net/mara/zine_maker cd zine_maker ``` - -## Requirements -You need either python2 or python3 running on the computer +# Requirements +You need python3 running on the computer https://www.python.org/downloads/ And also the pip command @@ -19,57 +28,112 @@ Once these are installed, from within zine_maker run: `pip install -r requirements.txt` -## For merging the cover.pdf, body.pdf and colophon.pdf there are many pdf merger tools, -one that is command line based is pdfunite +# Miscellaneous +## Fonts +The source code comes with some fonts under the fonts folder. You can use your +fonts of preference by adding them either in the fonts folder and edit the +files cover.py, colophon.py and doc_pdf.py to give the new names. Or add your +absolute font path directly to the python scripts. + +## Text +The input texts should be clean from characters added by some text editors or +Operating Systems. Use the cat command to check your text is ready as input +with: +``` +cat --show-nonprinting input.txt +``` +Symbols such as M-oM-;M or ^M (carriage Return / line feed) need to be removed. +A cool tool for that is dos2unix, which is available as command line, but needs +to be installed: +``` +dos2unix filename +``` +Or with the sed command: +sed -e "s/\r//g" file > newfile + +Extensive info can be find at: +https://www.cyberciti.biz/faq/sed-remove-m-and-line-feeds-under-unix-linux-bsd-appleosx/ + +## About the text style +All the font styling happens in the zine_maker function create_pages(). The +input text is parsed for specific tags or symbols in the begining of the line +and change the font color and size accordingly. We can add more or edit +existing ones, directly in the zine_maker code. + +## For merging the cover, body and colophon +There are many pdf merger tools, one that is command line based is pdfunite http://linux-commands-examples.com/pdfunite -## For shuffling the final pdf and prepare it for printing you need the pdfseparate command +## Before printing +For shuffling the final pdf and prepare it for printing you need the pdfseparate command http://www.linux-commands-examples.com/pdfseparate -it is used inside the shuffle_pdf.py file (see details at the end of this Readme) +it is used inside the shuffle_pdf.py file (see details at the end of this README). -## For making use of images in the script, image magick needs to be installed +## For making use of images in the script +image magick needs to be installed http://www.imagemagick.org/ -## To make the content of the pdf +# Run the code! +## Make the content of the pdf +The default parameters included in the script would create a zine from this +readme: `python doc_pdf.py ` -OR +OR you can experiment with the other sample text found in this repository. `python doc_pdf.py text/images.txt body/images.pdf` -OR add your text file and replace respectively +OR get real and add your own text file and replace respectively the input and +output filenames. `python doc_pdf.py text/.txt body/.pdf` -## To make the cover of the pdf +## Make the cover of the pdf +Same, the default parameters included in the script would create the cover for the zine_maker: `python cover.py` -OR +OR try-out the other cover samples: `python cover.py text/cover.txt covers/cover.pdf` -OR add your text file and replace respectively +OR add your cover text file and replace respectively: `python cover.py text/.txt covers/.pdf` -## To make the colophon of the pdf -`python cover.py ` +## Make the colophon of the pdf +Same, the default parameters included in the script would create the colophon for the zine_maker: +`python colophon.py ` -OR +OR try-out the other colophon samples: -`python cover.py text/colophon.txt colophones/colophon.pdf` +`python colophon.py text/colophon.txt colophones/colophon.pdf` -OR add your text file and replace respectively +OR add your own colophon text file and replace respectively: -`python cover.py text/.txt colophones/.pdf` +`python colophon.py text/.txt colophones/.pdf` +# Make a screen PDF ## For the final pdf - screen version from the terminal run: `pdfunite covers/cover.pdf body/body.pdf colophones/colophon.pdf zines/final.pdf` -## To prepare signatures for printing the zine -`python shuffle_pdf.py zines/final.pdf zines/final_shuffled.pdf` +You shall substitute the file paths to the your own corresponding /path/filenames -## This readme as a generated zine: -open the file `zines/zinemaker.pdf` \ No newline at end of file +# Make a printable zine +## To prepare signatures for printing the zine +The default parameters take the zines/zinemaker_screen.pdf and output +zinemaker{random_number}.pdf + +Run it for your own pdf files as following: +`python shuffle_pdf.py` zines/.pdf zines/.pdf` + +In the printer settings opt-in for the following settings: +- A4 Landscape +- Two pages per side +- Double side - short edge + +./thumbs/printer_settings.png + +## See this readme as the generated zine: +open the file zines/zinemaker.pdf