<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?action=history&amp;feed=atom&amp;title=User%3ATommi%2FAlejandro</id>
	<title>User:Tommi/Alejandro - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?action=history&amp;feed=atom&amp;title=User%3ATommi%2FAlejandro"/>
	<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=User:Tommi/Alejandro&amp;action=history"/>
	<updated>2026-08-03T18:34:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=User:Tommi/Alejandro&amp;diff=329752&amp;oldid=prev</id>
		<title>Tommi: Initial commit</title>
		<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=User:Tommi/Alejandro&amp;diff=329752&amp;oldid=prev"/>
		<updated>2026-03-29T15:11:37Z</updated>

		<summary type="html">&lt;p&gt;Initial commit&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Alejandro is a Bash script made to quickly and simply parse a Wiki page in a plain standalone HTML, and add some styling to it.&lt;br /&gt;
&lt;br /&gt;
Actually, not particularly &amp;lt;q&amp;gt;quickly&amp;lt;/q&amp;gt;: I planned to spend a few minutes working on it, but I ended up procrastinating and refining it for several hours.&lt;br /&gt;
&lt;br /&gt;
==== Naming ====&lt;br /&gt;
This tool is named &amp;lt;q&amp;gt;Alejandro&amp;lt;/q&amp;gt; because it is the title of the song by Lady Gaga I was listening to while I was creating it.&lt;br /&gt;
&lt;br /&gt;
{{youtube|niqrrmev4mA}}&lt;br /&gt;
&lt;br /&gt;
==== Code ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
PAGE_TITLE=User:Tommi/T2_Assessment&lt;br /&gt;
TITLE='Tommi’s T2 Assessment'&lt;br /&gt;
BASE_URL=https://pzwiki.wdka.nl&lt;br /&gt;
WIKI_API=$BASE_URL/mw-mediadesign/index.php&lt;br /&gt;
PAGE_URL=&amp;quot;$WIKI_API?action=render&amp;amp;title=$PAGE_TITLE&amp;quot;&lt;br /&gt;
OUTPUT=~/public_html/t2.html&lt;br /&gt;
STYLE=&amp;quot;@import url('$WIKI_API?action=raw&amp;amp;ctype=text/css&amp;amp;title=User:Tommi/T2_Assessment/style.css');&amp;quot;&lt;br /&gt;
PAGE=`curl --location $PAGE_URL` # Using curl is better than wget to store the content in stdout. Nevertheless, absolute links to resources must be transformed at a later time.&lt;br /&gt;
&lt;br /&gt;
# The following is a very basic HTML template from which data is read.&lt;br /&gt;
CONTENT=&amp;quot;&amp;lt;!DOCTYPE HTML&amp;gt;&amp;lt;html lang=en&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;$TITLE&amp;lt;/title&amp;gt;&amp;lt;meta charset=UTF-8&amp;gt;&amp;lt;style&amp;gt;$STYLE&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;main&amp;gt;&amp;lt;h1&amp;gt;$TITLE&amp;lt;/h1&amp;gt;&amp;lt;article&amp;gt;$PAGE&amp;lt;/article&amp;gt;&amp;lt;/main&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Saving the HTML content parsed by MediaWiki to a local output file&lt;br /&gt;
echo &amp;quot;$CONTENT&amp;quot; &amp;gt; &amp;quot;$OUTPUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This regular expression goes through the output file and prepends the wiki’s BASE_URL to all absolute links&lt;br /&gt;
sed -E --in-place 's/(&amp;quot;| )\/mw-mediadesign/\1https:\/\/pzwiki.wdka.nl\/mw-mediadesign/g' &amp;quot;$OUTPUT&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Improvements ====&lt;br /&gt;
* Some variables should be passed as arguments, instead of hardcoded&lt;br /&gt;
* Some variables should be stored as environment variables, instead of hardcoded&lt;br /&gt;
* The HTML content template could be read from a template file&lt;/div&gt;</summary>
		<author><name>Tommi</name></author>
	</entry>
</feed>