Merge branch 'master' of ssh://git.ikiwiki.info
commit
4c3a2a1357
|
@ -0,0 +1,7 @@
|
|||
During creation the new page with utf-8 codepage and non-Latin characters,
|
||||
Pressing on either `Save Page` or `Preview` button results in
|
||||
> `Error: cannot decode with wide characters at /usr/lib/perl5/vendor_perl/5.16.1/i686-linux/Encode.pm line 215`
|
||||
|
||||
Editing the wiki page with non-Latin characters using webinterface also fails with the same error.
|
||||
Additionally, embedding graphviz graphs non-Latin, leads to he same error.
|
||||
Observed in ikiwiki versions 3.20130904 and version 3.20140102
|
|
@ -0,0 +1,9 @@
|
|||
Hunting down what was generating
|
||||
|
||||
utf8 "\xEB" does not map to Unicode at /usr/share/perl5/IkiWiki.pm line 873, <$in> chunk 1.
|
||||
|
||||
lead me to a call to `utf8::valid`, which lead to http://perldoc.perl.org/utf8.html which says this is an "INTERNAL" function:
|
||||
|
||||
> Main reason for this routine is to allow Perl's testsuite to check that operations have left strings in a consistent state. You most probably want to use `utf8::is_utf8()` instead.
|
||||
|
||||
Apparently the main point of the function is to emit the warning in unit tests - problem is, in the ikiwiki context, the only useful thing to warn about would be the name of the file you're trying to parse, not the name of the source code. Alternatively, since the code does continue on with the data, *not* whining about it might be an option :-) but an actionable message would be better.
|
|
@ -0,0 +1,9 @@
|
|||
[[!comment format=mdwn
|
||||
username="https://www.google.com/accounts/o8/id?id=AItOawlsNmR53i7XzaEwtTVLCAgDPXZ7JvPHQr0"
|
||||
nickname="GI"
|
||||
subject="comment 6"
|
||||
date="2014-01-10T15:57:37Z"
|
||||
content="""
|
||||
Unfortunately the StackOverflow method suggests using pandoc. This has many bad side effects...
|
||||
|
||||
"""]]
|
|
@ -48,3 +48,28 @@ Here is the full code of (a very early version of) my plugin.
|
|||
1
|
||||
|
||||
-- [[Louis|spalax]]
|
||||
|
||||
> Hello,
|
||||
> I managed to replace the tag original `preprocess_tag` function, using a different approach than using `inject`:
|
||||
>
|
||||
> my $orig_preprocess_tag;
|
||||
>
|
||||
> sub import {
|
||||
> IkiWiki::loadplugin("tag");
|
||||
> $orig_preprocess_tag = \&{$IkiWiki::hooks{preprocess}{tag}{call}};
|
||||
> hook(type => "preprocess", id => "tag", call => \&my_preprocess_tag);
|
||||
> }
|
||||
>
|
||||
> And later on, I can call the original `preprocess_tag` function using:
|
||||
>
|
||||
> $orig_preprocess_tag->(...)
|
||||
>
|
||||
> The problem is that I am digging into `IkiWiki.pm` package to extract data from `IkiWiki::hooks`, which is not guaranteed to work in the future, contrary to `inject`.
|
||||
>
|
||||
> Two questions:
|
||||
>
|
||||
> - how ugly is my solution?
|
||||
> - is it possible to use `inject` to replace the `IkiWiki::Plugin::tag::preprocess_tag` function?
|
||||
>
|
||||
> -- [[Louis|spalax]]
|
||||
|
||||
|
|
|
@ -90,3 +90,37 @@ Here is a [[patch]], for both code and documentation.
|
|||
"""]]
|
||||
|
||||
-- [[Louis|spalax]]
|
||||
|
||||
> Hello,
|
||||
> do not accept my patch: it is an ugly hack that works for me, but its too narrow to be merged in IkiWiki:
|
||||
>
|
||||
> - it assumes the [[ikiwiki/directive/pagestats]] directive only deals with tags, which is wrong;
|
||||
> - such a feature (allowing displaying tags using their title), if enabled, should be enabled for the [[plugins/tag]] plugin (and maybe other plugins [[I have in mind|users/spalax]]) as well.
|
||||
>
|
||||
> I cannot manage to find a solution to my problem that suits me.
|
||||
>
|
||||
> # My problem
|
||||
>
|
||||
> On two sites I maintain using IkiWiki, I have tags that:
|
||||
>
|
||||
> - have special characters in it (like [[·|http://en.wikipedia.org/wiki/Interpunct]]) that generate ugly URLs;
|
||||
> - have subtags (e.g. `math/calculus`, `math/algebra`, `physics/mechanic` etc.).
|
||||
>
|
||||
> That is, having [[ikiwiki/directive/taglink]] or [[ikiwiki/directive/pagestats]] displaying tags using the pagename (that is something derived from the basename of the URL) is not sufficient for me. I would like to be able to display them using their title, their full name (from the `tagbase` parameter), or both.
|
||||
>
|
||||
> # Solution?
|
||||
>
|
||||
> A solution would be to provide a `tagtext` config option, set to one of `page` (use pagename), `title` (use [[ikiwiki/directive/meta]] title), `path` (use path, since the tagbase), `pathtitle` (use path, and use title for each of the subtags); or a boolean `display_tagtitle` and `display_tagpath`, which would handle the way tags are displayed.
|
||||
>
|
||||
> I see at least two drawbacks to this solution:
|
||||
>
|
||||
> - I do not know what would be the default of these options, not to break backward compatibility: [[ikiwiki/directive/taglink]] would suggest `page`, whereas the footer would suggest `path`.
|
||||
> - The [[ikiwiki/directive/pagestats]] directive would need an optional boolean parameter `tag`, to specify whether to use these options or not.
|
||||
>
|
||||
> # *My* problem ?
|
||||
>
|
||||
> I actually wonder if someone else also have this problem: as far as I can see on other sites using IkiWiki and tags, I would not be surprised if others are satisfyed with the current way tags are displayed: I do not remember having seen subtags, or tags in non-English language with weird characters in them.
|
||||
>
|
||||
> So, I wonder whether this discussion would benefit IkiWiki, or if I should just go on with my hack (or maybe a plugin, but I think it would be quite difficult to do, given that the very same function is used to display tags and to uniquely identify them).
|
||||
>
|
||||
> -- [[Louis|spalax]]
|
||||
|
|
Loading…
Reference in New Issue