Difference between revisions of "The TTSCpedia:WikiProject Transwiki"

From The TTSCpedia
Jump to navigationJump to search
en>Edokter@en.wikipedia.org
en>Edokter@en.wikipedia.org (→‎Special Templates)
TheROFL98
TheROFL98 (talk | contribs) (99 revisions imported)
m
 
(26 intermediate revisions by 15 users not shown)
Line 1: Line 1:
 +
{{historical}}
 +
 
{{about|a WikiProject dedicated to the transwiki process in general|the WikiProject dedicated to importing content from foreign language Wikipedias|Wikipedia:WikiProject Intertranswiki}}
 
{{about|a WikiProject dedicated to the transwiki process in general|the WikiProject dedicated to importing content from foreign language Wikipedias|Wikipedia:WikiProject Intertranswiki}}
 
{{Shortcut|WP:TRAN}}
 
{{Shortcut|WP:TRAN}}
Line 5: Line 7:
 
For more information on WikiProjects, please see [[Wikipedia:WikiProjects]] and [[Wikipedia:WikiProject best practices]].
 
For more information on WikiProjects, please see [[Wikipedia:WikiProjects]] and [[Wikipedia:WikiProject best practices]].
 
<br clear="all" />
 
<br clear="all" />
 +
==Before we begin==
 +
''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 [http://mediawiki.org/wiki/Extension:ParserFunctions here] or this will '''not work'''.
  
==Main goals==
+
===Main goals===
 
#'''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.
 
#'''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.
 
#'''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
 
#'''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
Line 15: Line 19:
 
==Useful files and templates==
 
==Useful files and templates==
 
===MediaWiki files===
 
===MediaWiki files===
*[[/MediaWiki:Common.css]] - Click edit and select all text. Disregard appearance when viewed as a normal page. Should work on most installations of MediaWiki. Will import most of the css classes that Wikipedia uses (especially useful for wikitable classes). Last updated: April 17, 2008
+
*[[/MediaWiki:Common.css]] - Click edit and select all text. Disregard appearance when viewed as a normal page. Should work on most installations of MediaWiki. Will import most of the css styling for the class attributes that Wikipedia uses (especially useful for classes in wikitables). Last updated: April 17, 2008
*[[/MediaWiki:Common.js]] - Click edit and select all text. Disregard appearance when viewed as a normal page. Same as above, but for some common java script. Also includes useful bug fixes that might not be fixed in the current version of MediaWiki. Last updated: April 17, 2008
+
*[[/MediaWiki:Common.js]] - Click edit and select all text. Disregard appearance when viewed as a normal page. Same as above, but for some common javascript. Also includes useful bug fixes that might not be fixed in the current version of MediaWiki. Last updated: April 17, 2008
  
 
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
 
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
Line 24: Line 28:
 
;These templates can normally be used as-is:
 
;These templates can normally be used as-is:
  
*[[Template:!]] – Vital for most other templates to work. Recommend full protection when used on other wikis.
 
 
*[[Template:!!]] – Vital for most other templates to work. Recommend full protection when used on other wikis.
 
*[[Template:!!]] – Vital for most other templates to work. Recommend full protection when used on other wikis.
 
*[[Template:-]] – Not as vital, but still highly used.
 
*[[Template:-]] – Not as vital, but still highly used.
Line 40: Line 43:
 
*[[Template:Warning]]
 
*[[Template:Warning]]
  
===Special Templates===
+
===Special templates===
  
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.
+
Many Wikipedia templates cannot be directly exported to other wikis because they include HTML code within a [[mw:Help:Extension:ParserFunctions|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.
+
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
 
;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
Line 63: Line 66:
 
*[[/Template:Ambox]] - Oct 11, 2007
 
*[[/Template:Ambox]] - Oct 11, 2007
 
*[[/Template:Infobox Company]] - April 17, 2008
 
*[[/Template:Infobox Company]] - April 17, 2008
 +
*[[/Template:Information]] - February 6, 2011
 +
*[[/Template:Shortcut compact]] - April 3, 2011 <small>(The template itself is portable, but since it contains HTML table code, it causes problems when used inside parser function code, such as in the examples on the [[Template:Shortcut compact/doc|template documentation subpage]] when transcluded onto the template page by {{Tl|Documentation}}. The portable version removes these worries.)</small>
 +
 +
==== Coding example ====
 +
 +
{{Tl|Information}} has several lines with non-portable HTML table tags:
 +
 +
<nowiki>{{#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>
 +
}}</nowiki>
 +
 +
These lines conditionally display the "Other versions" row of the image information table with a <code><nowiki>{{</nowiki>[[mw:Help:Extension:ParserFunctions##switch|#switch:...]]<nowiki>}}</nowiki></code> statement. To make the template portable, change the offending lines to use wikitext table code, and use {{Tl|!}} to encode the table [[Vertical bar|pipe characters]]:
 +
 +
<nowiki>{{#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|}}} }}} }}}
 +
{{!}}
 +
}}</nowiki>
 +
 +
The <code>!</code> 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.
  
 
{{/exporting}}
 
{{/exporting}}
  
 
==See also==
 
==See also==
*[[:Category:Wikipedia administrators who will provide copies of deleted articles]]
+
*[[:Category:Wikipedia administrators willing to provide copies of deleted articles]]
 
*[[Special:Version]] - gives a full list of extensions currently installed on en.wikipedia.org
 
*[[Special:Version]] - gives a full list of extensions currently installed on en.wikipedia.org
 
*[[Wikipedia:Catalogue of CSS classes]]
 
*[[Wikipedia:Catalogue of CSS classes]]
Line 75: Line 110:
  
 
==External links==
 
==External links==
 +
* [http://www.etcwiki.org/wiki/Install_infobox How to install template infobox in mediawiki] @ ETCwiki
 
===Mediawiki extension packets===
 
===Mediawiki extension packets===
 
* Debian package [http://packages.debian.org/en/sid/mediawiki-extensions Mediawiki-extensions]
 
* Debian package [http://packages.debian.org/en/sid/mediawiki-extensions Mediawiki-extensions]
Line 81: Line 117:
 
* Unofficial bundles of the extensions in the Wikimedia [[Subversion#The_repository|SVN repository]] can sometimes be found on the [[tools:~daniel/repository/extensions/|toolserver]]. These bundles are arbitrary snapshots, so keep in mind they might contain a broken version of the extension (just as if you load them from the developer's repository directly).
 
* Unofficial bundles of the extensions in the Wikimedia [[Subversion#The_repository|SVN repository]] can sometimes be found on the [[tools:~daniel/repository/extensions/|toolserver]]. These bundles are arbitrary snapshots, so keep in mind they might contain a broken version of the extension (just as if you load them from the developer's repository directly).
  
 +
[[Category:WikiProject Transwiki|*]]
 
[[Category:Wikipedia WikiProjects|Transwiki]]
 
[[Category:Wikipedia WikiProjects|Transwiki]]

Latest revision as of 01:05, 7 February 2019

Template:Historical

Template:About

Shortcut

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

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

  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

MediaWiki files

  • /MediaWiki:Common.css - Click edit and select all text. Disregard appearance when viewed as a normal page. Should work on most installations of MediaWiki. Will import most of the css styling for the class attributes that Wikipedia uses (especially useful for classes in wikitables). Last updated: April 17, 2008
  • /MediaWiki:Common.js - Click edit and select all text. Disregard appearance when viewed as a normal page. Same as above, but for some common javascript. Also includes useful bug fixes that might not be fixed in the current version of MediaWiki. Last updated: April 17, 2008

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

These templates can normally be used as-is

Special templates

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

{{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.

The TTSCpedia:WikiProject Transwiki/exporting

See also

External links

Mediawiki extension packets

  • Debian package Mediawiki-extensions
  • Ubuntu package Mediawiki-extensions
  • TurnKey MediaWiki preinstalled minimal Ubuntu OS including popular extensions
  • Unofficial bundles of the extensions in the Wikimedia SVN repository can sometimes be found on the toolserver. These bundles are arbitrary snapshots, so keep in mind they might contain a broken version of the extension (just as if you load them from the developer's repository directly).