summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://www.cse.unsw.edu.au/~willu/ <http://www.cse.unsw.edu.au/~willu/@web>2008-11-02 05:47:19 -0500
committerJoey Hess <joey@kitenet.net>2008-11-02 05:47:19 -0500
commit98a5bd23d3004c36b16ccdcdb968ff50ee35f802 (patch)
tree39afcfdbd34b782a4d9609ee7ccec18575055fdc
parent8a901ad49c12bb5bde9afb6fe7ce36ab2fb83d13 (diff)
Add patch
-rw-r--r--doc/todo/syntax_highlighting.mdwn21
1 files changed, 19 insertions, 2 deletions
diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn
index 645dd56bc..5df185705 100644
--- a/doc/todo/syntax_highlighting.mdwn
+++ b/doc/todo/syntax_highlighting.mdwn
@@ -76,10 +76,27 @@ pages, as well as doing syntax highlighting as a preprocessor directive
extensions. The workaround is to use a directive on a wiki page, pulling
in the Makefile.
- > I wonder how hard it would be to make a patch where by a file with
+ > I wonder how hard it would be to make a patch whereby a file with
> no `.` in the name, and a name that matches a filetype, and where
> that filetype was registered `keepextension`, then the file is just
- > chosen as the appropriate type...
+ > chosen as the appropriate type. This would allow `Makefile` to
+ > work.
+
+like this:
+
+ diff --git a/IkiWiki.pm b/IkiWiki.pm
+ index 8d728c9..1bd46a9 100644
+ --- a/IkiWiki.pm
+ +++ b/IkiWiki.pm
+ @@ -618,6 +618,8 @@ sub pagetype ($) { #{{{
+
+ if ($page =~ /\.([^.]+)$/) {
+ return $1 if exists $hooks{htmlize}{$1};
+ + } elsif ($hooks{htmlize}{$page}{keepextension}) {
+ + return $page;
+ }
+ return;
+ } #}}}
## format directive