summaryrefslogtreecommitdiff
path: root/Introduction.mdwn
authorJamey Sharp <jamey@minilop.net>2007-08-09 20:17:07 (GMT)
committer Jamey Sharp <jamey@minilop.net>2007-08-09 20:22:02 (GMT)
commit53c3c66fd05f2cfd9c399ff347b8815f231998a1 (patch) (side-by-side diff)
tree1c2f8f485c4e9eb58aa5126a0653e46bd1b28e19 /Introduction.mdwn
parentc631956fabb8f3e1376c81a3a005d31165deef54 (diff)
downloadwiki-53c3c66fd05f2cfd9c399ff347b8815f231998a1.zip
wiki-53c3c66fd05f2cfd9c399ff347b8815f231998a1.tar.gz
Replace relative links with Ikiwiki links.
Eliminates 119 "orphan" warnings on AdminHome/issues and fixes the conversion problems with CapstoneLV2bProjectReport. Links to images are not replaced, because that would change the generated HTML--it would generate <img> tags instead of <a> links. Handled with an enhanced version of my previous wikilink script. find -name '*.mdwn' | xargs ../wikilink wikilink: #!/usr/bin/perl -pi use warnings; use strict; BEGIN { $::pat = qr{\Qhttp://psas.pdx.edu/\E(?!albums/|cgi-bin/|viewfile/|attach/)(?:PSAS/)?|(?!https?://|ftp://|mailto:|#)}; $::img = qr{<img ([^>]*src="(?:$::pat)[^"]*"[^>]*)>}; $::uri = qr{="(?:$::pat)([^"]*)(?<!png|gif|jpg)(?<!jpeg)"}; } sub mdwn { my ($target, $alt) = @_; if($alt) { $alt =~ s/^\s*(.*?)\s*$/$1/; (my $realalt = $alt) =~ s/\\//g; $alt = '' if $target =~ m{/\Q$realalt\E$}; } $alt = $alt ? $alt . '|' : ''; $target =~ s/\.html$//; return '[[' . $alt . $target . ']]'; } sub img { my @attrs = split(' ', $_[0]); my ($src, $alt); foreach(@attrs) { /^(.*?)=["']?(.*?)["']?$/; $src = $2 if $1 eq "src"; $alt = $2 if $1 eq "alt"; } $src =~ s/^(?:$::pat)//o; return mdwn($src, $alt); } s!$::img!img($1)!iego; s!<a href(?:$::uri)[^>]*>\s*(.*?)\s*</a>!mdwn($1, $2)!iego; s!\!\[\s*([^]]*)\s*\]\((?:$::pat)([^)]*\.(?:png|gif|jpg|jpeg))\)!mdwn($2, $1)!iego; s{\[\s*([^]]*)\s*\]\((?:$::pat)([^)]*)(?<!png|gif|jpg)(?<!jpeg)\)}{mdwn($2, $1)}iego;
Diffstat (limited to 'Introduction.mdwn') (more/less context) (ignore whitespace changes)
-rw-r--r--Introduction.mdwn2
1 files changed, 1 insertions, 1 deletions
diff --git a/Introduction.mdwn b/Introduction.mdwn
index 761718a..07ac58a 100644
--- a/Introduction.mdwn
+++ b/Introduction.mdwn
@@ -41,7 +41,7 @@
</tr>
<tr>
<td>[[AvionicsTeamHome]]: Avionics are the computer &quot;brains&quot; of the rocket. We&#39;re trying to be one of the first amateur groups in the world to make an actively guided rocket &ndash; i.e., a rocket that is autonomously guided by an onboard computer. Technically speaking, we&#39;re hoping to build an amateur DGPS-aided inertial navigation system. </td>
- <td><img align="center" height=319 src="/psas/Current_project/LV-1/Payload/Resources/FC_Intro.jpg" width=320></td>
+ <td>[[/psas/Current_project/LV-1/Payload/Resources/FC_Intro.jpg]]</td>
</tr>
<tr>
<td>