====== WikipediaSnippet Plugin ====== ---- plugin ---- description: Includes a snippet from a Wikipedia article. author : Anika Henke email : anika@selfthinker.org type : syntax lastupdate : 2016-04-07 compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Hogfather, Igor, Jack Jackrum depends : conflicts : similar : tags : wikipedia, include downloadurl: https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/zipball/master bugtracker : https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/issues sourcerepo : https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11071728 ---- ===== Download and Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ===== Syntax and Usage ===== The syntax is very simple: {{wp>Article_Name}} It's intentional that it's similar to the [[:interwiki]] link: ''%%[[wp>Article_Name]]%%'' The difference is that * it includes the first paragraphs of the according Wikipedia page and * it uses automatically the language of the wiki ([[config:lang]]) If you'd like to use a different language than the language of the wiki page, you can add the according language code as another parameter, e.g. the French article for "DokuWiki" would need: {{wp:fr>DokuWiki}} ''%%{{wp>DokuWiki}}%%'' will look like this (in the default template with default configuration): {{:plugin:wikipediasnippet_example2.png}} ===== Configuration ===== * **''snippetLength''** (default: ''0''): Number of sentences to show per snippet; leave empty or '0' to show the whole intro section * **''useHtml''** (default: ''1''): Display HTML formatting in the snippet? (otherwise display unformatted text only) * **''includeTables''** (default: ''0'') will include tables, e.g. the usual [[http://en.wikipedia.org/wiki/Help:Infobox|infobox]]. This can make the snippet more interesting, but some infoboxes can also get unproportionately big and will look strange. removed in latest version * **''includeImages''** (default: ''0'') will include all images that appear within the first few paragraphs and tables. If you enable this, please set your [[config:fetchsize]] config option, so that external images will automatically be cached by DokuWiki. (The HTML will get cached anyway.) removed in latest version ===== Changelog ===== {{rss>https://github.com/selfthinker/dokuwiki_plugin_wikipediasnippet/commits/master.atom date}} ===== Feedback ===== ==== Remove disambiguation notice ==== I realize this is the wrong place but Github is throwing a server error @ the above link: Many topics have disambiguation pages:\\ i.e. [[http://en.wikipedia.org/wiki/Avatar_(computing)]]\\ includes before 1st paragraph: >This article is about virtual user representations. For other uses, see avatar (disambiguation). in the source as: It would be really nice to have these eliminated, as with this plugin we already know that we want this particular page. --Jeff 2010-04-25 > Yes, that makes sense. I just removed the disambiguation link as you suggested in the latest version. --- //[[anika@selfthinker.org|Anika Henke]] 2010/06/12 17:48// ==== Problems ==== I've installed the wikipediasnipped plugin, but instead of a text snippet from the WP article, I see only something like: Object id #94 The link from the snippet title still forwards to the correct WP article, however. --Andrew 2010-10-25 > It's difficult to help without further information. I just released a new version which includes some (hopefully helpful) error message which will help you to debug the problem. --- [[user>ach|Anika Henke]] //2011/05/29 16:24// ==== Usefulness ==== **Is this plugin useful ?** [[:Interwiki]] --[[user>chtiland]] 2011-04-24 > I guess, as with any other plugin: To some people it is useful, to others it isn't. This plugin doesn't do the same as [[:interwiki]] links. It doesn't just display the link, but also fetches the first paragraph of the article. --- [[user>ach|Anika Henke]] //2011/05/29 16:24// > To me, this plugin really is useful. I add it at the end of some of my articles on my website ([[http://www.greguti.com/fort/inventeurprophetebiographies#.UO6b7onm7Nw|check out here for example]]) , as a way to dig further on the topics I dealt with. I could just add a link inside the article itself, but I find this plugin more pleasant to the eyes than a simple link, it's more obvious and more knowledge is instantly accessible to the reader! Only thing I'd like to see in a next release is a way to specify the maximal amount of text to retrieve from the Wikipedia page and to include in the snippet, so that a snippet don't take too much space. --- [[user>greguti|Grégory Gutierez]] //2012/01/10, 11:54// ==== Problem, Language: de-informal ==== ... doesn't work with dokuwiki's custom lang-ids: This http://de-informal.wikipedia.org/ does not exist. I think this plugin should work according to the interwiki entries: "wp" looks up Englisch entries, "wpde" looks up German entries etc. But it does not. Why? > I just fixed that. It **does** work like the interwiki entries, but "wpde-informal" obviously doesn't exist, so you cannot really compare it. As "de-informal" is not an officially recognised language code, I implemented it so it gets substituted with "de" (and the same is true for some other non-standard language codes). Please update your plugin to make it work. --- [[user>ach|Anika Henke]] //2012/08/19 14:23// ==== 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 '''' that is an absolute link. On Wikipedia it works, of course, but 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: // 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//