Populating a mediawiki from tabular data: Difference between revisions

From Squirrel's Lair
(Created page with "{{TidBit |shortDescription=Get data into a mediawiki from tabular format such as a spreadsheet |skillSet=Mediawiki |featured=Yes }} When you first set up a new Mediawiki it is a good idea to populate it with some starting content that uses templates. Sometimes data that needs to go on the wiki is available in tabular form. For example, you may have a spreadsheet to track tools and you want to add this to the wiki. To make best use of the wiki you will want one pag...")
 
mNo edit summary
Line 10: Line 10:


In this scenario I will often create a new column and use excel functions to generate text of the same format as the XML files generated by an export from Mediawiki. This file can then be imported into the wiki.
In this scenario I will often create a new column and use excel functions to generate text of the same format as the XML files generated by an export from Mediawiki. This file can then be imported into the wiki.
Mediawiki import/export files are of the following basic XML structure:
<mediawiki>
  <page><title>mypagetitle</title>
    <revision>
      <text xml:space="preserve"> the content of my page
      </text><comment>Imported content</comment>   
    </revision> 
  </page>
</mediawiki>

Revision as of 20:31, 2024 March 24


  • Cargo:


  • Categories:
  • Default form


When you first set up a new Mediawiki it is a good idea to populate it with some starting content that uses templates. Sometimes data that needs to go on the wiki is available in tabular form. For example, you may have a spreadsheet to track tools and you want to add this to the wiki.

To make best use of the wiki you will want one page per tool, so you can add all the structured data you want, but also add as much free text as you want. This means you need to add one page per line of spreadsheet, and there could be hundreds of lines.

In this scenario I will often create a new column and use excel functions to generate text of the same format as the XML files generated by an export from Mediawiki. This file can then be imported into the wiki.

Mediawiki import/export files are of the following basic XML structure:

<mediawiki>
 <page><title>mypagetitle</title>
   <revision>
     <text xml:space="preserve">	the content of my page	
     </text><comment>Imported content</comment>    
   </revision>  
 </page>
</mediawiki>