aboutsummaryrefslogtreecommitdiff
path: root/pyblog (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pyblog: Implement the image size Markdown extensionZhiming Wang2015-12-311-0/+47
|
* pyblog: Correct typosZhiming Wang2015-12-061-2/+2
|
* pyblog: do not overwrite existing file when creating new postZhiming Wang2015-10-151-0/+4
| | | | Fixes #7.
* pyblog: date-display => date_display, and update postsZhiming Wang2015-09-211-3/+3
| | | | Looks slightly more professional.
* pyblog: add --no-verify to git-commit for buildsZhiming Wang2015-09-051-1/+1
| | | | No point in checking for trailing whitespace etc. in builds.
* Self host webfontsZhiming Wang2015-09-051-2/+4
| | | | | Sometimes (e.g., occasionally in China) Google/FontAwesome webfonts might not be available, rendering the whole site unusable.
* pyblog: add post selector for easier editing of existing postsZhiming Wang2015-08-271-0/+213
| | | | | As an added bonus, new post also automatically opens in a text editor now.
* pyblog: change generated commit messageZhiming Wang2015-08-051-1/+1
|
* pyblog: do not keep open .nojekyllZhiming Wang2015-08-021-2/+3
| | | | That will lead to Dropbox constantly syncing the file under preview mode.
* tons of logic and performance improvementsZhiming Wang2015-07-261-12/+10
| | | | The main aim is a more logical DOM structure and more performant CSS.
* pyblog: add postprocessor process_footnote_backlinksZhiming Wang2015-07-241-0/+13
| | | | | | | | | | | | | Add class and variation selector (# U+FE0E: VARIATION SELECTOR-15) to U+21A9: LEFTWARDS ARROW WITH HOOK to fix outstanding font issue of footnote backlinks on mobile. Updated styles accordingly. Trick learned from Daring Fireball. Before: https://i.imgur.com/eUbL1k8.png After: https://i.imgur.com/msv3INn.png
* pyblog: convert each <img> tag in <article> to a link to its originalZhiming Wang2015-07-231-0/+11
|
* pyblog: make HTML postprocessing extensibleZhiming Wang2015-07-231-8/+16
| | | | | | | | Previously there's only one postprocessing function `number_code_lines`, which directly reads an HTML file, and after processing, writes back. Now the reading and writing is handled by a dedicated dispatcher `postprocess_html_file`, which can call multiple postprocessors that operates on a soup object.
* fix line number placementZhiming Wang2015-07-171-3/+3
| | | | | | | | | | | | | | | | | Global font size in each style sheet has been tweaked very carefully so that the precise line height is very close to a whole number of pixels, so that precision alignment using em, which aligns something precise (top: 13.5em) to something inprecise (line heights, with accumulated errors due to rounding in every line), is not lost. Note that Firefox is NOT supported, since each line seems to always occupy one more pixel than the calculated line height. For some reason line numbers in the print view are still rather problematic at a page continuation. In Chrome and Safari, the first two line numbers on a new page tend to overlap, so everything afterwards are off (and on Firefox line numbers do not show up on the second page at all). Anyway, printing shouldn't be a big concern.
* index.html TOC: use <table> instead of <ul>Zhiming Wang2015-07-171-5/+17
| | | | | | | | | | | | For better formatting. The following screenshots illustrate the difference: * https://i.imgur.com/ZfkUpBG.png * https://i.imgur.com/S6cRK00.png I also reduced the indentation on the left of each year's index from 2em to 1em.
* take generator source modification time into accountZhiming Wang2015-07-171-1/+4
| | | | | | | | Regenerate a page if the generator mtime is later than the page's mtime (just like for the template). Previewer still should be relaunched after modification to the generator, since the generator won't be patched until the next run.
* fixes for beautifulsoup4 4.4.0Zhiming Wang2015-07-051-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Explicitly specify the lxml parser to suppress warnings; * Supposedly fix the AttributeError: 'NoneType' object has no attribute 'next_element' issue [1] with BeautifulSoup when finding elements after extracting certain tags. I bet I've encountered that error before, but it seemed to went away somehow. Not this time. Without digging into to much detail (don't have time to file a bug or anything), this fix -- precompile a list of tags to extract, and only extract after done with other processing -- seem to work. * Add .nojekyll to root of build dir (https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/). [1]: Full traceback: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-7-9d3d20b34e0c> in <module>() ----> 1 a.footer /Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in __getattr__(self, tag) 995 # We special case contents to avoid recursion. 996 elif not tag.startswith("__") and not tag=="contents": --> 997 return self.find(tag) 998 raise AttributeError( 999 "'%s' object has no attribute '%s'" % (self.__class__, tag)) /Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in find(self, name, attrs, recursive, text, **kwargs) 1232 criteria.""" 1233 r = None -> 1234 l = self.find_all(name, attrs, recursive, text, 1, **kwargs) 1235 if l: 1236 r = l[0] /Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in find_all(self, name, attrs, recursive, text, limit, **kwargs) 1253 if not recursive: 1254 generator = self.children -> 1255 return self._find_all(name, attrs, text, limit, generator, **kwargs) 1256 findAll = find_all # BS3 1257 findChildren = find_all # BS2 /Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in _find_all(self, name, attrs, text, limit, generator, **kwargs) 527 while True: 528 try: --> 529 i = next(generator) 530 except StopIteration: 531 break /Users/zmwang/.pyenv/versions/3.4.3/lib/python3.4/site-packages/beautifulsoup4-4.4.0-py3.4.egg/bs4/element.py in descendants(self) 1271 while current is not stopNode: 1272 yield current -> 1273 current = current.next_element 1274 1275 # CSS selector code AttributeError: 'NoneType' object has no attribute 'next_element'
* fix font issues: moving back to Droid Sans Mono for codeZhiming Wang2015-06-161-3/+3
| | | | | | | | | | | | | | | | | I just noticed that code font is crazy without Consolas installed (I recently reinstalled my OS and got rid of Office for Mac 2011 — that's probably why). The line numbers are all off (since the line heights are carefully pre-calculated, and fallback fonts of different leadings won't help). Therefore, I'm moving to the quite nice looking and controllable Droid Sans Mono. Isn't as satisfactory as Consolas on the web, but certainly better than Monaco. Note: I originally copied my list Consolas, Monaco, 'Andale Mono', monospace (I added Courier since I like it a lot as the primitive monospace font) from MDN Wiki, but now it looks like a bad choice when I don't have Consolas any more. By the way, MDN Wiki renders line numbers using JS, so at least they are able to calculate the line heights. I'm serving everything statically, so this is a problem.
* pyblog: CDATA text cannot be reusedZhiming Wang2015-06-101-1/+1
| | | | Each lxml.etree._Element.text needs a new CDATA.
* pyblog: use lxml instead of xmlZhiming Wang2015-06-101-38/+7
| | | | | | Specifically lxml.etree instead of xml.etree.ElementTree. This allows CDATA without hack.
* pyblog: fix typo in atom feed subtitleZhiming Wang2015-06-101-1/+2
| | | | | Subtitle was added along with RSS, but I accidentally used <title> instead of <subtitle> for the tag.
* pyblog: implement RSS feedZhiming Wang2015-06-101-23/+204
|
* pyblog: extract script tags from feedsZhiming Wang2015-06-091-0/+3
| | | | Fixes #2.
* pyblog: fix URL formatsZhiming Wang2015-06-091-6/+8
| | | | | Use canonical format for BLOG_HOME, and use urllib.parse.join for safe concatenation.
* pyblog: do not include line-number classes in feedZhiming Wang2015-06-091-0/+3
| | | | | | For one thing, the top attribute is not recommended in feeds (see https://github.com/zmwangx/zmwangx.github.io/issues/2). Also, extracting line numbers (which are useless in feeds) make the feeds smaller.
* pyblog: bug fix in auto retouchZhiming Wang2015-05-221-7/+11
|
* pyblog: smarter auto touchZhiming Wang2015-05-191-15/+16
| | | | Now reading date directly from post.
* add noscript tag for javascript embedded asciicastZhiming Wang2015-05-141-0/+2
|
* pyblog: fix bug in re match object handlingZhiming Wang2015-05-141-3/+3
| | | | Somehow the linter failed to catch the obvious syntax errors.
* add source code line numbersZhiming Wang2015-05-141-0/+36
| | | | | | | | | | The way I handle line numbers and the pre block in general is inspired by the MDN wiki. See, for instance, https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript a screenshot is here: https://i.imgur.com/982TBDc.png Also tweaked other styles, e.g., changed the primary monospace font to Consolas, and slightly tweaked a few old posts.
* pyblog: smarter autotouch in gen_deployZhiming Wang2015-05-131-3/+13
|
* sitemap.xml: correct <lastmod> datetime formatZhiming Wang2015-05-131-3/+5
| | | | | | | | | | | | | | | | | coreutils date --iso-8601=s generates output like 2015-05-13T13:04:24-0700 while the correct format (at least the format Python datetime.datetime.isoformat() prints, and the format Google expects) is 2015-05-13T13:04:24-07:00 Account for this problem. I didn't read the RFC, so not sure.
* add support for lfooter (updated) and top level pages...Zhiming Wang2015-05-131-17/+39
| | | | (other than index.html).
* pyblog: put hard coded string literals into constantsZhiming Wang2015-05-131-20/+43
| | | | | | Configuration constants are configurable at the top of the source file. This is not final: they should be put into a YAML/INI config file in the end.
* try to debug failed buildZhiming Wang2015-05-091-26/+32
| | | | | | | https://travis-ci.org/zmwangx/zmwangx.github.io/builds/61860458 First step in debugging: dump the HTML to see what's missing and how it missed.
* 20150509 storyboard reached 0.1Zhiming Wang2015-05-091-7/+3
| | | | | Also fixed the bugs in pyblog introduced in the last revision and tweaked the theme a bit.
* add requirements.txtZhiming Wang2015-05-071-1/+2
| | | | | | | Also install requirements in .travis.yml. By the way, I explored ways to install Pandoc in a Travis container environment (without sudo), but that's just too hard. Giving up.
* pyblog: implement auto touching in gen_deployZhiming Wang2015-05-071-18/+74
| | | | | | Even after implementing touch, I can't remember to touch a new post before deploying. Now gen_deploy tries to smartly determine the latest post and prompts for touching.
* improve Why Oh My Zsh is completely brokenZhiming Wang2015-05-061-1/+3
|
* fix minor invalid HTML issuesZhiming Wang2015-05-061-1/+1
|
* add sitemap.xml and robots.txtZhiming Wang2015-05-051-2/+46
|
* 20150505 Graceful handling of SIGINT when using Python's multiprocessing.ProcessZhiming Wang2015-05-051-21/+105
| | | | | Also implemented the "touch" action in pyblog, as well as wrote a README.md for the source branch. And some other minor patching.
* add feed icon to footerZhiming Wang2015-05-051-2/+3
| | | | Among other fixes and tweaks.
* pyblog: get preview rightZhiming Wang2015-05-051-81/+36
| | | | | | | | | Apparently I didn't know what I was doing. Stopping the server is such a simple problem, yet I made it so complicated. Handling SIGINT gracefully, on the other hand, is a little bit tricky, due to blocked communication between different processes. Anyway, I've got it covered now.
* pyblog: implement previewZhiming Wang2015-05-051-19/+170
| | | | | | | | | | | | | | Also tweaked icons a bit. Note that this commit doesn't really work: I implemented a "stoppable HTTP Server" here to be stopped when "mother process" receives SIGINT (i.e., KeyboardInterrupt), without realizing that all porcesses get SIGINT. Therefore, the custom server is hardly needed. See http://git.io/vJ9yA for more information. (This implementation has some value tought, that's why I'm committing to keep it in history.)
* pyblog: implement deploy and gen_deployZhiming Wang2015-05-051-11/+150
| | | | Also changed month to short format on the index page.
* 20150505: New blog, new startZhiming Wang2015-05-051-14/+72
| | | | | | | | | | | Also fixed several problems: 1. Rending SVG and making it a clickable link is basically impossible across multiple browsers. I'm now using a pretty good PNG; 2. Implemented new_post in pyblog; 3. Footnotes related updates to the theme.
* handle navigation button and faviconsZhiming Wang2015-05-051-2/+2
| | | | | | | | Note that I'm using an <embed> tag with the svg because if wrapped in <img>, the svg won't render on Safari. After using the <embed> tag, the svg renders on all four major browsers on OS X (Chrome, Safari, Firefox, Opera), and it looks nice on all three but Firefox, in which case it's crappy as fuck.
* convert date metadata field to ISO 8601Zhiming Wang2015-05-051-2/+0
|
* a lot of workZhiming Wang2015-05-051-7/+242
| | | | Mainly generating feed and index.