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
10 script_file
=mw-setup-script
11 page_file
=Mediawiki_Setup_Guide
12 start
=' *<source lang="bash"> *'
15 if [[ $1 != -l ]]; then # use local file
16 ruby
<<'EOF' > $page_file
18 puts JSON.parse(`curl -k 'https://ofswiki.org/w/api.php?\
19 action=query&titles=Mediawiki_Setup_Guide&prop=revisions&rvprop=content&\
20 format=json'`.chomp)['query']['pages'].values[0]['revisions'][0]['*']
26 # Copyright (C) 2016 Ian Kelling
27 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
29 sed -rn "/^$start$/,/^$end$/{s/^($start|$end)$/# \0/;p}" $page_file