2 # Copyright (C) 2016 Ian Kelling
3 # This program is under GPL v. 3 or later, see <https://www.gnu.org/licenses>
5 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
9 script_file
=mw-setup-script
10 page_file
=Mediawiki_Setup_Guide
11 start
=' *<source lang="bash"> *'
14 ruby
<<'EOF' > $page_file
16 puts JSON.parse(`curl -k 'https://ofswiki.org/w/api.php?\
17 action=query&titles=Mediawiki_Setup_Guide&prop=revisions&rvprop=content&\
18 format=json'`.chomp)['query']['pages'].values[0]['revisions'][0]['*']
23 # Copyright (C) 2016 Ian Kelling
24 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
26 sed -rn "/^$start$/,/^$end$/{s/^($start|$end)$/# \0/;p}" $page_file