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,39 @@
String::__defineGetter__ 'escaped', () ->
this.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;') // rosettacode doesn't like "
text = '''
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!
'''
lines = (line.split ',' for line in text.split /[\n\r]+/g)
header = lines.shift()
console.log """
<table cellspacing="0">
<thead>
<th scope="col">#{header[0]}</th>
<th scope="col">#{header[1]}</th>
</thead>
<tbody>
"""
for line in lines
[character, speech] = line
console.log """
<th scope="row">#{character}</th>
<td>#{speech.escaped}</td>
"""
console.log """
</tbody>
</table>
"""

View file

@ -0,0 +1,18 @@
<table cellspacing="0">
<thead>
<th scope="col">Character</th>
<th scope="col">Speech</th>
</thead>
<tbody>
<th scope="row">The multitude</th>
<td>The messiah! Show us the messiah!</td>
<th scope="row">Brians mother</th>
<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>
<th scope="row">The multitude</th>
<td>Who are you?</td>
<th scope="row">Brians mother</th>
<td>I'm his mother; that's who!</td>
<th scope="row">The multitude</th>
<td>Behold his mother! Behold his mother!</td>
</tbody>
</table>