From 9ba9fd365cbed597388e33829d3b19c29cc8b6f0 Mon Sep 17 00:00:00 2001
From: Zhiming Wang <zmwangx@gmail.com>
Date: Fri, 8 Jan 2016 16:34:54 -0800
Subject: Site design refresh part I

Highlights:

* Change font to Times/Times New Roman + Courier;
* Text slightly darkened across the board to account for the thinner
  Times;
* Eliminate line numbers;
* Use custom highlight.css (based on highlight-css supplied by Pandoc,
  but hightlight more classes when Pandoc falls short, e.g., span.im for
  Python from and import).

Closes #5 because we don't have line numbers anymore.
---
 pyblog | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

(limited to 'pyblog')

diff --git a/pyblog b/pyblog
index 15ac1bd9..7c76377c 100755
--- a/pyblog
+++ b/pyblog
@@ -29,13 +29,13 @@ import sys
 import tempfile
 import time
 import urllib.parse
-import lxml.etree as ET
 
 import blessed
 import bs4
 import colorama
 import dateutil.parser
 import dateutil.tz
+import lxml.etree as ET
 
 ############################# BLOG CONFIGURATIONS ##############################
 # Safe to customize
@@ -606,16 +606,6 @@ def _pre_tag_insert_line_numbers(soup, pre_tag):
         pre_tag.code.append(ln_tag)
 
 
-def number_code_lines(soup):
-    """Insert line numbers to preformatted code blocks."""
-    for pre_tag in soup.find_all("pre"):
-        if ((pre_tag.code is None or "class" not in pre_tag.attrs or
-             not "sourceCode" in pre_tag["class"])):
-            # not really a block of source code
-            continue
-        _pre_tag_insert_line_numbers(soup, pre_tag)
-
-
 # MARKDOWN EXTENSION!
 #
 # See docstring of process_image_sizes for documentation.
@@ -690,7 +680,6 @@ def postprocess_html_file(htmlfilepath):
         soup = bs4.BeautifulSoup(htmlfileobj.read(), "lxml")
 
         # a series of postprocessing (extensible)
-        number_code_lines(soup)
         process_image_sizes(soup)
         link_img_tags(soup)
         process_footnote_backlinks(soup)
-- 
cgit v1.2.1