From 8a901ad49c12bb5bde9afb6fe7ce36ab2fb83d13 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sun, 2 Nov 2008 05:23:25 -0500 Subject: Thoughts --- doc/todo/syntax_highlighting.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index bb1c84f02..645dd56bc 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -32,6 +32,10 @@ pages, as well as doing syntax highlighting as a preprocessor directive we could use an external plugin..) * Currently no single plugin supports both modes of operation (directive and whole source file to page). + + > This is now fixed by the [[ikiwiki/directive/format]] directive for all + > whole-source-file plugins, right? + * Nothing seems to support [[wiki-formatted_comments|wiki-formatted_comments_with_syntax_plugin]] inside source files. Doing this probably means post-processing the @@ -45,6 +49,17 @@ pages, as well as doing syntax highlighting as a preprocessor directive One approach that's also been requested for eg, [[plugins/contrib/mediawiki]] is to allow controlling which linkification types a page type can have on it. + + > The previous two points seem to be related. One thought: instead of + > getting the source from the `content` parameter, the plugin could + > re-load the page source. That would stop directives/links from + > being processed in the source. As noted above, comments + > could then be parsed for directives/links later. + > + > Would it be worth adding a `nodirectives` option when registering + > an htmlize hook that switches off directive and link processing before + > generating the html for a page? + * The whole-file plugins all get confused if there is a `foo.c` and a `foo.h`. This is trivially fixable now by passing the keepextension option when registering the htmlize hooks, though. @@ -61,6 +76,11 @@ 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 + > 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... + ## format directive Rather than making syntax highlight plugins have to provide a preprocessor -- cgit v1.2.3 From 98a5bd23d3004c36b16ccdcdb968ff50ee35f802 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sun, 2 Nov 2008 05:47:19 -0500 Subject: Add patch --- doc/todo/syntax_highlighting.mdwn | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'doc/todo') 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 -- cgit v1.2.3 From d93b509eeeeda80e9d6cb985186640a3902aa199 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Sun, 2 Nov 2008 18:56:12 -0500 Subject: Note about prefix_directives --- doc/todo/New_preprocessor_directive_syntax/discussion.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn index dda1ff5e9..fd104cf6b 100644 --- a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn +++ b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn @@ -1,2 +1,12 @@ Err, is this really fixed in 2.21? I can't find it anywhere in 2.32.3 (debian unstable) + +----- + +I just did a `--dumpsetup` with the current version from the Git repository +and the default option is + + # use '!'-prefixed preprocessor directives? + prefix_directives => 0, + +My impression was that this should be enabled by default now. --[[JasonBlevins]] -- cgit v1.2.3 From 1a4c6b5fcf0fa36d0368c8294c7629c850dab676 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 3 Nov 2008 01:33:33 +0100 Subject: notes and wiki-gardening about pagetitle vs. meta title Signed-off-by: intrigeri --- doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn | 9 +++++++++ doc/todo/using_meta_titles_for_parentlinks.html | 6 ++++++ 2 files changed, 15 insertions(+) (limited to 'doc/todo') diff --git a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn index a30ab0fa3..77c86eba1 100644 --- a/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn +++ b/doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn @@ -1,3 +1,12 @@ The `IkiWiki::pagetitle` function does not respect title changes via `meta.title`. It really should, so that links rendered with `htmllink` get the proper title in the link text. --[[madduck]] + +> Agreed. [[todo/using_meta_titles_for_parentlinks]] contains a beginning of +> solution. A few quick notes about it: + +> - Using inline would avoid the redefinition + code duplication. +> - A few plugins would need to be upgraded. +> - It may be necessary to adapt the testsuite in `t/pagetitle.t`, as well. + +> --[[intrigeri]] diff --git a/doc/todo/using_meta_titles_for_parentlinks.html b/doc/todo/using_meta_titles_for_parentlinks.html index 651b7fa0f..d04e5a300 100644 --- a/doc/todo/using_meta_titles_for_parentlinks.html +++ b/doc/todo/using_meta_titles_for_parentlinks.html @@ -114,3 +114,9 @@ diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki + +

+This is actually a duplicate for +[[bugs/pagetitle_function_does_not_respect_meta_titles]], where I'm +following up a bit. --[[intrigeri]] +

\ No newline at end of file -- cgit v1.2.3 From 75603b4082f43f87802eab8c3739eff92a634453 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 3 Nov 2008 01:42:44 +0100 Subject: response Signed-off-by: intrigeri --- doc/todo/New_preprocessor_directive_syntax/discussion.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn index fd104cf6b..f6c0fc0ec 100644 --- a/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn +++ b/doc/todo/New_preprocessor_directive_syntax/discussion.mdwn @@ -10,3 +10,10 @@ and the default option is prefix_directives => 0, My impression was that this should be enabled by default now. --[[JasonBlevins]] + +> As stated in `debian/NEWS`: +>> For backward compatibility with existing wikis, +>> refix_directives currently defaults to false. In ikiwiki 3.0, +>> prefix_directives will default to true [...] +> --[[intrigeri]] + -- cgit v1.2.3 From 4dc4c9586dbae352c27cd316374fbf0e1db1d082 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Nov 2008 13:21:07 -0500 Subject: maintain list --- doc/todo/syntax_highlighting.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn index 5df185705..97526bae6 100644 --- a/doc/todo/syntax_highlighting.mdwn +++ b/doc/todo/syntax_highlighting.mdwn @@ -23,6 +23,8 @@ pages, as well as doing syntax highlighting as a preprocessor directive * [[sourcecode|todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion]] also uses src-highlight, and operates on whole source files. Updated to work with the fix for [[bugs/multiple_pages_with_same_name]]. Untested with files with no extension, e.g. `Makefile`. +* [[user/jrblevin]]'s code plugin uses src-highlight, and supports both + while file and directive use. ## General problems -- cgit v1.2.3