Skip to content

Commit

Permalink
working on small printing details
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hammant committed Mar 4, 2017
1 parent 6d2d612 commit ece8d26
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion content/book/index.md
Expand Up @@ -7,7 +7,7 @@ weight: 132
The TrunkBasedDevelopment.com site transformed into book, via scripts:

* [English PDF](https://book.trunkbaseddevelopment.com/trunk_based_development_book.pdf) - interactive
* [English PDF](https://book.trunkbaseddevelopment.com/trunk_based_development_book_printable.pdf) - printable (links changed to footnotes)
* [English PDF](https://book.trunkbaseddevelopment.com/trunk_based_development_book_printable.pdf) - printable with all links changed to footnotes (non interactive)
* [English MOBI](https://book.trunkbaseddevelopment.com/trunk_based_development_book.mobi) - for Amazon's Kindle
* [English EPUB](https://book.trunkbaseddevelopment.com/trunk_based_development_book.epub) - for iBooks, Google Books, Nook, and others

Expand Down
11 changes: 7 additions & 4 deletions content/publications/index.md
Expand Up @@ -4,7 +4,9 @@ title: Publications
weight: 131
---

# Books promoting Trunk-Based Development
## Books promoting Trunk-Based Development

<hr/>

## Continuous Integration (June 29, 2007)

Expand Down Expand Up @@ -90,8 +92,9 @@ Translations: <a href="http://www.amazon.cn/gp/product/B005V9BB1M?tag=contindeli
<br clear="all"/>
</div>

## Reports promoting Trunk-Based Development

# Reports promoting Trunk-Based Development
<hr/>

## More Engineering, Less Dogma (Oct 18, 2013)

Expand Down Expand Up @@ -133,7 +136,7 @@ Translations: <a href="http://www.amazon.cn/gp/product/B005V9BB1M?tag=contindeli
version control of everything required to reproduce production environments<span style="font-size: 120%">&rdquo;</span>
<br/>by Puppet Labs
<br/>
<a href="https://puppet.com/resources/white-paper/2015-state-devops-report"><strong>Puppet's download form</strong></a>
<a href="https://puppet.com/resources/white-paper/2015-state-devops-report"><strong>Puppet's download form for the report</strong></a>
</p>
<br clear="all"/>
</div>
Expand All @@ -155,7 +158,7 @@ Translations: <a href="http://www.amazon.cn/gp/product/B005V9BB1M?tag=contindeli
but it is: The clue is in the word 'integration.'<span style="font-size: 120%">&rdquo;</span>
<br/>by Puppet Labs
<br/>
<a href="https://puppet.com/resources/white-paper/2016-state-of-devops-report"><strong>Puppet's download form</strong></a>
<a href="https://puppet.com/resources/white-paper/2016-state-of-devops-report"><strong>Puppet's download form for the report</strong></a>
</p>
<br clear="all"/>
</div>
Expand Down
18 changes: 16 additions & 2 deletions footer_refs.py
Expand Up @@ -44,9 +44,9 @@
subchap = href[href.index("#")+1:]
sub_chapters = json.loads(open(file).read())
try:
a.replace_with(BeautifulSoup("<span><i>"+a.text+"</i><sup>[ch: "+sub_chapters['h2s'][subchap]+"]</sup></span>", "html.parser"))
a.replace_with(BeautifulSoup("<span><i>"+a.text+"</i><sup>[ch: " + sub_chapters['h2s'][subchap] + "]</sup></span>", "html.parser"))
except KeyError:
print str(a)
print str(a) + " -->" + subchap + "<"
raise

open(sys.argv[1], 'wb').write(str(soup))
Expand All @@ -56,4 +56,18 @@
soup = BeautifulSoup(open(sys.argv[1]).read(), "html.parser")
for a in soup.find_all("a"):
a.replace_with(BeautifulSoup("<span><strong>"+a.text+"</strong> ["+a['href']+"]</span>", "html.parser"))

open(sys.argv[1], 'wb').write(str(soup))

# Reload soup again for some reason.

soup = BeautifulSoup(open(sys.argv[1]).read(), "html.parser")
sub_chapters = json.loads(open(sys.argv[1].replace(".html", ".json")).read())
h2_ix = 0
for h2 in soup.findAll('h2'):
print "h2 " + h2.text
if 'references-elsewhere' not in str(h2) and 'Books promoting' not in str(h2) and 'Reports promoting' not in str(h2):
h2_ix += 1
h2.string = sub_chapters['ch'] + "." + str(h2_ix) + ": " + h2.text

open(sys.argv[1], 'wb').write(str(soup))
2 changes: 1 addition & 1 deletion tobook.sh
Expand Up @@ -5,7 +5,7 @@ function normalize_index_file_names {
}

function convert_to_book {
ebook-convert toc.html "../book/trunk_based_development_book$1" --page-breaks-before "//h:h1" --chapter "//h1" \
ebook-convert toc.html "../book/trunk_based_development_book$1" --page-breaks-before "//h:h1" --chapter "//h1" --max-toc-links 0 \
--breadth-first "$2" "$3" --publisher=trunkbaseddevelopment.com --language=en --title "Trunk Based Development" \
--authors "Paul Hammant & Steve Smith" --pubdate "$PBDT" --cover ../book_cover.jpg
}
Expand Down
2 changes: 0 additions & 2 deletions toc_number_applier.py
Expand Up @@ -22,8 +22,6 @@
if 'references-elsewhere' not in h2['id']:
h2_ix += 1
ch_breakdown['h2s'][h2['id']] = str(ch) + "." + str(h2_ix)
h2.string = str(ch) + "." + str(h2_ix) + " " + h2.text

ch_breakdown["ch"] = str(ch)

for footer in soup.findAll('footer'):
Expand Down

0 comments on commit ece8d26

Please sign in to comment.