#!/bin/sh # action list dump - collates the pcb-rnd action table into a html doc page # Copyright (C) 2017,2018 Tibor 'Igor2' Palinkas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # http://repo.hu/projects/librnd #shell lib; configuration: # $asrc path to action sources # $lsrc path to librnd action sources # $1 is app name print_hdr() { echo " $1 user manual

$1 User Manual: Appendix

Action Reference

" echo "" a "" "" "" "" } a="" s="" d="" c="" } /^A/ { flush_sd() sub("^A", "", $0) a = a "
" $0 next } /^D/ { sub("^D", "", $0) d = d "
" $0 next } /^S/ { sub("^S", "", $0) s = s "
" $0 next } /^C/ { sub("^C", "", $0) c = c "
" $0 next } ' | sort -fu | awk -v "asrc=$asrc" -v "lsrc=$lsrc" ' # insert links around actions where applicable BEGIN { q = "\"" } // { pre = $0 sub(".*", "", pre) post = $0 sub(".*", "", post) act = $0 sub(".*", "", act) sub(".*", "", act) loact = tolower(act) fn = asrc "/" loact ".html" lfn = lsrc "/" loact ".html" if ((getline < fn) == 1) print pre "" post else if ((getline < lfn) == 1) print pre "" post else print pre "" post close(fn) close(lfn) next } { print $0 } END { print "
\n" "" echo $pcb_rnd_ver ", " $pcb_rnd_rev echo "" echo "
Action Description Syntax Plugin" } gen() { awk ' function flush_sd() { if ( a != "" || s != "" || d != "" ) { sub("^
", "", a) sub("^
", "", d) sub("^
", "", s) sub("^
", "", c) print "
" d "" s "" c "" act "" act " (RND)" act "
" print "

RND: this action comes from librnd and is common to all ringdove applications." print "" print "" } ' }