-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfile2wiki.sh
34 lines (31 loc) · 1016 Bytes
/
file2wiki.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#########################################################################################
# DESC: read files and create wiki like syntax
#########################################################################################
# Copyright (c) Chris Ruettimann <[email protected]>
#
# This software is licensed to you under the GNU General Public License.
# There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
# http://www.gnu.org/licenses/gpl.txt
file2wiki(){
if [ $# -gt 1 ] ; then
for f in $*
do
test -f $f && file2wiki $f
done
fi
f=$1
echo "<div class=\"toccolours mw-collapsible mw-collapsed\" style=\"width:60%\">
File: <b>$1</b> Modified: <b>$( stat -c '%y' $1 | cut -d. -f1)</b>
<div class=\"mw-collapsible-content\">
<pre>"
cat $1
echo "</pre>
</div>
</div>
"
}
file2wiki $*