mediawiki

How to add external <script> to <head> section for all mediawiki pages?

馋奶兔 提交于 2019-12-22 05:45:09
问题 I want add external script to head section for all pages in mediawiki. Function onBeforePageDisplay callback from BeforePageDisplay hook: //LocalSettings.php ... # Assign my functions to hook $wgHooks['BeforePageDisplay'][] ='onBeforePageDisplay'; function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { mw.loader.load('http://static.wowhead.com/widgets/power.js', 'text/javascript'); $out->addModules( 'mw.loader' ); return true; }; In this function i want to add <script type="text

Get location with Wikimedia API

假如想象 提交于 2019-12-21 20:58:44
问题 How to get location of the Wikipedia article with Mediawiki API in terms of city/country? Let's say I want to determine what country, what city the Sagrada Familia cathedral is located in? What property should I use? 回答1: Try the following query: https://en.wikipedia.org/w/api.php?action=query&prop=coordinates&titles=Sagrada%20Fam%C3%ADlia&coprop=country|type|name|dim|region And see Extension:GeoData for documentation. I'm not sure if we can get the city name using Wikipedia API, but there

Do Media Queries work in MediaWiki?

北慕城南 提交于 2019-12-21 15:02:02
问题 I'm trying to get a responsive skin working in MediaWiki with media queries, and I'm troubleshooting some weird behavior. If I add a test div to a wiki page: <div id="testing">TESTING</div> And then add a media query: @media screen { #testing {background-color: green;} } ...to various places, the style only applies in certain browsers. For example: If I add it to the active skin's "screen.css" file, where all the other working styles live: iPad: NO iPhone4: NO Chrome 20.0 XP+Mac: NO Firefox

Using MediaWiki to pull text from a Wikia page but it comes back in a big mess is there a better way I could do this to pull text from each section?

拥有回忆 提交于 2019-12-21 05:21:33
问题 I am developing an Android app that pulls information from a Wikia page and displays it in the app. I currently am pulling all Categories to navigate and have my app set up to display the page in a WebView but I would like to just pull the info and format myself instead of cheapening it by passing to WebView. What I am using to get the text is: http://scottlandminecraft.wikia.com/api.php?format=xml&action=query&titles=ZackScott&prop=revisions&rvprop=content My problem is the text comes back

centos7上安装mediawiki

别来无恙 提交于 2019-12-21 04:55:54
为了记录遇到过的坑,这里是基于 Apache2服务器 1、安装 apr-1.7.0 wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz tar xvf apr-1.7.0.tar.gz cd apr-1.7.0 ./configure --prefix=/usr/local/apr make && make install 2、安装apr-util-1.6.1 wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz tar xvf apr-util-1.6.1.tar.gz cd apr-util-1.6.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config make && make install 3、安装pcre-8.43 wget https://sourceforge.net/projects/pcre/files/pcre/8.43/pcre-8.43.tar.gz tar zxvf pcre-8.43.tar.gz cd pcre ./configure --prefix=

How to get image URL in wiki api?

泄露秘密 提交于 2019-12-21 00:14:12
问题 When I call wiki APIs for accessing image URLs, I get image URLs like this, File:Ad-tech London 2010 (2).JPG How to get the correct URL of this file from wiki API? 回答1: You can get the propert URLs from an imageinfo query like this: https://en.wikipedia.org/w/api.php?action=query&titles=File:Test.jpg&prop=imageinfo&iilimit=50&iiend=2007-12-31T23:59:59Z&iiprop=timestamp|user|url More info at MediaWiki API Help. 回答2: There's little documentation on image/thumbnail URLs besides T153497. You can

Parser for Wikipedia

 ̄綄美尐妖づ 提交于 2019-12-20 12:14:07
问题 I downloaded a Wikipedia dump and I want to convert the wiki format into my object format. Is there a wiki parser available that converts the object into XML? 回答1: See java-wikipedia-parser. I have never used it but according to the docs : The parser comes with an HTML generator. You can however control the output that is being generated by passing your own implementation of the be.devijver.wikipedia.Visitor interface. 回答2: I do not know how exactly looks xml format of Wikipedia dump. But, if

Where can I get templates for MediaWiki?

浪尽此生 提交于 2019-12-20 11:41:40
问题 I have noticed that a lot of mediawiki-based websites use such templates as Robelbox, Ambox etc. Where can I get them and how should they be installed? 回答1: It's a PITA and unfortunately (unlike extensions or media files) there is no repository of canned templates. Templates load other templates which load others in turn, etc. Go to Wikipedia and copy the name of the template you're after, go to Special:Export and paste the name of the template in the big text box, e.g. Template:Infobox.

Java Wikitext Parser

廉价感情. 提交于 2019-12-20 10:55:24
问题 Any ideas for a nice parser with an easy to use api that is configurable? I'm looking to feed it data such as http://wikitravel.org/wiki/en/api.php?format=xml&action=parse&prop=wikitext&page=San%20Francisco, choose sections of data I want, and output custom html for each unique type of element? Java would be preferred, but if there's a php/js solution that is compatible with most (99%+) wikitext, that would be okay as well. 回答1: Sweble is probably the best Java parser of wikitext. It claims

Convert LaTeX to MediaWiki syntax

孤人 提交于 2019-12-20 08:57:48
问题 I need to convert LaTeX into MediaWiki syntax. The formulas should stay the same, but I need to transform, for example \chapter{something} into = something =. Although this can be obtained with a bit of sed, things get a little dirty with the itemize environment, so I was wondering if a better solution can be produced. Anything that can be useful for this task? 回答1: Pandoc should be able to do it: $ pandoc -f latex -t mediawiki << END > \documentclass{paper} > \begin{document} > \section