Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
String::__defineGetter__ 'escaped', () ->
|
||||
this.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"') // 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>
|
||||
"""
|
||||
|
|
@ -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><angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry></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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue