finiki:Maintaining templates and modules
![]() | This page documents a finiki guideline. It is a generally accepted standard that editors should follow, though it should be treated with common sense, and occasional exceptions may apply. Changes made to it should reflect consensus. When in doubt, discuss your idea on the talk page. |
Many of Wikipedia's Templates and Modules are used in this wiki. Wikipedia has made some strides to assist other wikis transwikiing a series of templates (or modules) to a remote wiki. However the number of templates or modules that have a transwiki guide to help editors adapt it to a remote wiki is limited.
Importing them into a wiki requires the importupload
user right. This is granted to sysops in the default configuration. On this wiki only administrators have this right.
finiki has taken a variety of approaches over the years. Sometimes templates or modules were copied to finiki via cut-and-paste methods. More recently the preferred method is importing from Wikipedia using Special:Import as it provides some level of traceability as revision dates and editors' names will be preserved. All imports from other wikis are logged at the import log.
Templates
A high level view of the templates available can be found in Category:Wiki templates.
A significant number of templates are imported from Wikipedia, which provides an index of templates, which are grouped into topic-specific headings.
finiki's index of templates is not as comprehensive, nor as up-to-date. The most transcluded pages, which lists both templates and modules, can be used as a source to review which highly-used templates might need to be re-synced with the Wikipedia version.
There are many templates, such as sidebar templates and navigation templates, that are specific to the wiki.
Template documentation pages are part of the template and should be updated when the template is updated. The Category:Template documentation shows these pages.
There is no specific process at this time that covers how to maintain and update the templates that have been imported from Wikipedia. In most cases it is done on an ad-hoc basis. This is an area for improvement.
Modules
The Imported module list is a guide to what are being used in this wiki.
Updating Module documentation subpages
The following steps can be used to identify and refresh the Module documentation subpages. First review Category:Module documentation pages, which theoretically should show them all.
The basic process to be followed is covered in Using 'Special:Export' with some refinements to deal with only the documentation subpages in the namespace.
- Visit All pages in the Module namespace and copy and paste the contents into a text file, i.e.
all_modules_in_ns.txt
- Use grep to build the list of existing documentation subpages,
grep -i '.doc$' all_modules_in_ns.txt > existing_doc_subpages.txt
- Use grep to build the list of all documentation subpages that should exist
grep -v '.doc$' all_modules_in_ns.txt | sed s%$%/doc% > all_doc_subpages.txt
- Use grep to determine the missing documentation subpages
grep -f existing_doc_subpages.txt -v all_doc_subpages.txt > missing_doc_subpages.txt
Use Wikipedia's Special:Export to generate XML files for the missing documentation subpages and the existing documentation subpages. Keeping them separate makes it easily to double-check for errors and omissions. For each of existing_doc_subpages.txt
and missing_doc_subpages.txt
- Go to Special:Export and paste all your page names into the textbox, making sure there are no empty lines.
- Click 'Submit query'
- Save the resulting XML to a file using your browser's save facility.
and finally...
- Open the XML file in a text editor. Scroll to the bottom to check for error messages.
Now you can use these XML files to import the files.
External links
- Wikipedia's WikiProject Templates - to better manage Wikipedia's myriad templates. This page contains their many useful suggestions, and it is hoped that this project will help to focus the efforts of other Wikipedians.
- MediaWiki's Global templates project - This is not a project that is being executed or planned to be executed by anyone at any defined point in time, at least not yet. This is just an idea, albeit a very detailed one.