User:Clàudia/t4pp-fancy-book

From XPUB & Lens-Based wiki

Fancy book

This is an experimental publication made with content gathered on the Internet. The exercise was to transform content from the web into a pdf file. We decided to make an experiment and create a different composition in each page, changing some characters of the content for other characters: bigger and with a different font and background colour.

The following website has been used as content: http://anjagroten.com/

Page of the book I
Page of the book II
Page of the book III

FULL PDF FILE

Recipie

  • Open the Terminal
  • Get the content from a website
  • wget http://anjagroten.com/
  • Using Pandoc, change the format from html to markdown
  • pandoc document.html -f html -t markdown -s -o document.md
  • Change some characters for < span class='a'> WHATEVER YOU WANT TO REPLACE THE CHARACTER FOR
  • sed "s/a/< span class='a'> @ <\/span>/g" document.md > document1.md sed "s/e/< span class='e'> { <\/span>/g" document1.md > document2.md sed "s/k/< span class='k'> * <\/span>/g" document2.md > document3.md sed "s/r/< span class='r'> ??? <\/span>/g" document3.md > document4.md
  • Using Pandoc, convert the document from markdown to html
  • pandoc document4.md -f markdown -t html -s -o document4.html
  • Create a css style sheet editing the class you have insert into span
  • touch style.css echo ".a{color-background:red; color: white; font-size:30pt; font-family:Helvetica;}" >> style.css
  • To finish, using Weasyprint, convert the document from html to pdf, inserting the style.css
  • weasyprint document4.html -s style.css final-document.pdf