Home  

Random  

Nearby  



Log in  



Settings  



Donate  



About Wikipedia  

Disclaimers  



Wikipedia





Wikipedia:WikiProject Transwiki





Project page  

Talk  



Language  

Watch  

Edit  





Welcome to WikiProject Transwiki, a WikiProject for helping with the transwiki process outside of the Wikimedia family. This is done by explaining how to import and export articles, linking to help with MediaWiki software, prepping templates for use outside of Wikipedia, listing available resources (including editors willing to help), and much more.

For more information on WikiProjects, please see Wikipedia:WikiProjects and Wikipedia:WikiProject best practices.

Before we begin

edit

It should be noted that if you wish to have the below on a wiki that you administrate for or likewise, you must get the parser function available here or this will not work.

Main goals

edit
  1. Template "pack" – a pack of commonly used templates that is pure wikicode and ready to be imported via xml file. We'll need to identify which templates should go into this basic pack. Some templates might require converting into pure-wiki table code, or for simplification.
  2. MediaWiki "pack" – similar to the template pack, a bunch of MediaWiki namespace pages that are formatted for general and easy use for most other wikis
  3. How to export – Expanding on the export/import guide, which so far is very minimal.
  4. A general technical guide on how to adapt articles for use on another wiki
  5. Establish other resources to aid the reuse of Wikipedia content

Useful files and templates

edit

MediaWiki files

edit

Common.js doesn't seem to be loaded for MediaWiki 1.7.1, I got collapsable tables to work by cutting and pasting that section of code into MediaWiki:Monobook.js

Templates

edit
These templates can normally be used as-is

Special templates

edit

Many Wikipedia templates cannot be directly exported to other wikis because they include HTML code within a parser function that does not translate across wikis. Wikipedia has a "tidy" pass that cleans up HTML code. Without that pass, HTML code within templates get translated into quoted tags that get displayed.

To fix this problem the following templates have been converted so that templates contain HTML code within a parser function rather than using wiki tags for table conversions. See Wikipedia:Conditional tables for examples of how to do this.

The following templates have been converted to use pure-wiki code, which is often required for most MediaWiki wikis, which do not have the tidy extension configured in the same way as wikipedia

Coding example

edit

{{Information}} has several lines with non-portable HTML table tags:

{{#switch: {{{Other_versions| {{{other_versions| {{{other versions|}}} }}} }}}
|   = 
| - = 
| none = 
| #default = 
<tr valign="top">
<th style="background: #ccf; text-align: right; padding-right: 0.4em;" id="fileinfotpl_ver"> Other versions </th>
<td> {{{Other_versions| {{{other_versions| {{{other versions|}}} }}} }}} </td>
</tr>
}}

These lines conditionally display the "Other versions" row of the image information table with a {{#switch:...}} statement. To make the template portable, change the offending lines to use wikitext table code, and use {{!}} to encode the table pipe characters:

{{#switch: {{{Other_versions| {{{other_versions| {{{other versions|}}} }}} }}}
|   = 
| - = 
| none = 
| #default = 
{{!}}- valign="top"
! style="background: #ccf; text-align: right; padding-right: 0.4em;" id="fileinfotpl_ver" {{!}} Other versions
{{!}} {{{Other_versions| {{{other_versions| {{{other versions|}}} }}} }}} 
{{!}}
}}

The ! table code characters do not themselves need encoding. The same goes for pipe characters that are part of the template code itself. Only the pipe characters that are part of the table syntax need encoding.

How to export

edit

Do not use Special:Export, as it will only return 1000 revisions at a time, and some of the other documented features do not currently work.

  1. Instead, use http://en.wikipedia.org/w/index.php?title=Special:Export&history=1&action=submit&pages=ARTICLE_NAMEor{{export}}
  2. Save the file as something.xml
  3. Use a find/replace feature of a text editor and find all "</username>" and replace it with "@en.wikipedia.org</username>"
  4. Save. You should now be ready to import the file via Special:Import on another MediaWiki wiki.

See also

edit
edit

Mediawiki extension packets

edit

Retrieved from "https://en.wikipedia.org/w/index.php?title=Wikipedia:WikiProject_Transwiki&oldid=1124851767"
 



Last edited on 30 November 2022, at 21:16  


Languages

 


Gagauz
 

Wikipedia


This page was last edited on 30 November 2022, at 21:16 (UTC).

Content is available under CC BY-SA 4.0 unless otherwise noted.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Terms of Use

Desktop