> (On a side note, the current implementation in master is buggy because `content` returns the rendered HTML while the current summary generation code expects markdown)

Right, in looking over your code I noticed the implementation was not really correct. I also noticed that any mustache syntax in the page being summarized will not work as expected because it's not being rendered in the same context as if it was a "normal page view". This will make more sense in a second ..