DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:wikipediasnippet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:wikipediasnippet [2013-04-07 00:24] – made examples clearer achplugin:wikipediasnippet [2023-10-30 22:09] (current) Klap-in
Line 6: Line 6:
 email      : anika@selfthinker.org  email      : anika@selfthinker.org 
 type       : syntax type       : syntax
-lastupdate : 2013-04-06 +lastupdate : 2016-04-07 
-compatible : 2007-06-26, 2008-05-05, 2009-02-14, 2009-12-25 "Lemming"2010-11-07 "Anteater"2011-05-25 "Rincewind"2012-01-25 "Angua"2012-10-13 "Adora Belle""Weatherwax"+compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Hogfather, Igor, Jack Jackrum
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : wikipedia, include tags       : wikipedia, include
  
-downloadurl: http://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/zipball/master +downloadurl: https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/zipball/master 
-bugtracker : http://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/issues +bugtracker : https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/issues 
-sourcerepo : http://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/+sourcerepo : https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet
 donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11071728 donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11071728
 ---- ----
Line 21: Line 21:
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the URL given above. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Syntax and Usage ===== ===== Syntax and Usage =====
Line 52: Line 52:
 ===== Changelog ===== ===== Changelog =====
  
-{{rss>http://github.com/feeds/selfthinker/commits/dokuwiki_plugin_wikipediasnippet/master date}}+{{rss>https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/commits/master.atom date}}
  
 ===== Feedback ===== ===== Feedback =====
Line 106: Line 106:
 ==== Problem with images that start with "//" ==== ==== Problem with images that start with "//" ====
  
-I've a problem with pages like http://en.wikipedia.org/wiki/Modal_logic that have an image in the snippet: the image is of the form ''<nowiki><img src="//..."</nowiki>'' that is an absolute link (on Wikipedia it works, of course (( e.g. ''<nowiki>//upload.wikimedia.org/math/1/2/9/129903ad25d869abdae7434a7a0d0fe4.png</nowiki>''))) but when processed by Dokuwiki it becomes a (broken) relative link.+I've a problem with pages like http://en.wikipedia.org/wiki/Modal_logic that have an image in the snippet: the image is of the form ''<nowiki><img src="//..."</nowiki>'' that is an absolute link. On Wikipedia it works, of coursebut when processed by Dokuwiki it becomes a (broken) relative link.
  
 I propose this fix: to add at line 102 of syntax.php the following code: I propose this fix: to add at line 102 of syntax.php the following code:
Line 119: Line 119:
  
 > I have fixed this in the latest version. However, I also changed the way the articles are retrieved, which (probably) got rid of images altogether. --- [[user>ach|Anika Henke]] //2013/04/06 23:54// > I have fixed this in the latest version. However, I also changed the way the articles are retrieved, which (probably) got rid of images altogether. --- [[user>ach|Anika Henke]] //2013/04/06 23:54//
 +
 +>> Why do you have removed images? I made the example of the page http://en.wikipedia.org/wiki/Modal_logic because here an image (two logic formulas) is an essential part of the info! - [[user>bifazio|Fabrizio]]
 +
 +>>> I didn't deliberately remove images. But the plugin uses a different [[https://en.wikipedia.org/w/api.php?action=help&modules=query%2Bextracts|API functionality]] which just doesn't support any images. So, it was collateral damage I was willing to take as this new functionality is otherwise much better. I just checked and they still don't support images with it. [[https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/commit/de104de6d995aa952398c110a5b64d8f63a7863c|More information regarding this specific change.]] --- [[user>ach|Anika Henke]] //2016-04-07 19:21//
  
 ==== A syntax {{wpXX>}} to select a specific Wikipedia site? ==== ==== A syntax {{wpXX>}} to select a specific Wikipedia site? ====
Line 126: Line 130:
 So my proposal is to add a second syntax <nowiki>{{wpXX></nowiki>//page name//<nowiki>}}</nowiki> where ''XX'' stands for the language (it/en/de etc..). So my proposal is to add a second syntax <nowiki>{{wpXX></nowiki>//page name//<nowiki>}}</nowiki> where ''XX'' stands for the language (it/en/de etc..).
  
-I've tried to implement: I've changed the implementation of both the connectTo() and handle() methods with this code: +[[user>bifazio|Fabrizio]] 
-<code php+   
-  function connectTo($mode) { +P.S.good pluginreally! one of my best favorites
-    $this->Lexer->addSpecialPattern('{{wp(?:\w\w)?>[^}]+}}',$mode,'plugin_wikipediasnippet'); +
-  }+
  
-  function handle($match$state$pos, & $handler) { +> ThanksI have implemented thisbut with a slightly different syntax: ''%%{{wp:it>page name}}%%''. --- [[user>ach|Anika Henke]//2013/04/06 23:54//
-    // remove braces  {{....}} +
-    $match = substr($match, 2, -2); +
-    // separate the command from the link and set the language +
-    list($command, $data) = split('>', $match, 2); +
-    if (strlen($command) == 4) { +
-      $lang = substr($command, 2, 2); +
-    } else { +
-      global $conf; +
-      $lang = $conf['lang']+
-    }+
  
-    return $lang . ':' . trim($data)+>> Ok! Good :---- [[user>bifazio|Fabrizio]]
-  } +
-</code>+
  
-In the render() method I've replaced this code: +==== Issues running locally ====
-<code php> +
-  if ($data) { +
-     global $conf; +
-     $lang $conf['lang']; +
-</code>+
  
-with this+Hello Anika. Really nice plugin. But this plugin doesn't work in local modi. When i'm using it on localhost (127.0.0.1:8800with apache there is the error"//Error: Fetching the article from Wikipedia failed. Could not connect to de.wikipedia.org:80 php_network_getaddresses: getaddrinfo failed: Der angegebene Host ist unbekannt (0).//" Internet connection is active. What i have to do? Thanks in advance.
-<code php> +
-  if ($data+
-    $lang, $data) = split(':', $data, 2)+
-</code>+
  
-It works fine!+--Marcus 2013/07/02
  
-**Warning:** with this specific implementation this syntax :+==== »useHtml-switch not working ====
  
-  {{wpit>page name}}+I always have HTML-wikisnippets. I can uncheck the option in the configuration menu, it also stays unchecked, but it does not have any effect. I always have the HTML-snippets.
  
-is the same of:+Is there anything I could do or try?
  
-  {{wp>it:page name}} + --- //[[|Otto]] 2015/01/30 14:10//
-   +
-I thought that this second syntax was nice.+
  
-[[user>bifazio|Fabrizio]] +> It works for me as intended. Can you give an example syntax which doesn't work? And can you also describe what you expect to see instead? --- [[user>ach|Anika Henke]] //2016-04-07 19:21//
-   +
-P.S.good plugin, really! one of my best favorites+
  
-> Thanks, I have implemented this, but with a slightly different syntax: ''%%{{wp:it>page name}}%%''. --- [[user>ach|Anika Henke]] //2013/04/06 23:54// 
plugin/wikipediasnippet.1365287064.txt.gz · Last modified: 2013-04-07 00:24 by ach

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki