webplatform / mediawiki-conversion

Convert MediaWiki XML backup into structured raw text file tree
https://github.com/webplatform/docs
15 stars 4 forks source link

Prior to shut down MediaWiki, ensure all "... Further results" are fully imported in static site #26

Open renoirb opened 8 years ago

renoirb commented 8 years ago

Let’s make HTML some MediaWiki ASK query results.

In order to stop relying on MediaWiki, we got to make sure all contents that were linked automatically through Semantic MediaWiki is kept as static HTML.

In some views, you might see a link that links to "... further results" like below;

semantic_mediawiki_further_results

The issue is that since we won’t have MediaWiki anymore, those links will be broken.

See also: webplatform/mediawiki-conversion#9.

How to do

We hae no choice to do this manually on any page that has SemanticMediaWiki or subpages wiki macros because we’re getting out of MediaWiki and we will lose the work made to make those dynamic lists.

To keep the list content for posterity, we gotta find pages that makes reference to them (e.g. grep -rli 'subpages' content/WPD/) and attempt to rework the wiki document to make the HTML give us the full listing output.

Otherwise we’ll lose that data

  1. HTML file has a table with classname "wikitable smwtable", or just search entries that has "further results" mentioned.

    grep -rli 'further results' content
  2. Get Full view (if possible) by using MediaWiki ASK query helper
  3. Once we see no "more..." link at the bottom of the view. Click on "show embed code" so that you can copy query code.
{{#ask:[[Path::~*apis/*]] [[Content quality flag::~Examples Needed]]
|?Path
|?Summary
|?Modification date
|format=broadtable
|limit=500
|offset=15
|sort=Modification date
|order=desc
|headers=plain
|mainlabel=-
|searchlabel='''More results'''
|default={{{default_text}}}
}}

Converted:

That looked problematic that may be fine now.


I had to adjust two templates so that the {{#ask: ... }} contains |limit=1000 so that we hopefully get all the entries and remove the "further results...". Default limit= value is below 1000. Documentation doesn’t tell, but with 1000 we had no more "further results" in the output.

Once you modify a template, you have to run maintenace/runJobs.php on production.

The following templates had been edited:

  1. https://docs.webplatformstaging.org/wiki/Template:See_Also_Section?action=edit
  2. https://docs.webplatformstaging.org/wiki/Template:API_Object?action=edit

And the following links was also useful

renoirb commented 8 years ago
renoirb commented 8 years ago

Moved this comment to webplatform/mediawiki-conversion#28