-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
726 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import convert from '../index.js' | ||
import esbuild from 'esbuild' | ||
import { fileURLToPath } from 'node:url' | ||
import path from 'path' | ||
|
||
import { readdir, readFile, writeFile } from 'node:fs/promises' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
const contentTag = `<!-- CONTENT -->` | ||
|
||
// Bundle JavaScript for browsers | ||
|
||
await esbuild.build({ | ||
bundle: true, | ||
entryPoints: [`index.js`], | ||
minify: true, | ||
outfile: `scription2html.js`, | ||
}) | ||
|
||
// Build samples | ||
|
||
const template = await readFile(path.resolve(__dirname, `./template.html`), `utf8`) | ||
const files = await readdir(path.resolve(__dirname, `../samples/data`)) | ||
|
||
for (const file of files) { | ||
const scription = await readFile(path.resolve(__dirname, `../samples/data`, file), `utf8`) | ||
const filename = path.basename(file, `.txt`) | ||
let content = `<h1>${ filename }</h1>` | ||
const { html } = convert(scription) | ||
const interlinears = `<ul>${ html }</ul>` | ||
|
||
content += `\n${ interlinears }` | ||
|
||
const sample = template.replace(contentTag, content) | ||
|
||
await writeFile(path.resolve(__dirname, `../samples/html`, `${ filename }.html`), sample) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang=en> | ||
<head> | ||
<meta charset=utf-8> | ||
<meta name=viewport content='width=device-width, initial-scale=1.0, shrink-to-fit=no'> | ||
<title>scription2html Samples</title> | ||
<meta name=author content='Daniel W. Hieber'> | ||
<link rel=author href=https://danielhieber.info> | ||
</head> | ||
<body> | ||
<!-- CONTENT --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
<!DOCTYPE html> | ||
<html lang=en> | ||
<head> | ||
<meta charset=utf-8> | ||
<meta name=viewport content='width=device-width, initial-scale=1.0, shrink-to-fit=no'> | ||
<title>scription2html Samples</title> | ||
<meta name=author content='Daniel W. Hieber'> | ||
<link rel=author href=https://danielhieber.info> | ||
</head> | ||
<body> | ||
<h1>Algonquian</h1> | ||
<ul><div class='igl'>{ | ||
"metadata": "Menominee", | ||
"transcription": { | ||
"default": "pemētaehkipew" | ||
}, | ||
"translation": "S/he sits sideways.", | ||
"source": "(Bloomfield 1975: 208)", | ||
"words": [ | ||
{ | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"analysis": { | ||
"default": "paemet-aehkw-ape" | ||
}, | ||
"gloss": { | ||
"gl": "crosswise-face-sit", | ||
"en": "initial-medial-final" | ||
}, | ||
"morphemes": [ | ||
{ | ||
"transcription": { | ||
"default": "paemet" | ||
}, | ||
"gloss": { | ||
"gl": "crosswise", | ||
"en": "initial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "aehkw" | ||
}, | ||
"gloss": { | ||
"gl": "face", | ||
"en": "medial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "ape" | ||
}, | ||
"gloss": { | ||
"gl": "sit", | ||
"en": "final" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}</div><div class='igl'>{ | ||
"metadata": "SW Ojibwe", | ||
"transcription": { | ||
"default": "ozhaashisagaa" | ||
}, | ||
"translation": "It is a slippery floor.", | ||
"source": "(Nichols 2015)", | ||
"words": [ | ||
{ | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"analysis": { | ||
"default": "ozhaash-sag-aa" | ||
}, | ||
"gloss": { | ||
"gl": "slippery-floor-stat", | ||
"en": "initial-medial-final" | ||
}, | ||
"morphemes": [ | ||
{ | ||
"transcription": { | ||
"default": "ozhaash" | ||
}, | ||
"gloss": { | ||
"gl": "slippery", | ||
"en": "initial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "sag" | ||
}, | ||
"gloss": { | ||
"gl": "floor", | ||
"en": "medial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "aa" | ||
}, | ||
"gloss": { | ||
"gl": "stat", | ||
"en": "final" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}</div><div class='igl'>{ | ||
"metadata": "Delaware", | ||
"transcription": { | ||
"default": "kwənaskwat" | ||
}, | ||
"translation": "It is long grass.", | ||
"source": "(O'Meara 1990: 250)", | ||
"words": [ | ||
{ | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"analysis": { | ||
"default": "kwən-askw-at" | ||
}, | ||
"gloss": { | ||
"gl": "long-grass-inan", | ||
"en": "initial-medial-final" | ||
}, | ||
"morphemes": [ | ||
{ | ||
"transcription": { | ||
"default": "kwən" | ||
}, | ||
"gloss": { | ||
"gl": "long", | ||
"en": "initial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "askw" | ||
}, | ||
"gloss": { | ||
"gl": "grass", | ||
"en": "medial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "at" | ||
}, | ||
"gloss": { | ||
"gl": "inan", | ||
"en": "final" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}</div><div class='igl'>{ | ||
"metadata": "Blackfoot", | ||
"transcription": { | ||
"default": "sisáápittakit" | ||
}, | ||
"translation": "shred (the hide) into strips", | ||
"source": "(Frantz & Genee 2015)", | ||
"words": [ | ||
{ | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"analysis": { | ||
"default": "siso-ap-ittaki" | ||
}, | ||
"gloss": { | ||
"gl": "cut-stringlike-by.blade", | ||
"en": "initial-medial-final" | ||
}, | ||
"morphemes": [ | ||
{ | ||
"transcription": { | ||
"default": "siso" | ||
}, | ||
"gloss": { | ||
"gl": "cut", | ||
"en": "initial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "ap" | ||
}, | ||
"gloss": { | ||
"gl": "stringlike", | ||
"en": "medial" | ||
} | ||
}, | ||
{ | ||
"transcription": { | ||
"default": "ittaki" | ||
}, | ||
"gloss": { | ||
"gl": "by.blade", | ||
"en": "final" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}</div></ul> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang=en> | ||
<head> | ||
<meta charset=utf-8> | ||
<meta name=viewport content='width=device-width, initial-scale=1.0, shrink-to-fit=no'> | ||
<title>scription2html Samples</title> | ||
<meta name=author content='Daniel W. Hieber'> | ||
<link rel=author href=https://danielhieber.info> | ||
</head> | ||
<body> | ||
<h1>Chitimacha</h1> | ||
<ul><div class='igl'>{ | ||
"transcript": { | ||
"default": "wetkšˊ husˊ na·nča·kamankšˊ wetkˊ hi hokmiʔiˊ." | ||
}, | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"translation": "He left his brothers." | ||
}</div><div class='igl'>{ | ||
"transcript": { | ||
"default": "kunˊ ču·gšˊ ču·gšˊ, še·nink hupˊ hi ničwiʔiˊ." | ||
}, | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"translation": "He went and went till he came to the edge of a pond." | ||
}</div><div class='igl'>{ | ||
"transcript": { | ||
"default": "wetkšˊ we še·ninkˊ hi ničwinkišˊ, weykˊ hi kišutiʔiˊ." | ||
}, | ||
"transcription": { | ||
"default": "" | ||
}, | ||
"translation": "When he got to the edge of the pond, he swam it." | ||
}</div></ul> | ||
</body> | ||
</html> |
Oops, something went wrong.