Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,42 @@
csv2html() {
IFS=,
echo "<table>"
echo "<thead>"
read -a fields
htmlrow th "${fields[@]}"
echo "</thead>"
echo "<tbody>"
while read -a fields
do htmlrow td "${fields[@]}"
done
echo "</tbody>"
echo "</table>"
}
htmlrow() {
cell=$1
shift
echo "<tr>"
for field
do echo "<$cell>$(escape_html "$field")</$cell>"
done
echo "</tr>"
}
escape_html() {
str=${1//\&/&amp;}
str=${str//</&lt;}
str=${str//>/&gt;}
echo "$str"
}
csv2html <<-END
Character,Speech
The multitude,The messiah! Show us the messiah!
Brians mother,<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitude,Who are you?
Brians mother,I'm his mother; that's who!
The multitude,Behold his mother! Behold his mother!
END

View file

@ -0,0 +1,30 @@
<table>
<thead>
<tr>
<th>Character</th>
<th>Speech</th>
</tr>
</thead>
<tbody>
<tr>
<td>The multitude</td>
<td>The messiah! Show us the messiah!</td>
</tr>
<tr>
<td>Brians mother</td>
<td>&lt;angry&gt;Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!&lt;/angry&gt;</td>
</tr>
<tr>
<td>The multitude</td>
<td>Who are you?</td>
</tr>
<tr>
<td>Brians mother</td>
<td>I'm his mother; that's who!</td>
</tr>
<tr>
<td>The multitude</td>
<td>Behold his mother! Behold his mother!</td>
</tr>
</tbody>
</table>