Contents

Make a stand alone version of a MediaWiki page.

I am able to create a stand alone web page for a MediaWiki page using cut and paste from the source view of the LAMipeda page and minimal editing.

Extract

Cut From: <!-- bodytext --> To: <!-- /bodytext --> # Vector Skin

Cut From: <!-- start content --> To: <!-- end content --> # MonoBook Skin

I have found it easiest to put the complete source in the temp file then delete all before and all after the above tags.

On ak19

cd /mnt/ak20-ext4/Temp

On the local machine

rm temp.html
leafpad temp.html &
WEB_PAGE=$(date +%Y-%m-%d)-WEB_page.html
ll ${WEB_PAGE}
rm ${WEB_PAGE}
scp -p ${WEB_PAGE} q:/mnt/Bk0/Temp

Hints for using vi to edit the temp.html text file, stripping before and after bodytext.

To turn on line numbers:

<escape>:set nu

To go to the first line in the file:

:1

To go to the bodytext comment:

/bodytext

To go to the next in the same direction:

n

To delete from the beginning to a line number:

:1,<n>d

To delete from a line number to the end:

:<n>,$d

Strip wiki style

Give a jekyll build stand alone page file the MarkDown extension of .md which can have the jekyll front matter and html source.

WEB_PAGE=Stand_alone_from_MediaWiki_page.md

The following stripped the edit links and all class information except the span tags which become green.

cat temp.html \
| perl -pe 's|<span><span>\[.*?\]</span></span>||' \
| perl -pe 's|||g' \
| perl -pe 's|<span>(.*?)</span>|$1|g' > ${WEB_PAGE}
chmod a+r ${WEB_PAGE}

Edit

Using:

leafpad ${WEB_PAGE} &

Note that leafpad is a lightweight gui editor that is not installed by default on ARSC machines but I have put a copy in ~murakami/bin on jeeves and a few other machines. You can of course use the editor of your choice;-)

  • Strip script from the end of the toc table.
  • Move toc to bottom
  • Move "Retrieved from" to below toctitle
  • Remove Categories
  • Insert header
  • Add </body></html> to end

jekyll build Head section:

---
layout: page
title: "hp-setup - Printer/Fax Setup Utility"
---

If there was a table of contents add a link to it after the jekyll front matter with:

<span style="float: right;"><a href="#toc">Contents</a></span>

lam1.us Head section:

<html><head>

<title>Cabo Weeks 2015</title>

<link rel="Shortcut Icon" href="/Images/My/LAM.ico" />
<link rel="stylesheet" type="text/css" href="/Public/Style.css" />

</head><body>

<a href=".">
<img src="/Images/My/lam1-us.png"
alt="LAM1 US logo" border="0" width="135" height="98" style="float: left;"/></a>

<h1 >&nbsp;

Cabo Weeks 2015

</h1>
<br>

Revision Log