Permalink
Browse files

Add local cover image because Amazon URLs are so unstable. Also, add …

…cover image to every page.
  • Loading branch information...
1 parent 56be794 commit 3e31f380818b5ec2775bf3453af0a332d5b60e0b Mark Pilgrim committed May 12, 2010
Showing with 10 additions and 7 deletions.
  1. BIN i/cover.jpg
  2. +1 −1 index.html
  3. +1 −0 installing-python.html
  4. +1 −0 j/plug.html
  5. +4 −3 publish
  6. +3 −3 strings.html
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -23,7 +23,7 @@ <h1>Dive Into Python 3</h1>
<h2>Table of Contents (<a href=table-of-contents.html>expand</a>)</h2>
-<p style="float:right;width:242px;text-align:center;margin:0 0 0 1.75em"><a style="border:0" href="http://www.amazon.com/gp/product/1430224150?ie=UTF8&amp;tag=diveintomark-20&amp;creativeASIN=1430224150" title="Affiliate link = I earn an extra buck"><em>Also available on dead trees!</em><br><img src=http://ecx.images-amazon.com/images/I/51-59wc2s6L.jpg alt="Dive Into Python 3" width=242 height=300></a>
+<p style="float:right;width:245px;text-align:center;margin:0 0 0 1.75em"><a style="border:0" href="http://www.amazon.com/gp/product/1430224150?ie=UTF8&amp;tag=diveintomark-20&amp;creativeASIN=1430224150" title="Affiliate link = I earn an extra buck"><em>Also available on dead trees!</em><br><img src="i/cover.jpg" alt="Dive Into Python 3" width=245 height=300></a>
<!-- toc -->
<ol start=-1>
View
@@ -8,6 +8,7 @@
.i{list-style:none;margin:0;padding:0}
#which{padding-top:1.75em}
h2,.i>li{clear:both}
+#divingin,#which{clear:none}
</style>
<link rel=stylesheet media='only screen and (max-device-width: 480px)' href=mobile.css>
<link rel=stylesheet media=print href=print.css>
View
@@ -0,0 +1 @@
+<p style='float:right;width:245px;text-align:center;margin:0 0 0 1.75em'><a style='border:0' href='http://www.amazon.com/gp/product/1430224150?ie=UTF8\&amp;tag=diveintomark-20\&amp;creativeASIN=1430224150' title='Affiliate link = I earn an extra buck'><em>Also available on dead trees!</em><br><img src=i/cover.jpg alt='Dive Into Python 3' width=245 height=300></a>
View
@@ -115,21 +115,22 @@ java -jar util/yuicompressor-2.4.2.jar build/dip3.css > build/$revision.css && \
# put CSS inline and remove unused CSS properties on a page-by-page basis
# minimize URLs by stripping "http:" prefix
# add asynchronous Google Analytics script in head (after inline styles)
-echo "inlining CSS, minimizing URLs, adding evil tracking code"
+echo "inlining CSS, minimizing URLs, adding evil tracking code and affiliate links"
ga=`cat j/ga.js`
+plug=`cat j/plug.html`
for f in build/*.html; do
css=`python2.5 util/lesscss.py "$f" "build/$revision.css"` || die "Failed to remove unused CSS"
mobilecss=`python2.5 util/lesscss.py "$f" "build/m-$revision.css"` || die "Failed to remove unused CSS"
printcss=`python2.5 util/lesscss.py "$f" "build/p-$revision.css"` || die "Failed to remove unused CSS"
- sed -i -e "s|<link rel=stylesheet href=dip3.css>|<style>${css}</style>|g" -e "s|<link rel=stylesheet media='only screen and (max-device-width: 480px)' href=mobile.css>|<style>@media screen and (max-device-width:480px){${mobilecss}}</style>|g" -e "s|<link rel=stylesheet media=print href=print.css>|<style>@media print{${printcss}}</style>|g" -e "s|</style><style>||g" -e "s|href=index.html|href=/|g" -e "s|</style>|</style>${ga}|g" "$f" || die "Failed to inline CSS"
+ sed -i -e "s|<link rel=stylesheet href=dip3.css>|<style>${css}</style>|g" -e "s|<link rel=stylesheet media='only screen and (max-device-width: 480px)' href=mobile.css>|<style>@media screen and (max-device-width:480px){${mobilecss}}</style>|g" -e "s|<link rel=stylesheet media=print href=print.css>|<style>@media print{${printcss}}</style>|g" -e "s|</style><style>||g" -e "s|href=index.html|href=/|g" -e "s|</style>|</style>${ga}|g" -e "s|<p id=toc>|${plug}<p id=toc>|g" "$f" || die "Failed to inline CSS"
done
# set file permissions (hg resets these, don't know why)
chmod 755 build/examples build/j build/i build/d && \
chmod 644 build/*.html build/*.css build/*.txt build/*.zip build/examples/* build/examples/.htaccess build/j/* build/j/.htaccess build/i/* build/i/.htaccess build/d/.htaccess build/.htaccess || die "Failed to reset file permissions"
# ship it!
-#die "Aborting without publishing"
+die "Aborting without publishing"
echo -n "publishing"
rsync -essh -a build/d/.htaccess build/*.zip diveintomark.org:~/web/diveintopython3.org/d/ && \
echo -n "." && \
View
@@ -250,13 +250,13 @@ <h2 id=common-string-methods>Other Common String Methods</h2>
<pre class=screen>
<samp class=p>>>> </samp><kbd class=pp>query = 'user=pilgrim&amp;database=master&amp;password=PapayaWhip'</kbd>
-<a><samp class=p>>>> </samp><kbd class=pp>a_list = query.split('&amp;')</kbd> <span class=u>&#x2460;</span></a>
+<a><samp class=p>>>> </samp><kbd class=pp>a_list = query.split('&amp;')</kbd> <span class=u>&#x2460;</span></a>
<samp class=p>>>> </samp><kbd class=pp>a_list</kbd>
<samp class=pp>['user=pilgrim', 'database=master', 'password=PapayaWhip']</samp>
-<a><samp class=p>>>> </samp><kbd class=pp>a_list_of_lists = [v.split('=', 1) for v in a_list]</kbd> <span class=u>&#x2461;</span></a>
+<a><samp class=p>>>> </samp><kbd class=pp>a_list_of_lists = [v.split('=', 1) for v in a_list if '=' in v]</kbd> <span class=u>&#x2461;</span></a>
<samp class=p>>>> </samp><kbd class=pp>a_list_of_lists</kbd>
<samp class=pp>[['user', 'pilgrim'], ['database', 'master'], ['password', 'PapayaWhip']]</samp>
-<a><samp class=p>>>> </samp><kbd class=pp>a_dict = dict(a_list_of_lists)</kbd> <span class=u>&#x2462;</span></a>
+<a><samp class=p>>>> </samp><kbd class=pp>a_dict = dict(a_list_of_lists)</kbd> <span class=u>&#x2462;</span></a>
<samp class=p>>>> </samp><kbd class=pp>a_dict</kbd>
<samp class=pp>{'password': 'PapayaWhip', 'user': 'pilgrim', 'database': 'master'}</samp></pre>

0 comments on commit 3e31f38

Please sign in to comment.