From b56e6f07060a6236c616092b49f97a8c5fa5e2c3 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Sat, 10 Aug 2013 04:53:23 -0400 Subject: Rebased onto a new branch. --- doc/plugins/contrib/wc.mdwn | 22 ---------------------- doc/plugins/contrib/wordcount.mdwn | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 doc/plugins/contrib/wc.mdwn create mode 100644 doc/plugins/contrib/wordcount.mdwn (limited to 'doc/plugins/contrib') diff --git a/doc/plugins/contrib/wc.mdwn b/doc/plugins/contrib/wc.mdwn deleted file mode 100644 index fb5a7320e..000000000 --- a/doc/plugins/contrib/wc.mdwn +++ /dev/null @@ -1,22 +0,0 @@ -[[!template id=plugin name=wc author="[[schmonz]]"]] -[[!template id=gitbranch branch=schmonz/wc author="[[schmonz]]"]] -[[!tag type/meta]] -[[!tag patch]] - -This plugin counts words in a page. For a single page, write a -`\[[!wc]]` directive and the word count will be interpolated there. -For a site, add `` to your [[templates]]. - -If [[!cpan HTML::Strip]] is installed, the wordcount will be slightly -more accurate. - -Possible enhancements: - -* Optimize: count words iff the result will be displayed. `sanitize()` - seems like the right place to count. Since it's called well after - `preprocess()`, I can tell whether a directive needs the result, - but since it appears to be called before `pagetemplate()`, I can't - tell whether a template wants to know and possibly skip the - computation. (In other words, if I add `$needed_for_template` - like `$needed_for_directive`, it gets set too late for `sanitize()` - to see.) diff --git a/doc/plugins/contrib/wordcount.mdwn b/doc/plugins/contrib/wordcount.mdwn new file mode 100644 index 000000000..6a90d0ec5 --- /dev/null +++ b/doc/plugins/contrib/wordcount.mdwn @@ -0,0 +1,22 @@ +[[!template id=plugin name=wordcount author="[[schmonz]]"]] +[[!template id=gitbranch branch=schmonz/wordcount author="[[schmonz]]"]] +[[!tag type/meta]] +[[!tag patch]] + +This plugin counts words in a page. For a single page, write a +`\[[!wordcount]]` directive and the word count will be interpolated there. +For a site, add `` to your [[templates]]. + +If [[!cpan HTML::Strip]] is installed, the wordcount will be slightly +more accurate. + +Possible enhancements: + +* Optimize: count words iff the result will be displayed. `sanitize()` + seems like the right place to count. Since it's called well after + `preprocess()`, I can tell whether a directive needs the result, + but since it appears to be called before `pagetemplate()`, I can't + tell whether a template wants to know and possibly skip the + computation. (In other words, if I add `$needed_for_template` + like `$needed_for_directive`, it gets set too late for `sanitize()` + to see.) -- cgit v1.2.3