Skip to content

Commit

Permalink
Lot of visual aspect fixes required for printing the PDF
Browse files Browse the repository at this point in the history
* Fix introduction/readme page
* Use smaller font size
* Switch to DIN-A5
* Center page number
* Fix page pargins
* Remove travis badge
  • Loading branch information
radare committed Aug 21, 2018
1 parent 571d29f commit ee5c807
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ all: node_modules
npm run build
# npm run pdf

pdf:
npm run pdf

node_modules:
mkdir -p node_modules
npm i
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Introduction

[![Build Status](https://travis-ci.org/radare/radare2book.svg?branch=master)](https://travis-ci.org/radare/radare2book)

This book is an updated version (initially by maijin) of the original
radare1 book written by pancake. Which is actively maintained and
This book is an updated version (started by maijin) of the original
radare1 book (written by pancake). Which is actively maintained and
updated by many contributors over the Internet.

Check the Github site to add new contents or fix typos:
Expand All @@ -17,3 +15,4 @@ Gitbook autogenerates HTML/PDF/EPUB/MOBIL versions in here:
* PDF: https://www.gitbook.com/download/pdf/book/radare/radare2book
* Epub: https://www.gitbook.com/download/epub/book/radare/radare2book
* Mobi: https://www.gitbook.com/download/mobi/book/radare/radare2book

6 changes: 6 additions & 0 deletions _layouts/ebook/pdf_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% block body %}
<div class="pdf-footer">
<span>{{ page.section }}</span>
<span class="footer-pages-count"><center>{{ page.num }}</center></span>
</div>
{% endblock %}
25 changes: 23 additions & 2 deletions book.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{
"plugins": ["styled-blockquotes"]
}
"title": "The Official Radare2 Book",
"root": "./",
"readme": null,
"author": "pancake <pancake@nopcode.org>",
"plugins": ["styled-blockquotes", "layout"],
"introduction": {
"path": "./intro.md",
"title": "Introduction"
},
"pdf": {
"toc": true,
"____fontFamily": "Times New Roman",
"fontSize": 8.5,
"pageNumbers": false,
"paperSize": "a5",
"margin": {"top": 40, "left": 30, "right": 30, "bottom": 40 },
"local-test-margin": {"left": -30, "left": 0, "right": 0, "bottom": 0 },
"footerTemplate": "<center> _PAGENUM_ </center>"
},
"layout": {
"footerPath": "_layouts/ebook/pdf_footer.html"
}
}
18 changes: 18 additions & 0 deletions intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Introduction

This book is an updated version (initially by maijin) of the original
radare1 book written by pancake. Which is actively maintained and
updated by many contributors over the Internet.

Check the Github site to add new contents or fix typos:

* Github: https://github.com/radare/radare2book
* Gitbook: https://www.gitbook.com/book/radare/radare2book/details

Gitbook autogenerates HTML/PDF/EPUB/MOBIL versions in here:

* Online: http://radare.gitbooks.io/radare2book/content/
* PDF: https://www.gitbook.com/download/pdf/book/radare/radare2book
* Epub: https://www.gitbook.com/download/epub/book/radare/radare2book
* Mobi: https://www.gitbook.com/download/mobi/book/radare/radare2book

14 changes: 12 additions & 2 deletions styles/pdf.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ pre {
text-align: justify;
}

.endnote {
text-align: center
}

.markdown-section code, .markdown-section pre {
line-height: 0.9;
}
Expand All @@ -18,6 +22,12 @@ img {
margin-right: auto;
}

body {
margin-top: 10px;
.markdown-section h1, h1
{
margin-bottom: 0px;
margin-left: 25px;
}

.page {
padding: 0;
}

0 comments on commit ee5c807

Please sign in to comment.