Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,15 @@
H
g/&/s//\&/g
g/</s//\&lt;/g
g/>/s//\&gt;/g
g/"/s//\&quote;/g
g/^/s// <tr><td>/g
g/,/s//<\/td><td>/g
g/$/s//<\/td>\
<\/tr>/
1s/^/<table>\
/
$s/$/\
<\/table>/
,p
Q

View file

@ -0,0 +1,73 @@
global switch thead initial {true}
global switch tbody-first initial {true}
define function process-tr (value stream line) as
do when thead
output '<thead>%n<tr><th>'
else when tbody-first
output '</thead>%n'
output '<tbody>%n<tr><td>'
deactivate tbody-first
else
output '<tr><td>'
done
repeat scan line
match ',' any-text => char
output '</th><th>' when thead
output '</td><td>' unless thead
using group ents submit char
match any-text => char
using group ents submit char
again
output '</td>' unless thead
output '</th>' when thead
output '</tr>'
deactivate thead
process-start
output '<?xml version="1.0" encoding="UTF-8"?>%n' ||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">%n' ||
'<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">%n' ||
'<head>%n' ||
'<title>Monty Pythons Life of Brian (1979). Scene 20 (extract).</title>%n' ||
'<meta name="description" content="Rosetta Code. Task: CSV to HTML translation (extra credit)" />%n' ||
'<meta name="keywords" content="OmniMark" />%n' ||
'<meta name="author" content="Kennypete" />%n' ||
'<style type="text/css">%nth { background-color: gold }%n</style>%n' ||
'</head>%n' ||
'<body>%n' ||
'<table border=%"1%">%n'
process-end
output '</tbody>%n' ||
'</table>%n' ||
'</body>%n' ||
'</html>%n'
; Output validates to XHTML 1.0 - https://validator.w3.org/check
process
local stream s
set s to "Character,Speech%n" ||
"The multitude,The messiah! Show us the messiah!%n" ||
"Brians mother,<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>%n" ||
"The multitude,Who are you?%n" ||
"Brians mother,I'm his mother; that's who!%n" ||
"The multitude,Behold his mother! Behold his mother!%n"
using group line submit s
group ents
find '<'
output '&lt;'
find '>'
output '&gt;'
find "'"
output '&apos;'
group line
find line-start any-text+ => line
process-tr(line)

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Monty Pythons Life of Brian (1979). Scene 20 (extract).</title>
<meta name="description" content="Rosetta Code. Task: CSV to HTML translation (extra credit)" />
<meta name="keywords" content="OmniMark" />
<meta name="author" content="Kennypete" />
<style type="text/css">
th { background-color: gold }
</style>
</head>
<body>
<table border="1">
<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&apos;s not the messiah; he&apos;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&apos;m his mother; that&apos;s who!</td></tr>
<tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr>
</tbody>
</table>
</body>
</html>