From cef1c9dcec048f1fd9ea9968f8f3e1846ff9d6da Mon Sep 17 00:00:00 2001 From: mathdesc Date: Fri, 17 Aug 2012 10:07:24 -0400 Subject: Disabling filecheck should not be possible --- .../discussion.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn (limited to 'doc') diff --git a/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn b/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn new file mode 100644 index 000000000..6684d79ee --- /dev/null +++ b/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn @@ -0,0 +1,18 @@ +Disabling of filecheck is not actually possible because btw it cause the attachment.pm to malfunction and +any of pagespec that could contain a *mimetype* condition. + +attachment.pm imports "statically" filecheck so actually disabling it should be *interdicted* . + +
+sub import {
+        add_underlay("attachment");
+        add_underlay("javascript");
+        add_underlay("jquery");
+        hook(type => "getsetup", id => "attachment", call => \&getsetup);
+        hook(type => "checkconfig", id => "attachment", call => \&checkconfig);
+        hook(type => "formbuilder_setup", id => "attachment", call => \&formbuilder_setup);
+        hook(type => "formbuilder", id => "attachment", call => \&formbuilder, last => 1);
+        IkiWiki::loadplugin("filecheck");
+}
+
+ -- cgit v1.2.3 From a922fdb6000c971a2c1f7aa6a9cceb8a2a16804a Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmKyeW2G4jjSdnL1m6kPPtAiGFUBsnYCfY" Date: Fri, 17 Aug 2012 18:06:34 -0400 Subject: --- .../What__39__s_the_difference_between_tag_and_taglink__63__.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn (limited to 'doc') diff --git a/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn b/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn new file mode 100644 index 000000000..5ebc3e257 --- /dev/null +++ b/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn @@ -0,0 +1,5 @@ +It occurred to me the difference between tag and taglink, as described in http://ikiwiki.info/ikiwiki/directive/tag/ is just that the latter enable the option to have a displayed form of the tag different from the tag itself, e.g. a tag `foo` can be displayed as `bar` using + + \[\[!taglink foo|bar\]\] + +Is that it? -- cgit v1.2.3 From fd4312866be4d44751391deb50e6851987754b6a Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmKyeW2G4jjSdnL1m6kPPtAiGFUBsnYCfY" Date: Fri, 17 Aug 2012 18:08:32 -0400 Subject: --- .../What__39__s_the_difference_between_tag_and_taglink__63__.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn b/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn index 5ebc3e257..4fee07db4 100644 --- a/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn +++ b/doc/forum/What__39__s_the_difference_between_tag_and_taglink__63__.mdwn @@ -1,5 +1,9 @@ It occurred to me the difference between tag and taglink, as described in http://ikiwiki.info/ikiwiki/directive/tag/ is just that the latter enable the option to have a displayed form of the tag different from the tag itself, e.g. a tag `foo` can be displayed as `bar` using - \[\[!taglink foo|bar\]\] + \[[!taglink foo|bar]] + +while with tag you can only display the tag `foo` as itself + + \[[!tag foo]] Is that it? -- cgit v1.2.3 From 529344318c0b79072befc811dcf5d8b6a5f15785 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmKyeW2G4jjSdnL1m6kPPtAiGFUBsnYCfY" Date: Fri, 17 Aug 2012 21:31:06 -0400 Subject: --- doc/plugins/sidebar/discussion.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/plugins/sidebar/discussion.mdwn b/doc/plugins/sidebar/discussion.mdwn index 42bc6a3e1..245fb1544 100644 --- a/doc/plugins/sidebar/discussion.mdwn +++ b/doc/plugins/sidebar/discussion.mdwn @@ -8,3 +8,5 @@ I needed to include inline directives into sidebars at different site sections t Then I came across the tip to include the quick=yes variable with the inline directive, where it is described as not showing page titles included with the meta-directive, and I thought, well if it lets me have it only this way, maybe I can restrain from using meta titles. But to my surprise, even with the quick=yes variable included into the inline directive in the sidebars meta titles still are shown, no more forced rebuild when editing via cgi, which is amazing, but maybe it should be noted somewhere. One more time ikiwiki showed its bright face, thank you. --Boris + +How to use a different sidebar and its own CSS for SubPages under a certain directory? -- Joe -- cgit v1.2.3 From 963a4673e3fb20d0a415d1bf4a9e428c6488516e Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmKyeW2G4jjSdnL1m6kPPtAiGFUBsnYCfY" Date: Fri, 17 Aug 2012 21:37:15 -0400 Subject: --- ...bar_and_SubPage_sidebar_differently_using_CSS__63__.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/How_to_style_main_sidebar_and_SubPage_sidebar_differently_using_CSS__63__.mdwn (limited to 'doc') diff --git a/doc/forum/How_to_style_main_sidebar_and_SubPage_sidebar_differently_using_CSS__63__.mdwn b/doc/forum/How_to_style_main_sidebar_and_SubPage_sidebar_differently_using_CSS__63__.mdwn new file mode 100644 index 000000000..09cf01435 --- /dev/null +++ b/doc/forum/How_to_style_main_sidebar_and_SubPage_sidebar_differently_using_CSS__63__.mdwn @@ -0,0 +1,13 @@ +How to style main sidebar and SubPage sidebar differently using CSS? + +I have a main sidebar + + /sidebar.mdwn + +and a SubPage sidebar + + /blog/sidebar.mdwn + +How to style the two differently using CSS? + +For example I'd like the sidebar shown on any page inside /blog to have a blue border and any other page outside of /blog to have a sidebar with red border. -- cgit v1.2.3 From e4e0ee919ec702489479da9f61dfdbea3ba3bdf6 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawk_MMtLPS7osC5MjX00q2ATjvvXPWqm0ik" Date: Sat, 18 Aug 2012 02:30:56 -0400 Subject: Added a comment --- .../comment_1_0d3acf67f3c35f8c4156228f96dcd975._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/wmd_editor_double_preview/comment_1_0d3acf67f3c35f8c4156228f96dcd975._comment (limited to 'doc') diff --git a/doc/forum/wmd_editor_double_preview/comment_1_0d3acf67f3c35f8c4156228f96dcd975._comment b/doc/forum/wmd_editor_double_preview/comment_1_0d3acf67f3c35f8c4156228f96dcd975._comment new file mode 100644 index 000000000..cc8c9ac43 --- /dev/null +++ b/doc/forum/wmd_editor_double_preview/comment_1_0d3acf67f3c35f8c4156228f96dcd975._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawk_MMtLPS7osC5MjX00q2ATjvvXPWqm0ik" + nickname="micheal" + subject="comment 1" + date="2012-08-18T06:30:56Z" + content=""" +Any Ideas how to do this? +"""]] -- cgit v1.2.3 From 41a54aa700ef20825b2a8ea76cdc057dc32825c4 Mon Sep 17 00:00:00 2001 From: mathdesc Date: Sat, 18 Aug 2012 10:21:54 -0400 Subject: Sugesstion usgin decode_utf8 instead of escaping them --- doc/plugins/headinganchors/discussion.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc') diff --git a/doc/plugins/headinganchors/discussion.mdwn b/doc/plugins/headinganchors/discussion.mdwn index 151af8d92..eaf111f4e 100644 --- a/doc/plugins/headinganchors/discussion.mdwn +++ b/doc/plugins/headinganchors/discussion.mdwn @@ -31,3 +31,19 @@ A patch to make it more like MediaWiki: --Changaco + +---- + +I think using this below would let the source html clear for the browser +without changing the render: + + #use URI::Escape + . + . + + #$str = uri_escape_utf8($str); + $str = Encode::decode_utf8($str); + #$str =~ s/%/./g; + +Don't you think ? +[[mathdesc]] -- cgit v1.2.3 From 556c25d6ee43fe6d2303cb5830ab41ca65e2ccc3 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 18 Aug 2012 19:40:36 +0200 Subject: TODO++, patch attached --- doc/todo/ease_archivepage_styling.mdwn | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 doc/todo/ease_archivepage_styling.mdwn (limited to 'doc') diff --git a/doc/todo/ease_archivepage_styling.mdwn b/doc/todo/ease_archivepage_styling.mdwn new file mode 100644 index 000000000..12ae9a3ff --- /dev/null +++ b/doc/todo/ease_archivepage_styling.mdwn @@ -0,0 +1,58 @@ +Hi! Please apply the following [[patch]] to make the +`archivepage.tmpl` template more semantic and easier to style with +a local CSS: + + From 4e5cc0d9e5582f20df9f26dd5b1937ead0b46827 Mon Sep 17 00:00:00 2001 + From: intrigeri + Date: Sat, 18 Aug 2012 10:34:36 +0200 + Subject: [PATCH] Ease archivepage styling by using named classes, move + styling to the CSS. + + --- + doc/style.css | 4 ++++ + templates/archivepage.tmpl | 8 ++++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + + diff --git a/doc/style.css b/doc/style.css + index 6e2afce..5fb4100 100644 + --- a/doc/style.css + +++ b/doc/style.css + @@ -202,6 +202,10 @@ div.recentchanges { + margin-top: 1em; + } + + +.archivepagedate { + + font-style: italic; + +} + + + .error { + color: #C00; + } + diff --git a/templates/archivepage.tmpl b/templates/archivepage.tmpl + index 93bdd9c..3e0bd9b 100644 + --- a/templates/archivepage.tmpl + +++ b/templates/archivepage.tmpl + @@ -1,10 +1,10 @@ + -

+ +

+ +
+ +
+
+ - + + + Posted + + by + @@ -15,5 +15,5 @@ by + + + + - + -

+ + + +
+ -- + 1.7.10.4 + -- cgit v1.2.3 From 1b7dc469b3217a1662235bc030cb4932e3b266d5 Mon Sep 17 00:00:00 2001 From: mathdesc Date: Sat, 18 Aug 2012 14:27:32 -0400 Subject: Added a comment: For lighttpd with mod_magnet --- ...ent_1_aa03c337b31d7acb95761eb51caab1ef._comment | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 doc/forum/missing_pages_redirected_to_search-SOLVED/comment_1_aa03c337b31d7acb95761eb51caab1ef._comment (limited to 'doc') diff --git a/doc/forum/missing_pages_redirected_to_search-SOLVED/comment_1_aa03c337b31d7acb95761eb51caab1ef._comment b/doc/forum/missing_pages_redirected_to_search-SOLVED/comment_1_aa03c337b31d7acb95761eb51caab1ef._comment new file mode 100644 index 000000000..eac5dc165 --- /dev/null +++ b/doc/forum/missing_pages_redirected_to_search-SOLVED/comment_1_aa03c337b31d7acb95761eb51caab1ef._comment @@ -0,0 +1,44 @@ +[[!comment format=mdwn + username="mathdesc" + subject="For lighttpd with mod_magnet" + date="2012-08-18T18:27:32Z" + content=""" +Same can be done for lighttpd via a lua script (said rewrite.lua) using *mod_magnet* than need to be installed and +called in your conf like this : + +
+# error-handler for status 404                                         
+$HTTP[\"url\"] =~ \"^/mysite/\" { 
+magnet.attract-physical-path-to = ( server.document-root + \"/rewrite.lua\" )
+}
+
+ +Ref : +[[mod_magnet docs|http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModMagnet]] + + + +
+
+  function removePrefix(str, prefix)    
+        return str:sub(1,#prefix+1) == prefix..\"/\" and str:sub(#prefix+2)
+  end
+
+
+
+   attr = lighty.stat(lighty.env[\"physical.path\"])
+   local prefix = '/mysite'
+   if (not attr) then
+        -- we couldn't stat() the file 
+        -- let's generate a xapian query with it
+        new_uri =removePrefix(lighty.env[\"uri.path\"], prefix)
+        print (\"page not found : \" .. new_uri .. \" asking xapian\")
+        lighty.env[\"uri.path\"] = \"/mysite/ikiwiki.cgi\"    
+        lighty.env[\"uri.query\"] = \"P=\" .. new_uri  
+        lighty.env[\"physical.rel-path\"] = lighty.env[\"uri.path\"]
+        lighty.env[\"physical.path\"] = lighty.env[\"physical.doc-root\"] .. lighty.env[\"physical.rel-path\"]
+    end
+
+ +Hope this is useful to you :) +"""]] -- cgit v1.2.3 From db0dea38c6923353072efb805d5a07aa31f2b5d9 Mon Sep 17 00:00:00 2001 From: mathdesc Date: Sat, 18 Aug 2012 20:07:22 -0400 Subject: Filecheck hacking and measures ... nasty --- .../discussion.mdwn | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) (limited to 'doc') diff --git a/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn b/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn index 6684d79ee..d0582cbff 100644 --- a/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn +++ b/doc/bugs/Slow_Filecheck_attachments___34__snails_it_all__34__/discussion.mdwn @@ -1,3 +1,4 @@ +##Foreword : Disabling of filecheck is not actually possible because btw it cause the attachment.pm to malfunction and any of pagespec that could contain a *mimetype* condition. @@ -16,3 +17,116 @@ sub import { } +---- + +## How bad is it ? + +So I tried on three pages to inline !mimetype(image/*) while I allowed attachment of mimetype(image/*) + +My profiling tests in the bug report shows that most of the time is spend in the "Fallback using file" block code, +I tried to comment that block and see how it'll perform. Obviously this is much much faster ... but is the mimetype +discovered using only *File::MimeInfo* ? + + +Dumping some strings before return to STDERR, rebuilding . This is just a [[!toggle id="code-test" text="dumpdebug adding"]] + +[[!toggleable id="code-test" text=""" +
+sub match_mimetype ($$;@) {
+        my $page=shift;
+        my $wanted=shift;
+
+        my %params=@_;
+        my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page});
+        if (! defined $file) {
+                return IkiWiki::ErrorReason->new("file does not exist");
+        }
+
+        # Get the mime type.
+        #
+        # First, try File::Mimeinfo. This is fast, but doesn't recognise
+        # all files.
+        eval q{use File::MimeInfo::Magic};
+        my $mimeinfo_ok=! $@;
+        my $mimetype;
+        print STDERR " --- match_mimetype (".$file.")\n";
+        if ($mimeinfo_ok) {
+                my $mimetype=File::MimeInfo::Magic::magic($file);
+        }
+
+        # Fall back to using file, which has a more complete
+        # magic database.
+        #if (! defined $mimetype) {
+        #       open(my $file_h, "-|", "file", "-bi", $file);
+        #       $mimetype=<$file_h>;
+        #       chomp $mimetype;
+        #       close $file_h;
+        #}
+
+        if (! defined $mimetype || $mimetype !~s /;.*//) {
+                # Fall back to default value.
+                $mimetype=File::MimeInfo::Magic::default($file)
+                        if $mimeinfo_ok;
+                if (! defined $mimetype) {
+                        $mimetype="unknown";
+                }
+        }
+
+        my $regexp=IkiWiki::glob2re($wanted);
+        if ($mimetype!~$regexp) {
+                 print STDERR " xxx MIME unknown ($mimetype - $wanted - $regexp ) \n";
+                return IkiWiki::FailReason->new("file MIME type is $mimetype, not $wanted");
+        }
+        else {
+                print STDERR " vvv MIME found\n";
+                return IkiWiki::SuccessReason->new("file MIME type is $mimetype");
+        }
+}
+
+"""]] + +The results dump to stderr (or a file called... 'say *mime*) looks like this : +
+--- match_mimetype (/usr/share/ikiwiki/attachment/ikiwiki/jquery.fileupload-ui.js)
+ xxx MIME unknown (text/plain - image/* - (?i-xsm:^image\/.*$) )
+ --- match_mimetype (/usr/share/ikiwiki/locale/fr/directives/ikiwiki/directive/fortune.mdwn)
+ xxx MIME unknown (text/plain - image/* - (?i-xsm:^image\/.*$) )
+ --- match_mimetype (/usr/share/ikiwiki/locale/fr/basewiki/shortcuts.mdwn)
+ xxx MIME unknown (text/plain - image/* - (?i-xsm:^image\/.*$) 
+ --- match_mimetype (/usr/share/ikiwiki/smiley/smileys/alert.png)
+ xxx MIME unknown (application/octet-stream - image/* - (?i-xsm:^image\/.*$) )
+ --- match_mimetype (/usr/share/ikiwiki/attachment/ikiwiki/images/ui-bg_flat_75_ffffff_40x100.png)
+ xxx MIME unknown (application/octet-stream - image/* - (?i-xsm:^image\/.*$) 
+
+ +--- prepend signals the file on analysis
+xxx prepend signals a returns failure : mime is unknown, the match is a failure
+vvv prepend signals a return success.
+ + +This is nasty-scary results ! Something missed me or this mime-filecheck is plain nuts ? + +*Question 1* : How many files have been analysed : **3055** (yet on a tiny tiny wiki) +
grep "^ --- " mime | wc -l
+3055
+
+ +*Question 2* : How many time it fails : *all the time* +
+ grep "^ xxx " mime | wc -l
+3055
+
+ +*Question 1bis* : Doh btw , how many files have been re-analysed ? ** 2835 ** OMG !! +
grep "^ --- " mime | sort -u | wc -l
+220
+
+ +## Conclusion + +- Only the system command *file -bi* works. While it is **should** be easy on the cpu , it's also hard on the I/O -> VM :( +- Something nasty with the mime implementation and/or my system configuration -> Hints ? :D +- Need to cache during the rebuild : a same page needs not being rechecked for its mime while it's locked ! + + +--mathdesc -- cgit v1.2.3