diff options
author | Zhiming Wang <zmwangx@gmail.com> | 2016-01-08 16:34:54 -0800 |
---|---|---|
committer | Zhiming Wang <zmwangx@gmail.com> | 2016-01-08 16:34:54 -0800 |
commit | 9ba9fd365cbed597388e33829d3b19c29cc8b6f0 (patch) | |
tree | 3805bb96190326c0e6039e3c5df2d998636484eb /pyblog | |
parent | a7cc274e2fa2f4cd73ab3245ca2e38c7ffd47293 (diff) | |
download | my_new_personal_website-9ba9fd365cbed597388e33829d3b19c29cc8b6f0.tar.xz my_new_personal_website-9ba9fd365cbed597388e33829d3b19c29cc8b6f0.zip |
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.
Diffstat (limited to 'pyblog')
-rwxr-xr-x | pyblog | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -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) |