diff --git a/docs/_sass/CETEIcean.scss b/docs/_sass/CETEIcean.scss new file mode 100644 index 0000000000..ddca74caee --- /dev/null +++ b/docs/_sass/CETEIcean.scss @@ -0,0 +1,901 @@ +/* This is a sample stylesheet for use with CETEIcean. It is not intended */ +/* to be comprehensive. The rules here are largely derived from earlier work */ +/* on TEI Boilerplate */ + +/* language support */ +/* render Arabic, Persian, Ottoman, Hebrew and Yiddish as rtl */ +[lang = "ar"], +[lang = "ota"], +[lang = "fa"], +[lang = "he"], +[lang = "yi"], +[lang *="-Arab-AR"]{ + direction:rtl; + text-align:right; +} +/* display latin and some other scripts as ltr */ +[lang = "en"], +[lang = "fr"], +[lang = "de"], +[lang = "it"], +[lang = "ru"], +[lang = "pl"], +[lang *="ar-Latn-"], +[lang *="ota-Latn-"]{ + direction:ltr; + text-align:left; +} + +/* Choice elements */ +tei-choice tei-abbr + tei-expan:before, +tei-choice tei-expan + tei-abbr:before, +tei-choice tei-sic + tei-corr:before, +tei-choice tei-corr + tei-sic:before, +tei-choice tei-orig + tei-reg:before, +tei-choice tei-reg + tei-orig:before { + content: " ("; +} +tei-choice tei-abbr + tei-expan:after, +tei-choice tei-expan + tei-abbr:after, +tei-choice tei-sic + tei-corr:after, +tei-choice tei-corr + tei-sic:after, +tei-choice tei-orig + tei-reg:after, +tei-choice tei-reg + tei-orig:after { + content: ")"; +} +/* A */ +tei-ab { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-accmat { + display: block; +} +tei-accmat:before { + content: "accompanying materials: "; +} +tei-acquisition { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-acquisition:before { + font-weight: bold; + content: "acquisition"; +} +tei-activity { + display: block; +} +tei-activity:before { + content: "activity: "; +} +tei-add[place=above] { + vertical-align: super; +} +tei-add[place=inline]:before { + content: "«"; +} +tei-add[place=inline]:after { + content: "»"; +} +tei-add[place=below] { + vertical-align: sub; +} +tei-additional { + display: block; +} +tei-additions { + display: block; +} +tei-additions:before { + content: "Significant additions within the document: "; +} +tei-addrline { + display: block; +} +tei-address[data-tei-rend~="block"], tei-addresss[data-tei-rendition~="#block"] { + display: block; +} +tei-admininfo { + display: block; +} +tei-app tei-note { + display: none; +} +tei-appinfo { + display: block; +} +tei-appinfo:before { + content: "Application information: "; +} +tei-application { + display: block; +} +tei-application:after { + content: " " attr(version); +} +tei-argument { + display: block; +} +tei-att { + font-family: Courier,monospace; +} +tei-att:before { + content: "@"; +} +tei-titlestmt > tei-author { + display: block; + margin-bottom: 1em; +} +tei-publicationstmt > tei-availability { + font-size: 80%; +} +tei-publicationstmt > tei-availability:before { + font-weight: bold; + content: "Availability: "; +} +tei-publicationstmt > tei-availability[data-tei-status]:before { + font-weight: bold; + content: "Availability (" attr(status) "): "; +} +/* B */ +tei-back { + display: block; +} +tei-bibl[data-tei-rend~="block"], bibl[data-tei-rendition~="#block"] { + display: block; + padding-left: 2em; + text-indent: -2em; +} +tei-biblfull { + display: block; +} +tei-binding { + display: block; +} +tei-binding:before { + content: "Binding: \a"; + white-space: pre-wrap; +} +tei-binding[data-tei-contemporary]:before { + content: "Binding: \A" "Contemporary: " attr(contemporary) "\A"; + white-space: pre-wrap; +} +tei-bindingdesc { + display: block; +} +tei-bindngdesc:before { + content: "Binding description: \A"; +} +tei-birth { + display: block; +} +tei-birth:before { + content: "Birth: "; +} +/* c */ +tei-crefpattern { + display: none; +} +tei-caption { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-case[data-tei-value]:before { + font-weight: bold; + content: attr(value) " "; +} +tei-castgroup { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-castitem { + display: list-item; +} +tei-castlist { + display: block; + list-style-type: none; + margin-top: 1em; + margin-bottom: 1em; + margin-left: 2em; +} +tei-cb { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-cb:before { + content: "[column break]"; +} +tei-cell { + display: table-cell; + border-right: thin solid black; + border-bottom: thin solid black; + padding: 2px; +} +/* for cell or row with @role = label */ +tei-cell[data-tei-role=label] { + font-weight: bold; +} +tei-climate { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-climate:before { + font-weight: bold; + content: "Climate: "; +} +tei-code { + font-family: Courier,monospace; +} +tei-collation { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-condition { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-constitution { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-constitution:before { + font-weight: bold; + content: "Constitution: "; +} +tei-constitution[data-tei-type] { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-constitution[data-tei-type]:before { + font-weight: bold; + content: "Constitution (" attr(type) "): "; +} +tei-constitution[data-tei-type=frags] { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-constitution[data-tei-type=frags]:before { + font-weight: bold; + content: "Constitution (fragments): "; +} +tei-custevent { + display: list-item; +} +tei-custodialhist { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +/* d */ +tei-date[data-tei-when]:empty:before { + content: attr(when); +} +/* e */ +tei-editionstmt { + display:block; +} +teieg-egxml { + display: block; + font-size: 80%; + margin-left: 1em; + padding-left: 1em; + border-left: 1px solid #aaaaaa; + margin-top: .75em; + margin-bottom: .75em; + padding-top: .75em; + padding-bottom: .75em; + font-family: monospace; + white-space: pre; +} +tei-emph { + font-style: italic; +} +tei-encodingdesc { + display: none; +} +tei-epigraph { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-explicit { + font-style: italic; +} +tei-filedesc > tei-extent { + display: none; +} +/* f */ +tei-figure { + display: block; + text-align: center; + margin-left: auto; + margin-right: auto; +} +/* g */ +tei-gap[data-tei-reason='lost']:before { + content:'['; +} +tei-gap[data-tei-reason='lost']:after { + content: attr(data-content) ']'; +} +tei-gap[data-tei-reason='illegible']:after { + content: attr(data-content); +} +tei-gi { + font-family: Courier,monospace; +} +tei-gi:before { + content: "<"; +} +tei-gi:after { + content: ">"; +} +/* h */ +tei-head { + display: block; +//LMD suppressed font-family wich was overriding Minima's settings. +// font-family: Arvo, sans-serif; + font-weight: normal; +} +tei-body > tei-head { + font-size: 180%; + text-indent: -0.5em; +} +tei-div.textpart { + display: none; +} +tei-div > tei-head { + font-size: 170%; + text-indent: -0.5em; +} +tei-div > tei-div > tei-head { + font-size: 155%; +} +tei-div > tei-div > tei-div > tei-head { + font-size: 140%; +} +tei-div > tei-div > tei-div > tei-div > tei-head, list > tei-head { + font-size: 130%; +} +tei-div > tei-div > tei-div > tei-div > tei-div > tei-head { + font-size: 120%; +} +tei-div > tei-div > tei-div > tei-div > tei-div > tei-div tei-head { + font-size: 110%; +} +tei-figure > tei-head { + display: block; + margin: 1.5em auto 1.5em auto; + padding: .5em 1.5em 1.5em 1.5em; + border: 1px solid black; + border-radius: 15px; + width: 325px; + position: relative; + border: 1px solid #aaaaaa; + background: #fafafa; + /* reset text-indent for note with ancestors. */ + text-indent: 0; + font-size: 85%; + text-align: justify; + -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); + width: 85%; + font-family: Georgia, Serif; + font-size: 13pt; +} +tei-hi[rend~="caps"] { + font-weight:bold; +} +tei-hi[rend~="italic"] { + font-style: italic; +} +tei-hi[rend~="underline"] { + text-decoration: underline; +} +tei-ident { + font-family: Courier,monospace; +} +tei-incipit { + font-style: italic; +} +tei-item { + display: list-item; + margin-left: 1em; +} +tei-cell tei-item { + margin-left: 1em; +} + +/* j */ + +/* l */ +tei-l { + display: block; + width: 35em; +} +tei-l[data-lineno]:before { + content: attr(data-lineno); + position: absolute; + left: 2em; +} +tei-lb:after { + content: '\a'; + white-space: pre; +} +tei-lg { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-list { + display: block; + margin-top: 1em; + margin-bottom: 1em; + list-style-type: none; +} +tei-item > tei-list { + margin-top: 0; +} +tei-sourcedesc tei-list { + list-style-type: none; +} +tei-sourcedesc > tei-list > tei-head { + font-size: 140%; + font-weight: bold; +} +tei-sourcedesc tei-list > tei-item { + display: list-item; +} +/* Match only lists that are descendants of +tei-text. Otherwise they show up in the header. */ +tei-text tei-list[type=simple] { + list-style-type: none; +} +tei-text tei-list[type=bulleted] { + list-style-type: disc; +} +tei-text tei-list[type=ordered] { + list-style-type: none; + counter-reset: items 0; +} +tei-text tei-list[type=ordered] > tei-item { + display: list-item; + margin-left: 0; +} +tei-item > tei-list[type=ordered] { + margin-left: 1em; +} +tei-text tei-list[type=ordered] > item:before { + counter-increment: items 1; + content: counter(items, decimal) ". "; +} +tei-text tei-list[type=gloss] { + list-style-type: none; +} +tei-list[type="gloss"] > tei-label { + display: block; + margin-top: 0.25em; + margin-bottom: 0.25em; + font-weight: bold; +} +tei-list[type="gloss"] > tei-item { + margin-left: 2em; +} +tei-item > tei-list[type=ordered] { + margin-left: 1em; +} +tei-listapp { + display: block; + margin: 1em; + padding: 1em; +} +tei-listbibl { + display:block; + list-style-type: none; + margin-left: .5em; + margin-top: .5em; +} +tei-listbibl > tei-head { + font-size: 120%; + font-weight: bold; +} +tei-listbibl > tei-bibl { + display: list-item; + margin-left: .5em; +} +tei-listwit { + display:block; + list-style-type: none; + margin-left: .5em; +} +tei-listwit > tei-head { + font-size: 120%; + font-weight: bold; +} +tei-listwit > tei-witness { + display: list-item; + margin-left: 2em; + text-indent: -1.1em; +} +tei-witness > tei-listwit { + display: inline; +} +tei-witness > tei-listwit > tei-head { + display: inline; +} +tei-witness > tei-listwit > tei-witness { + display: inline; +} +tei-locus { + display: none; +} + +/* m */ +tei-milestone { + display: none; + margin-left: auto; + margin-right: auto; + text-align: center; +} +tei-musicnotation { + font-weight: bold; +} +tei-musicnotation:before { + font-weight: bold; + content: "Musical Notation: "; +} +/* n */ +tei-node { + display: none; +} +tei-notesstmt { + display: none; +} +/* o */ +tei-ovar { + font-style: italic; +} +tei-origplace { + font-weight: bold; +} +tei-origplace:before { + font-weight: bold; + content: "Place of Origin: "; +} + +/* p */ +tei-p { + display: block; + margin-top: 1em; + margin-bottom: 1em; + text-align: justify; +} +*[data-tei-rendition~="#center"] tei-p { + text-align: center; +} +tei-availability > tei-p:first-child { + margin-top: 0em; +} +tei-performance { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-person { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-persongrp { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-postscript { + display: block; + margin-top: 2em; +} +tei-principal { + font-weight: bold; +} +tei-principal:before { + font-weight: bold; + content: "Principal: "; +} +tei-profiledesc { + display: none; +} +tei-publicationstmt > * { + display: none; +} +tei-publicationstmt { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-publicationstmt > date { + display: none; +} +tei-publicationstmt > publisher { + display: none; +} + +/* q */ +tei-q { + quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; +} +tei-q:before { + content: ""; +} +tei-q:after { + content: ""; +} +tei-q[data-tei-next]:after { + content: "" !important; +} +tei-q[data-tei-prev]:before { + content: "" !important; +} +tei-quote { + font-style:italic; +} + +/* r */ +tei-app tei-rdg { + /*perhaps choice */ + display:none; +} +tei-re { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-recordhist { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +// LMD commented out +//tei-ref { +// color: #5f0000; +// text-decoration: underline; +// cursor: pointer; +//} +tei-remarks { + font-weight: bold; +} +tei-remarks:before { + font-weight: bold; + content: "remarks: "; +} +tei-respstmt { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-revisiondesc { + display: none; +} +tei-row { + display: table-row; +} + +/* s */ +tei-salute { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-samplingdecl { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-scriptnote { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-seal { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-seal:before { + font-weight: bold; + content: "Seal: "; +} +tei-sealdesc { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-secfol:before { + font-weight: bold; + content: "Second Folio: "; +} +tei-secl>*:first-child:before { + content: "\a["; + white-space: pre; +} +tei-secl>*:last-child:after { + content: "]\a\a"; + white-space: pre; +} +tei-seg { + outline: 0px solid transparent; +} +tei-sense { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-seriesstmt { + display: none; +} +tei-setting { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-signed { + display: block; + margin-top: 2em; +} +tei-socalled { + quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; +} +tei-socalled:before { + content: open-quote; +} +tei-socalled:after { + content: close-quote; +} +tei-socalled[data-tei-next]:after { + content: "" !important; +} +tei-socalled[data-tei-prev]:before { + content: "" !important; +} +tei-sound { + font-style: italic; +} +tei-source { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-sourcedesc { + display: none; +} +tei-space:before { + font-weight: bold; + content: ""; +} +tei-span[data-tei-data-n]:before { + content: attr(data-n); +} +tei-speaker { + font-weight: bold; + margin-right: 0; +} +tei-sponsor { + display: block; + margin-top: 0; + margin-bottom: 0; +} +tei-sponsor:before { + font-weight: bold; + content: "Sponsor:"; +} +tei-stage { + display: block; + margin-top: 1em; + margin-bottom: 1em; + font-style: italic; +} +tei-stamp { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} +tei-stamp:before { + font-weight: bold; + content: "Stamped: "; +} + +tei-surplus>*:first-child:before { + content: "\a["; + white-space: pre; +} +tei-surplus>*:last-child:after { + content: "]\a\a"; + white-space: pre; +} +/* t */ +tei-tei { + display: block; +} +tei-table { + display: table; + border-top: thin solid black; + border-left: thin solid black; + margin-top: 2em; + margin-bottom: 2em; + font-size: 12pt; +} +tei-table > tei-head { + text-align: center; +} +tei-teiheader { + display: block; + margin-top: 2em; + margin-bottom: 2em; +} +tei-tei > tei-text { + display: block; + line-height: 1.5; +} +tei-textclass { + display: none; +} +tei-textdesc { + display: none; +} +/* title */ +tei-tei tei-title { + display: inline; +} +tei-tei tei-title[level=a] { + quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; +} +tei-tei tei-title[level=a]:before { + content: open-quote; +} +tei-tei tei-title[level=a]:after { + content: close-quote; +} +tei-tei tei-title[level=a][next]:after { + content: "" !important; +} +tei-tei tei-title[level=a][prev]:before { + content: "" !important; +} +tei-title[level=m] { + font-style: italic; +} +tei-titlestmt > tei-title { + display: block; + font-family: Arvo, sans-serif; + font-weight: normal; + font-weight: bold !important; + font-size: 150%; +} +tei-typedesc { + display: none; +} +/* u */ +tei-u:before { + content: "-"; +} +tei-view { + font-style: italic; +} +tei-wit { + display: inline; +} +tei-witdetail { + display:none; +} diff --git a/docs/_sass/cetei.scss b/docs/_sass/cetei.scss deleted file mode 100644 index 8dc1fc40f9..0000000000 --- a/docs/_sass/cetei.scss +++ /dev/null @@ -1,1866 +0,0 @@ -/* language support */ -/* render Arabic, Persian, Ottoman, Hebrew as rtl */ -/* LMD and yiddish :) */ -[lang = "yi"], -[lang = "ar"], -[lang = "ota"], -[lang = "fa"], -[lang = "he"], -[lang *="-Arab-AR"]{ - direction:rtl; - text-align:right; -} -/* display latin scripts as ltr */ -/* LMD and russian and polish :) */ -[lang = "ru"], -[lang = "pl"], -[lang = "en"], -[lang = "fr"], -[lang = "de"], -[lang = "it"], -[lang *="ar-Latn-"], -[lang *="ota-Latn-"]{ - direction:ltr; - text-align:left; -} - -/* Choice elements */ -tei-choice tei-abbr + tei-expan:before, -tei-choice tei-expan + tei-abbr:before, -tei-choice tei-sic + tei-corr:before, -tei-choice tei-corr + tei-sic:before, -tei-choice tei-orig + tei-reg:before, -tei-choice tei-reg + tei-orig:before { - content: " ("; -} -tei-choice tei-abbr + tei-expan:after, -tei-choice tei-expan + tei-abbr:after, -tei-choice tei-sic + tei-corr:after, -tei-choice tei-corr + tei-sic:after, -tei-choice tei-orig + tei-reg:after, -tei-choice tei-reg + tei-orig:after { - content: ")"; -} -/* A */ -tei-ab { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-accMat { - display: block; -} -tei-accMat:before { - content: "accompanying materials: "; -} -tei-acquisition { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-acquisition:before { - font-weight: bold; - content: "acquisition"; -} -tei-activity { - display: block; -} -tei-activity:before { - content: "activity: "; -} -tei-actor { - /* Empty Rule Set */ -} -/* add */ -/* Could add other [place=] variations */ -tei-add[place=above] { - vertical-align: super; -} -tei-add[place=inline]:before { - content: "«"; -} -tei-add[place=inline]:after { - content: "»"; -} -tei-add[place=below] { - vertical-align: sub; -} -tei-addName { - /* Empty Rule Set */ -} -tei-addSpan { - /* Empty Rule Set */ -} -tei-additional { - display: block; -} -tei-additions { - display: block; -} -tei-additions:before { - content: "Significant additions within the document: "; -} -tei-addrLine { - display: block; -} -tei-address { - /* Empty Rule Set */ -} -tei-address[data-tei-rend~="block"], addresss[data-tei-rendition~="#block"] { - display: block; -} -tei-adminInfo { - display: block; -} -tei-affiliation { - /* Empty Rule Set */ -} -tei-age { - /* Empty Rule Set */ -} -tei-alt { - /* Empty Rule Set */ -} -tei-altGrp { - /* Empty Rule Set */ -} -tei-altIdent { - /* Empty Rule Set */ -} -tei-altIdentifier { - /* Empty Rule Set */ -} -tei-am { - /* Empty Rule Set */ -} -tei-analytic { - /* Empty Rule Set */ -} -tei-anchor { - /* Empty Rule Set */ -} -tei-app { - /* Empty Rule Set */ -} -tei-app tei-note { - display: none; -} -tei-appInfo { - display: block; -} -tei-appInfo:before { - content: "Application information: "; -} -tei-application { - display: block; -} -tei-application:after { - content: " " attr(version); -} -tei-arc { - /* Empty Rule Set */ -} -tei-argument { - display: block; -} -tei-att { - font-family: Courier,monospace; -} -tei-att:before { - content: "@"; -} -tei-attDef { - /* Empty Rule Set */ -} -tei-attList { - /* Empty Rule Set */ -} -tei-attRef { - /* Empty Rule Set */ -} -tei-author { - /* Empty Rule Set */ -} -tei-titleStmt > tei-author { - display: block; - margin-bottom: 1em; -} -tei-authority { - /* Empty Rule Set */ -} -tei-publicationStmt > tei-availability { - font-size: 80%; -} -tei-publicationStmt > tei-availability:before { - font-weight: bold; - content: "Availability: "; -} -tei-publicationStmt > tei-availability[data-tei-status]:before { - font-weight: bold; - content: "Availability (" attr(status) "): "; -} -/* B */ -tei-back { - display: block; -} -tei-bibl { - /* Empty Rule Set */ -} -tei-bibl[data-tei-rend~="block"], bibl[data-tei-rendition~="#block"] { - display: block; - padding-left: 2em; - text-indent: -2em; -} -tei-biblFull { - display: block; -} -tei-biblScope { - /* Empty Rule Set */ -} -tei-biblStruct { - /* Empty Rule Set */ -} -tei-bicond { - /* Empty Rule Set */ -} -tei-binary { - /* Empty Rule Set */ -} -tei-binaryObject { - /* Empty Rule Set */ -} -tei-binding { - display: block; -} -tei-binding:before { - content: "Binding: \a"; - white-space: pre-wrap; -} -tei-binding[data-tei-contemporary]:before { - content: "Binding: \A" "Contemporary: " attr(contemporary) "\A"; - white-space: pre-wrap; -} -tei-bindingDesc { - display: block; -} -tei-bindngDesc:before { - content: "Binding Description: \A"; -} -tei-birth { - display: block; -} -tei-birth:before { - content: "Birth: "; -} -tei-bloc { - /* Empty Rule Set */ -} -tei-broadcast { - /* Empty Rule Set */ -} -tei-byline { - /* Empty Rule Set */ -} -/* c */ -tei-c { - /* Empty Rule Set */ -} -tei-cRefPattern { - display: none; -} -tei-caesura { - /* Empty Rule Set */ -} -tei-camera { - /* Empty Rule Set */ -} -tei-caption { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-case[data-tei-value]:before { - font-weight: bold; - content: attr(value) " "; -} -tei-castGroup { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-castItem { - display: list-item; -} -tei-castList { - display: block; - list-style-type: none; - margin-top: 1em; - margin-bottom: 1em; - margin-left: 2em; -} -tei-catDesc { - /* Empty Rule Set */ -} -tei-catRef { - /* Empty Rule Set */ -} -tei-category { - /* Empty Rule Set */ -} -tei-cb { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-cb:before { - content: "[column break]"; -} -tei-cell { - display: table-cell; - padding: 1em 1.5em 1em 1em; - /* -tei-border-left: 2px solid @border-color; -tei-border-top:2px solid @border-color; -tei-*/ - border: 1px dotted #aaaaaa; - width: 100%; -} -/* for cell or row with @role = label */ -tei-[data-tei-role=label] { - font-weight: bold; -} -tei-certainty { - /* Empty Rule Set */ -} -tei-change { - /* Empty Rule Set */ -} -tei-channel { - /* Empty Rule Set */ -} -tei-charDecl { - /* Empty Rule Set */ -} -tei-charName { - /* Empty Rule Set */ -} -tei-charProp { - /* Empty Rule Set */ -} -tei-choice { - /* Empty Rule Set */ -} -tei-cit { - /* Empty Rule Set */ -} -tei-cl { - /* Empty Rule Set */ -} -tei-classCode { - /* Empty Rule Set */ -} -tei-classDecl { - /* Empty Rule Set */ -} -tei-classRef { - /* Empty Rule Set */ -} -tei-classSpec { - /* Empty Rule Set */ -} -tei-classes { - /* Empty Rule Set */ -} -tei-climate { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-climate:before { - font-weight: bold; - content: "Climate: "; -} -tei-closer { - /* Empty Rule Set */ -} -tei-code { - font-family: Courier,monospace; -} -/* jawalsh: -For things like collation, condition, etc. that can have text or paragraphs as -children, we should use margins, when the content is text, and no margins when there -are child paragraphs (or other block elements). Otherwise we end up with double -margins. */ -tei-collation { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-collection { - /* Empty Rule Set */ -} -tei-colloc { - /* Empty Rule Set */ -} -tei-colophon { - font-style: italic; -} -tei-cond { - /* Empty Rule Set */ -} -tei-condition { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-constitution { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-constitution:before { - font-weight: bold; - content: "Constitution: "; -} -tei-constitution[data-tei-type] { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-constitution[data-tei-type]:before { - font-weight: bold; - content: "Constitution (" attr(type) "): "; -} -tei-constitution[data-tei-type=frags] { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-constitution[data-tei-type=frags]:before { - font-weight: bold; - content: "Constitution (fragments): "; -} -tei-constraint { - /* Empty Rule Set */ -} -tei-constraintSpec { - /* Empty Rule Set */ -} -tei-content { - /* Empty Rule Set */ -} -/* jawalsh: -tei-Need to discuss and coordinate handling of sic/corr, abbr/expan, and orig/reg */ -tei-corr { - /* Empty Rule Set */ -} -tei-correction { - /* Empty Rule Set */ -} -tei-country { - /* Empty Rule Set */ -} -tei-creation { - /* Empty Rule Set */ -} -/*jawalsh: -tei-Need to handle attributes for custEvent. All the att.datable* attributes will be tricky. -tei-custodialHist and custEvent may normally be hidden along with other header metadata, but -tei-we'll have other datable elements that may be tricky. */ -tei-custEvent { - display: list-item; -} -tei-custodialHist { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -/* d */ -tei-date[data-tei-when]:empty:before { - content: attr(when); -} -/* e */ -tei-editionStmt { - display:block; -} - -// LMD: inspired by TEI-BP - but probably not used? TODO: remove. -tei-titleStmt > tei-editor { - display: block; -} - -tei-titleStmt > tei-editor[role]:before { - content: attr(role) ': '; -} -tei-titleStmt > tei-editor:before { - content: "Edited by "; -} - -tei-egXML { - display: block; - font-size: 80%; - margin-left: 1em; - padding-left: 1em; - border-left: 1px solid #aaaaaa; - margin-top: .75em; - margin-bottom: .75em; - padding-top: .75em; - padding-bottom: .75em; - font-family: monospace; - white-space: pre; -} -tei-emph { - font-style: italic; -} -tei-encodingDesc { - display: none; -} -tei-epigraph { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-explicit { - font-style: italic; -} -tei-fileDesc > extent { - display: none; -} -/* f */ -tei-figure { - display: block; - text-align: center; - margin-left: auto; - margin-right: auto; -} -/* g */ -tei-g { - /* Empty Rule Set */ -} -tei-gap { - /* GLS: Depending upon how we handle gap and lacuna, we may want to enclose in [] */ -} -tei-gap[data-tei-reason='lost']:before { - content:'['; -} -tei-gap[data-tei-reason='lost']:after { - content: attr(data-content) ']'; -} -tei-gap[data-tei-reason='illegible']:after { - content: attr(data-content); -} -tei-gb { - /* Empty Rule Set */ -} -tei-gen { - /* Empty Rule Set */ -} -tei-genName { - /* Empty Rule Set */ -} -tei-geo { - /* Empty Rule Set */ -} -tei-geoDecl { - /* Empty Rule Set */ -} -tei-geogFeat { - /* Empty Rule Set */ -} -tei-geogName { - /* Empty Rule Set */ -} -tei-gi { - font-family: Courier,monospace; -} -tei-gi:before { - content: "<"; -} -tei-gi:after { - content: ">"; -} -tei-gloss { - /* Empty Rule Set */ -} -tei-glyph { - /* Empty Rule Set */ -} -tei-glyphName { - /* Empty Rule Set */ -} -tei-gram { - /* Empty Rule Set */ -} -tei-gramGrp { - /* Empty Rule Set */ -} -tei-graph { - /* Empty for now */ -} -tei-graphic { -} -tei-group { - /* Empty Rule Set */ -} -/* h */ -tei-handDesc { - /* Empty Rule Set */ -} -tei-handNote { - /* Empty Rule Set */ -} -tei-handNotes { - /* Empty Rule Set */ -} -tei-handShift { - /* Empty Rule Set */ -} -/* Need head with TEI parent to distinguish from HTML head */ -tei-TEI tei-head { - display: block; -//LMD suppressed font-family wich was overriding Minima's settings. -// font-family: Arvo, sans-serif; - font-weight: normal; -} -tei-body > tei-head { - font-size: 180%; - text-indent: -0.5em; -} -tei-div.textpart { - display: none; -} -tei-div > tei-head { - font-size: 170%; - text-indent: -0.5em; -} -tei-div > tei-div > tei-head { - font-size: 155%; -} -tei-div > tei-div > tei-div > tei-head { - font-size: 140%; -} -tei-div > tei-div > tei-div > tei-div > tei-head, list > tei-head { - font-size: 130%; -} -tei-div > tei-div > tei-div > tei-div > tei-div > tei-head { - font-size: 120%; -} -tei-div > tei-div > tei-div > tei-div > tei-div > tei-div tei-head { - font-size: 110%; -} -tei-figure > tei-head { - display: block; - margin: 1.5em auto 1.5em auto; - padding: .5em 1.5em 1.5em 1.5em; - border: 1px solid black; - border-radius: 15px; - width: 325px; - position: relative; - border: 1px solid #aaaaaa; - background: #fafafa; - /* reset text-indent for note with ancestors. */ - text-indent: 0; - font-size: 85%; - text-align: justify; - -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); - box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); - width: 85%; - font-family: Georgia, Serif; - font-size: 13pt; -} -tei-headItem { - /* Empty Rule Set */ -} -tei-headLabel { - /* Empty Rule Set */ -} -tei-height { - /* Empty Rule Set */ -} -tei-heraldry { - /* Empty Rule Set */ -} -tei-hi[rend="caps"] { - font-weight:bold; -} -tei-hi[rend="italic"] { - font-style: italic; -} -tei-hi { - /* GLS: do we want to bold this or change the background color? */ -} -tei-history { - /* Empty Rule Set */ -} -tei-hom { - /* Empty Rule Set */ -} -tei-hyph { - /* Empty Rule Set */ -} -tei-hyphenation { - /* Empty Rule Set */ -} -/* i */ -tei-iNode { - /* Empty Rule Set */ -} -tei-iType { - /* Empty Rule Set */ -} -tei-ident { - font-family: Courier,monospace; -} -tei-idno { - /* Empty Rule Set */ -} -tei-if { - /* Empty Rule Set */ -} -tei-iff { - /* Empty Rule Set */ -} -tei-imprimatur { - /* Empty Rule Set */ -} -tei-imprint { - /* Empty Rule Set */ -} -tei-incident { - /* Empty Rule Set */ -} -tei-incipit { - font-style: italic; -} -tei-index { - /* Empty Rule Set */ -} -tei-institution { - /* Empty Rule Set */ -} -tei-interaction { - /* Empty Rule Set */ -} -tei-interpGrp { - /* Empty Rule Set */ -} -tei-interpretation { - /* Empty Rule Set */ -} -tei-item { - display: list-item; - margin-left: 1em; -} -tei-cell item { - margin-left: 1em; -} - -/* j */ -tei-join { - /* Empty Rule Set */ -} -tei-joinGrp { - /* Empty Rule Set */ -} -/* k */ -tei-keywords { - /* Empty Rule Set */ -} -tei-kinesic { - /* Empty Rule Set */ -} -/* l */ -tei-l { - display: block; - width: 35em; -} -tei-l[data-lineno]:before { - content: attr(data-lineno); - position: absolute; - left: 2em; -} -tei-lacunaEnd { - /* Empty Rule Set */ -} -tei-lacunaStart { - /* Empty Rule Set */ -} -tei-lang { - /* Empty Rule Set */ -} -tei-langKnowledge { - /* Empty Rule Set */ -} -tei-langKnown { - /* Empty Rule Set */ -} -tei-langUsage { - /* Empty Rule Set */ -} -tei-language { - /* Empty Rule Set */ -} -tei-layout { - /* Empty Rule Set */ -} -tei-layoutDesc { - /* Empty Rule Set */ -} -tei-lb { - /* Empty Rule Set */ -} -tei-lb:after { - content: '\a'; - white-space: pre; -} -tei-lbl { - /* Empty Rule Set */ -} -tei-leaf { - /* Empty Rule Set */ -} -tei-app[data-tei-type=inline] tei-lem { -} -tei-lg { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-link { - /* Empty Rule Set */ -} -tei-linkGrp { - /* Empty Rule Set */ -} -tei-list { - display: block; - margin-top: 1em; - margin-bottom: 1em; - list-style-type: none; -} -tei-item > tei-list { - margin-top: 0; -} -tei-sourceDesc tei-list { - list-style-type: none; -} -tei-sourceDesc > tei-list > tei-head { - font-size: 140%; - font-weight: bold; -} -tei-sourceDesc tei-list > tei-item { - display: list-item; -} - -/* Match only lists that are descendants of -tei-text. Otherwise they show up in the header. */ -tei-text tei-list[type=simple] { - list-style-type: none; -} -tei-text tei-list[type=bulleted] { - list-style-type: disc; -} -tei-text tei-list[type=ordered] { - list-style-type: none; - counter-reset: items 0; -} -tei-text tei-list[type=ordered] > tei-item { - display: list-item; - margin-left: 0; -} -tei-item > tei-list[type=ordered] { - margin-left: 1em; -} -tei-text tei-list[type=ordered] > item:before { - counter-increment: items 1; - content: counter(items, decimal) ". "; -} -tei-text tei-list[type=gloss] { - list-style-type: none; -} -tei-list[type="gloss"] > tei-label { - display: block; - margin-top: 0.25em; - margin-bottom: 0.25em; - font-weight: bold; -} -tei-list[type="gloss"] > tei-item { - margin-left: 2em; -} -tei-item > tei-list[type=ordered] { - margin-left: 1em; -} -tei-listApp { - display: block; - margin: 1em; - padding: 1em; -} - -/* sourceDesc lists */ -tei-listBibl { - display:block; - list-style-type: none; - margin-left: .5em; - margin-top: .5em; -} -tei-listBibl > tei-head { - font-size: 120%; - font-weight: bold; -} -tei-listBibl > tei-bibl { - display: list-item; - margin-left: .5em; -} -tei-listWit { - display:block; - list-style-type: none; - margin-left: .5em; -} -tei-listWit > tei-head { - font-size: 120%; - font-weight: bold; -} -tei-listWit > tei-witness { - display: list-item; - margin-left: 2em; - text-indent: -1.1em; -} -tei-witness > tei-listWit { - display: inline; -} -tei-witness > tei-listWit > tei-head { - display: inline; -} -tei-witness > tei-listWit > tei-witness { - display: inline; -} -tei-localName { - /* Empty Rule Set */ -} -tei-locale { - /* Empty Rule Set */ -} -tei-location { - /* Empty Rule Set */ -} -tei-locus { - display: none; -} -tei-locusGrp { - /* Empty Rule Set */ -} -/* m */ -tei-m { - /* Empty Rule Set */ -} -tei-macroRef { - /* Empty Rule Set NOT SURE WHAT EXACTLY*/ -} -tei-macroSpec { - /* dunno */ -} -tei-mapping { - /* not sure, maybe create rends for a few standard types, maybe hide */ -} -tei-material { - /* Empty Rule Set */ -} -tei-measure { - /* Empty Rule Set */ -} -tei-measureGrp { - /* probably want to display attributes, at least units and type */ -} -tei-meeting { - /*Block */ -} -tei-memberOf { - /* Empty Rule Set */ -} -tei-mentioned { - /* think do nothing, not real clear on function, maybe hide? */ -} -tei-metDecl { - /* Empty Rule Set */ -} -tei-metSym { - /* Empty Rule Set */ -} -tei-milestone { - display: none; - margin-left: auto; - margin-right: auto; - text-align: center; -} -tei-milestone:before { - /*content: "* * * * *";*/ -} -tei-moduleRef { - /* probably hide, not sure how we want to deal */ -} -tei-moduleSpec { - /* probably hide, not sure how we want to deal */ -} -tei-monogr { - /* block with space above, below */ -} -tei-mood { - /* Empty Rule Set */ -} -tei-move { - /* not sure, block, maybe just ital, maybe in parenths*/ -} -tei-msContents { - /* inline */ -} -tei-msDesc { - /* block with space above, below */ -} -tei-msIdentifier { - /* block */ -} -tei-msItem { - /* block */ -} -tei-msItemStruct { - /* block */ -} -tei-msName { - /* Empty Rule Set */ -} -tei-msPart { - /* not sure, think block */ -} -tei-musicNotation { - font-weight: bold; -} -tei-musicNotation:before { - font-weight: bold; - content: "Musical Notation: "; -} -/* n */ -tei-name { - /* Empty Rule Set */ -} -tei-nameLink { - /* Empty Rule Set */ -} -tei-namespace { - /* not sure, hide? */ -} -tei-nationality { - /* Empty Rule Set */ -} -tei-node { - display: none; -} -tei-normalization { - /* Empty Rule Set */ -} -tei-note { - /* - display: block; - margin: 1.5em auto 1.5em auto; - padding: .5em 1.5em 1.5em 1.5em; - border: 1px solid black; - border-radius: 15px; - width: 325px; - position: relative; - border: 1px solid #aaaaaa; - background: #fafafa; - /* reset text-indent for note with ancestors. */ - /* - text-indent: 0; - font-size: 85%; - text-align: justify; - -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); - -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); - box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); - */ -} -tei-notesStmt { - /* do we want to box each individual if they're in a ? */ - display: none; -} -tei-num { - /* Empty Rule Set */ -} -tei-number { - /* Empty Rule Set */ -} -tei-numeric { - /* not sure, depends how we're dealing with 's */ -} -tei-nym { - /* not really sure here */ -} -/* o */ -tei-oRef { - /* not sure, think do nothing */ -} -tei-oVar { - font-style: italic; -} -tei-objectDesc { - /* Empty Rule Set */ -} -tei-objectType { - /* Empty Rule Set */ -} -tei-occupation { - /* Empty Rule Set */ -} -tei-offset { - /* Empty Rule Set */ -} -tei-opener { - /* Empty Rule Set */ -} -tei-org { - /* Empty Rule Set */ -} -tei-orgName { - /* Empty Rule Set */ -} -tei-origDate { - /* Empty Rule Set */ -} -tei-origPlace { - font-weight: bold; -} -tei-origPlace:before { - font-weight: bold; - content: "Place of Origin: "; -} -tei-origin { - /* Empty Rule Set */ -} -/* p */ -tei-p { - display: block; - margin-top: 1em; - margin-bottom: 1em; - text-align: justify; -} -*[data-tei-rendition~="#center"] p { - text-align: center; -} -tei-availability > p:first-child { - margin-top: 0em; -} -tei-pRef { - /* rend attribute target */ -} -tei-pVar { - /* rend attribute target */ -} -tei-particDesc { - /* Empty Rule Set */ -} -tei-pause { - /* Empty Rule Set*/ -} -tei-pb { - /* - display: block; - width: 100%; - text-align: right; - color: gray; - margin: 2em 0 2em 0; - font-size: 11pt; - */ -} -/* -tei-pb:before { -tei- content: "[page:\a0" attr(n) "]"; -} -tei-*/ -tei-pc { - /* Empty Rule Set */ -} -tei-per { - /* don't know, check back */ -} -tei-performance { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-persName { - /* Empty Rule Set */ -} -tei-person { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-personGrp { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-phr { - /* Empty Rule Set */ -} -tei-physDesc { - /* Empty Rule Set */ -} -tei-place { - /* Empty Rule Set */ -} -tei-placeName { - /* Empty Rule Set */ -} -tei-population { - /* dunno with this one */ -} -tei-pos { - /* Empty Rule Set */ -} -tei-postBox { - /* Empty Rule Set */ -} -tei-postCode { - /* Empty Rule Set */ -} -tei-postscript { - display: block; - margin-top: 2em; -} -tei-precision { - /* Empty Rule Set */ -} -tei-preparedness { - /* Empty Rule Set */ -} -tei-principal { - font-weight: bold; -} -tei-principal:before { - font-weight: bold; - content: "Principal: "; -} -tei-profileDesc { - display: none; -} -tei-projectDesc { - /* Empty Rule Set */ -} -tei-prologue { - /* Empty Rule Set */ -} -tei-pron { - /* Empty Rule Set */ -} -tei-provenance { - /* inline */ -} -tei-pubPlace { - /* Empty Rule Set */ -} -tei-publicationStmt > * { - display: none; -} -tei-publicationStmt { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-publicationStmt > date { - display: none; -} -tei-publicationStmt > publisher { - display: none; -} -tei-purpose { - /* Empty Rule Set */ -} -/* q */ -tei-q { - quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; -} -tei-q:before { - content: ""; -} -tei-q:after { - content: ""; -} -tei-q[data-tei-next]:after { - content: "" !important; -} -tei-q[data-tei-prev]:before { - content: "" !important; -} -tei-quotation { - /* Empty Rule Set */ -} -tei-quote { - tei-font-style:italic; -} -/* -tei-quote { - quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; -} -tei-quote:before { - content: open-quote; -} -tei-quote:after { - content: close-quote; -} -tei-quote[next]:after { - content: "" !important; -} -tei-quote[prev]:before { - content: "" !important; -} -tei-*/ -/* r */ -tei-app tei-rdg { - /*perhaps choice */ - display:none; -} -tei-rdgGrp { - /* Empty Rule Set */ -} -tei-re { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-recordHist { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-recording { - /* not sure here, only in header? */ -} -tei-recordingStmt { - /* Empty Rule Set */ -} -// LMD commented out -//tei-ref { -// color: #5f0000; -// text-decoration: underline; -// cursor: pointer; -//} -tei-region { - /* Empty Rule Set */ -} -tei-relatedItem { - /* Empty Rule Set */ -} -tei-relation { - /* Don't Know*/ -} -tei-relationGrp { - /* Empty Rule Set */ -} -tei-remarks { - font-weight: bold; -} -tei-remarks:before { - font-weight: bold; - content: "remarks: "; -} -tei-rendition { - /*Don't remember what we decided to do with this*/ -} -tei-repository { - /* Empty Rule Set */ -} -tei-residence { - /* Empty Rule Set */ -} -tei-resp { - /* Empty Rule Set */ -} -tei-respStmt { - display: block; - margin-top: 0; - margin-bottom: 0; -} -/* hide */ -tei-restore { - /* footnote or sidenote perhaps*/ -} -tei-revisionDesc { - display: none; -} -tei-rhyme { - /* Empty Rule Set */ -} -tei-role { - /* put on same line as roledesc? */ -} -tei-roleDesc { - /* put on same line as role */ -} -tei-roleName { - /* Empty Rule Set */ -} -tei-root { - /* don't know */ -} -tei-row { - display: table-row; -} -tei-rs { - /* Empty Rule Set */ -} -/*label*/ -/* s */ -/* When TEI document is embedded in HTML page, - TEI's element can be interpreted by - browser as HTML , which results in - a strike-through from the "user agent" - styles. */ -tei-s { - text-decoration: none; -} -tei-said { - /* Empty Rule Set */ -} -tei-salute { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-samplingDecl { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-schemaSpec { - /*NOT SURE, talk over with group */ -} -tei-scriptDesc { - /*NOT SURE, talk over with group */ -} -tei-scriptNote { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-scriptStmt { - /* not sure */ -} -tei-seal { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-seal:before { - font-weight: bold; - content: "Seal: "; -} -tei-sealDesc { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-secFol:before { - font-weight: bold; - content: "Second Folio: "; -} -tei-secl { -} -tei-secl>*:first-child:before { - content: "\a["; - white-space: pre; -} -tei-secl>*:last-child:after { - content: "]\a\a"; - white-space: pre; -} -tei-seg { - /* Empty Set Rule */ - outline: 0px solid transparent; -} -tei-segmentation { - /* Empty Rule Set */ -} -tei-sense { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-series { - /* treat same as seriesstmt? */ -} -tei-seriesStmt { - display: none; -} -tei-set { - /* Empty Set Rule */ -} -tei-setting { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-settingDesc { - /* Empty Set Rule */ -} -tei-settlement { - /* Empty Set Rule */ -} -tei-sex { - /* Empty Rule Set */ -} -tei-shift { - /* seems a bit to complex to do anything with */ -} -tei-sic { - /* rend as choice when contained within a choice tag, perhaps as label with parenthesis after when alone */ -} -tei-signatures { - /* DON't KNOW, look again later */ -} -tei-signed { - display: block; - margin-top: 2em; - /*should make name a block when contained within */ -} -tei-soCalled { - quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; -} -tei-soCalled:before { - content: open-quote; -} -tei-soCalled:after { - content: close-quote; -} -tei-soCalled[data-tei-next]:after { - content: "" !important; -} -tei-soCalled[data-tei-prev]:before { - content: "" !important; -} -tei-socecStatus { - /* Empty Set Rule */ -} -tei-sound { - font-style: italic; -} -tei-source { - display: block; - margin-top: 0; - margin-bottom: 0; -} -tei-sourceDesc { - display: none; -} -tei-sp { - /*empty rule set*/ -} -tei-space:before { - font-weight: bold; - content: ""; -} -tei-span[data-tei-data-n]:before { - content: attr(data-n); -} -tei-TEI tei-span { - /*no rules yet */ -} -tei-TEI tei-egXML tei-span { - display: inline; -} -tei-spanGrp { - /* NOT SURE, look back on */ -} -tei-speaker { - font-weight: bold; - margin-right: 0; -} -tei-specDesc { - /* NOT SURE, look back on */ -} -tei-specGrp { - /* NOT SURE, look back on */ -} -tei-specGrpRef { - /* NOT SURE, look back on */ -} -tei-specList { - /* Empty Set Rule */ -} -tei-sponsor { - display: block; - margin-top: 0; - margin-bottom: 0; - /* Block element, maybe labeled */ -} -tei-sponsor:before { - font-weight: bold; - content: "Sponsor:"; -} -tei-stage { - display: block; - margin-top: 1em; - margin-bottom: 1em; - font-style: italic; -} -tei-stamp { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} -tei-stamp:before { - font-weight: bold; - content: "Stamped: "; -} -tei-state { - /* Empty Set Rule */ -} -tei-stdVals { - /* Empty Set Rule */ -} -tei-street { - /* Empty Set Rule */ -} -tei-stress { - /* Empty Set Rule */ -} -tei-string { - /* Empty Set Rule */ -} -tei-stringVal { - /* doesn't seem to be part of tei 5 */ -} -tei-subc { - /* Empty Set Rule */ -} -tei-subst { - /* Empty Set Rule */ -} -tei-summary { - /* Empty Set Rule */ -} -tei-superEntry { - /* Block with space above and below, maybe have no block and space for when contained by this element */ -} -tei-supplied { - /* not sure on this one, seems like we should indicate somehow. Is there a standard way to do this? */ -} -tei-support { - /* Empty Set Rule */ -} -tei-supportDesc { - /* do nothing with or maybe block */ -} -tei-surface { - /* choice */ -} -tei-surname { - /* Empty Set Rule */ -} -tei-surplus { -} -tei-surplus>*:first-child:before { - content: "\a["; - white-space: pre; -} -tei-surplus>*:last-child:after { - content: "]\a\a"; - white-space: pre; -} -tei-surrogates { - /*Empty Rule Set */ -} -tei-syll { - /* Empty Set Rule */ -} -tei-symbol { - /* Empty Set Rule */ -} -/* t */ -tei-TEI { - display: block; -} -tei-table { - border-collapse: separate; - border-spacing: 2px; -} -/* Why is this selector "TEI table" instead of just "table"? */ -tei-TEI tei-table { - display: block; - margin-top: 2em; - margin-bottom: 2em; - font-size: 12pt; -} -tei-table > head { - text-align: center; -} -tei-teiHeader { - display: block; - /* -tei-border-radius: 15px; -tei-border: 1px solid black; -tei-background:white; -tei-*/ - margin-top: 2em; - margin-bottom: 2em; -} -tei-TEI > tei-text { - display: block; - /* -tei-border-radius: 15px; -tei-border: 1px solid black; -tei-background:white; -tei-*/ - line-height: 1.5; -} -tei-textClass { - display: none; -} -tei-textDesc { - display: none; -} -/* title */ -/* Need TEI ancestor to distinguish TEI title from HTML title */ -tei-TEI tei-title { - display: inline; -} -tei-TEI tei-title[level=a] { - quotes: "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d" "\2018" "\2019" "\201c" "\201d"; -} -tei-TEI tei-title[level=a]:before { - content: open-quote; -} -tei-TEI tei-title[level=a]:after { - content: close-quote; -} -tei-TEI tei-title[level=a][next]:after { - content: "" !important; -} -tei-TEI tei-title[level=a][prev]:before { - content: "" !important; -} -tei-title[level=m] { - font-style: italic; -} -tei-titleStmt > tei-title { - display: block; - font-family: Arvo, sans-serif; - font-weight: normal; - font-weight: bold !important; - font-size: 150%; -} -tei-typeDesc { - display: none; -} -/* u */ -tei-u:before { - content: "-"; -} -tei-unicodeName { - /* Empty Rule Set */ -} -tei-usg { - /* Empty Rule Set */ -} -/* v */ -tei-vAlt { - /* Empty Rule Set */ -} -tei-vColl { - /* Empty Rule Set */ -} -tei-vDefault { - /* Empty Rule Set */ -} -tei-vLabel { - /* Empty Rule Set */ -} -tei-vMerge { - /* Empty Rule Set */ -} -tei-vNot { - /* Empty Rule Set */ -} -tei-vRange { - /* Empty Rule Set */ -} -tei-val { - /* Empty Rule Set */ -} -tei-valDesc { - /* Empty Rule Set */ -} -tei-valItem { - /* Empty Rule Set */ -} -tei-valList { - /* Empty Rule Set */ -} -tei-value { - /* Empty Rule Set */ -} -tei-variantEncoding { - /* Empty Rule Set */ -} -tei-view { - font-style: italic; -} -tei-vocal { - /* Empty Rule Set */ -} -/* w */ -tei-w { - /* Empty Rule Set */ -} -tei-watermark { - /* Empty Rule Set */ -} -tei-when { - /* Empty Rule Set */ -} -tei-width { - /* Empty Rule Set */ -} -tei-wit { - /* Empty Rule Set */ - display: none; -} -tei-witDetail { - display:none; - /* Empty Rule Set */ -} -tei-witEnd { - /* Empty Rule Set */ -} -tei-witStart { - /* Empty Rule Set */ -} -tei-writing { - /* Empty Rule Set */ -} -/* x */ -tei-xr { - /* Empty Rule Set */ -} -/* z */ -tei-zone { - /* Empty Rule Set */ -} - -// LMD: commented out. -///* styles for html shell and html elements in TEI (e.g., and ) */ -//html > body { -// margin: 0; -// padding: 0; -//} -//html { -// margin: 0; -// padding: 0; -// margin-left: 2em; -// margin-right: 4em; -// padding: 2.5em; -// font-family: "Lucida Grande", "Cardo", "Arial Unicode MS","Galilee Unicode Gk", "New Athena Unicode", "Athena Unicode", "Palatino Linotype", "Titus Cyberbit Basic", "Vusillus Old Face", "Alphabetum", "Galatia SIL", "Code 2000", "GentiumAlt", "Gentium", "Minion Pro", "GeorgiaGreek", "Vusillus Old Face Italic", "Everson Mono", "Aristarcoj", "Porson", "Legendum", "Aisa Unicode", "Hindsight Unicode", "Caslon", "Verdana", "Tahoma"; -// font-size: 12pt; -// background-color: white; -// color: #292929; -//} diff --git a/docs/_sass/main.scss b/docs/_sass/main.scss index 1d138e9968..7539a60b0d 100644 --- a/docs/_sass/main.scss +++ b/docs/_sass/main.scss @@ -1,5 +1,5 @@ @import "minima"; @import "blog"; @import "facsimile"; -@import "cetei"; +@import "CETEIcean"; @import "tei"; diff --git a/docs/_sass/tei.scss b/docs/_sass/tei.scss index df9b6df606..4aa874bf74 100644 --- a/docs/_sass/tei.scss +++ b/docs/_sass/tei.scss @@ -3,7 +3,7 @@ tei-body > tei-head { font-size: 36px; letter-spacing: -1px; line-height: 1; - text-indent: 0em; + text-indent: 0; margin-block-end: 15px; margin-bottom: 15px; } @@ -109,15 +109,15 @@ tei-org { margin-bottom: $tei-named-margin-bottom; } -tei-person > tei-persName { +tei-person > tei-persname { display: block; font-size: $tei-named-name-font-size; } -tei-place > tei-placeName { +tei-place > tei-placename { display: block; font-size: $tei-named-name-font-size; } -tei-org > tei-orgName { +tei-org > tei-orgname { display: block; font-size: $tei-named-name-font-size; } @@ -136,29 +136,37 @@ tei-l { /* Tables. */ tei-table { - table { - width: auto; - } + margin-bottom: $spacing-unit; + width: auto; + text-align: $table-text-align; + color: lighten($text-color, 18%); + border-collapse: collapse; + border: 1px solid $grey-color-light; + tei-row { + &:nth-child(even) { + background-color: lighten($grey-color-light, 6%); + } - td { - vertical-align: text-top; + tei-cell { + vertical-align: text-top; + padding: ($spacing-unit / 3) ($spacing-unit / 2); + border: 1px solid $grey-color-light; + } } } - /* Collection index. */ -tei-table.collection-index > table { +tei-table.collection-index { // TEI/CETEIcean do not handle table header, so the first row is it: - tr:first-child { - td { + tei-row:first-child { + tei-cell { // Replicate Chrome's and minima's styling of the th // on the td elements of the first row (thead/tr analogue): font-weight: bold; - background-color: #f0f0f0; - border: 1px solid #dedede; - border-bottom-color: #c9c9c9; - padding: 10px 15px; + background-color: lighten($grey-color-light, 3%); + border: 1px solid darken($grey-color-light, 4%); + border-bottom-color: darken($grey-color-light, 12%); // Keep header visible position: -webkit-sticky; @@ -168,14 +176,14 @@ tei-table.collection-index > table { } // Size the columns - td.description { width: 44%; } - td.date { width: 8%; } - td.author { width: 10%; } - td.addressee { width: 10%; } - td.language { width: 4%; } - td.document { width: 5%; } - td.pages { width: 8%; } - td.transcriber { } + tei-cell.description { width: 44%; } + tei-cell.date { width: 8%; } + tei-cell.author { width: 10%; } + tei-cell.addressee { width: 10%; } + tei-cell.language { width: 4%; } + tei-cell.document { width: 5%; } + tei-cell.pages { width: 8%; } + tei-cell.transcriber { } // Part title @@ -206,24 +214,22 @@ tei-pb.missing-page a { /* Document-specific. */ tei-table.rgada-026-table { - table { - border: none; - } + border: none; - tr { + tei-row { background-color: $background-color; - td { border: none; } - td:nth-child(1) { width: 300px; } - td:nth-child(2) { width: 400px; } + tei-cell { border: none; } + tei-cell:nth-child(1) { width: 300px; } + tei-cell:nth-child(2) { width: 400px; } } } tei-table.rgada-233-table { - tr { - td:nth-child(1) { width: 30px; } - td:nth-child(2) { width: 200px; } - td:nth-child(3) { width: 55px; } - td:nth-child(4) { width: 35px; } + tei-row { + tei-cell:nth-child(1) { width: 30px; } + tei-cell:nth-child(2) { width: 200px; } + tei-cell:nth-child(3) { width: 55px; } + tei-cell:nth-child(4) { width: 35px; } } } diff --git a/docs/js/cetei.js b/docs/js/CETEI.js similarity index 100% rename from docs/js/cetei.js rename to docs/js/CETEI.js diff --git a/docs/js/CETEI/CETEI.js b/docs/js/CETEI/CETEI.js index d4e5f550b2..fa83358d56 100644 --- a/docs/js/CETEI/CETEI.js +++ b/docs/js/CETEI/CETEI.js @@ -1,22 +1,22 @@ -// LMD added '.js' in all the includes. -import * as utilities from './utilities.js'; import defaultBehaviors from './defaultBehaviors.js'; -import {addBehaviors, addBehavior, applyBehaviors} from './behaviors.js'; +import * as utilities from './utilities.js'; +import {addBehaviors, addBehavior, applyBehaviors, removeBehavior} from './behaviors.js'; import {learnElementNames} from './dom.js'; class CETEI { constructor(options){ - this.options = options ? options : {} + this.options = options ? options : {}; // Bind methods this.addBehaviors = addBehaviors.bind(this); this.addBehavior = addBehavior.bind(this); this.applyBehaviors = applyBehaviors.bind(this); + this.removeBehavior = removeBehavior.bind(this); // Bind selected utilities - this.utilities = {} + this.utilities = {}; for (const u of Object.keys(utilities)) { - if (u == "rw") { + if (["getPrefixDef", "rw", "resolveURI"].includes(u)) { this.utilities[u] = utilities[u].bind(this); } else { this.utilities[u] = utilities[u]; @@ -30,6 +30,7 @@ class CETEI { this.hasStyle = false; this.prefixDefs = []; this.debug = this.options.debug === true ? true : false; + if (this.options.base) { this.base = this.options.base; } else { @@ -44,6 +45,11 @@ class CETEI { if (!this.options.omitDefaultBehaviors) { this.addBehaviors(defaultBehaviors); } + if (this.options.ignoreFragmentId) { + if (window) { + window.removeEventListener("ceteiceanload", CETEI.restorePosition); + } + } } /* @@ -182,7 +188,7 @@ class CETEI { perElementFn(newElement, el); } return newElement; - } + }; this.dom = convertEl(XML_dom.documentElement); @@ -201,16 +207,6 @@ class CETEI { } } - /* - If the TEI document defines CSS styles in its tagsDecl, this method - copies them into the wrapper HTML document's head. - */ - addStyle(doc, data) { - if (this.hasStyle) { - doc.getElementsByTagName("head").item(0).appendChild(data.getElementsByTagName("style").item(0).cloneNode(true)); - } - } - /* To change a namespace -> prefix mapping, the namespace must first be unset. Takes a namespace URI. In order to process a TEI P4 document, e.g., @@ -229,10 +225,264 @@ class CETEI { this.base = base; } + /* + Appends any element returned by the function passed in the first + parameter to the element in the second parameter. If the function + returns nothing, this is a no-op aside from any side effects caused + by the provided function. + + Called by getHandler() and fallback() +*/ +append(fn, elt) { + let self = this; + if (elt) { + let content = fn.call(self.utilities, elt); + if (content && !self.childExists(elt.firstElementChild, content.nodeName)) { + self.appendBasic(elt, content); + } + } else { + return function() { + if (!this.hasAttribute("data-processed")) { + let content = fn.call(self.utilities, this); + if (content && !self.childExists(this.firstElementChild, content.nodeName)) { + self.appendBasic(this, content); + } + } + } + } +} + +appendBasic(elt, content) { + utilities.hideContent(elt); + elt.appendChild(content); +} + +// Given an element, return its qualified name as defined in a behaviors object +bName(e) { + return e.tagName.substring(0,e.tagName.indexOf("-")).toLowerCase() + ":" + e.getAttribute("data-origname"); +} + +/* + Private method called by append(). Takes a child element and a name, and recurses through the + child's siblings until an element with that name is found, returning true if it is and false if not. +*/ +childExists(elt, name) { + if (elt && elt.nodeName == name) { + return true; + } else { + return elt && elt.nextElementSibling && this.childExists(elt.nextElementSibling, name); + } +} + +/* + Takes a template in the form of either an array of 1 or 2 + strings or an object with CSS selector keys and either functions + or arrays as described above. Returns a closure around a function + that can be called in the element constructor or applied to an + individual element. + + Called by the getHandler() and getFallback() methods +*/ +decorator(template) { + if (Array.isArray(template) && !Array.isArray(template[0])) { + return this.applyDecorator(template) + } + let self = this; + return function(elt) { + for (let rule of template) { + if (elt.matches(rule[0]) || rule[0] === "_") { + if (Array.isArray(rule[1])) { + return self.decorator(rule[1]).call(this, elt); + } else { + return rule[1].call(this, elt); + } + } + } + } +} + +applyDecorator(strings) { + let self = this; + return function (elt) { + let copy = []; + for (let i = 0; i < strings.length; i++) { + copy.push(self.template(strings[i], elt)); + } + return self.insert(elt, copy); + } +} + +/* + Returns the fallback function for the given element name. + Called by fallback(). +*/ +getFallback(behaviors, fn) { + if (behaviors[fn]) { + if (behaviors[fn] instanceof Function) { + return behaviors[fn]; + } else { + return decorator(behaviors[fn]); + } + } +} + +/* + Returns the handler function for the given element name + Called by define(). +*/ +getHandler(behaviors, fn) { + if (behaviors[fn]) { + if (behaviors[fn] instanceof Function) { + return this.append(behaviors[fn]); + } else { + return this.append(this.decorator(behaviors[fn])); + } + } +} + +insert(elt, strings) { + let span = document.createElement("span"); + for (let node of Array.from(elt.childNodes)) { + if (node.nodeType === Node.ELEMENT_NODE && !node.hasAttribute("data-processed")) { + this.processElement(node); + } + } + // If we have before and after tags have them parsed by + // .innerHTML and then add the content to the resulting child + if (strings[0].match("<[^>]+>") && strings[1] && strings[1].match("<[^>]+>")) { + span.innerHTML = strings[0] + (strings[1]?strings[1]:""); + for (let node of Array.from(elt.childNodes)) { + span.firstElementChild.appendChild(node.cloneNode(true)); + } + } else { + span.innerHTML = strings[0]; + span.setAttribute("data-before", strings[0].replace(/<[^>]+>/g,"").length); + for (let node of Array.from(elt.childNodes)) { + span.appendChild(node.cloneNode(true)); + } + if (strings.length > 1) { + span.innerHTML += strings[1]; + span.setAttribute("data-after", strings[1].replace(/<[^>]+>/g,"").length); + } + } + return span; +} + +// Runs behaviors recursively on the supplied element and children +processElement(elt) { + if (elt.hasAttribute("data-origname") && ! elt.hasAttribute("data-processed")) { + let fn = this.getFallback(this.bName(elt)); + if (fn) { + this.append(fn,elt); + elt.setAttribute("data-processed", ""); + } + } + for (let node of Array.from(elt.childNodes)) { + if (node.nodeType === Node.ELEMENT_NODE) { + this.processElement(node); + } + } +} + +// Given a qualified name (e.g. tei:text), return the element name +tagName(name) { + if (name.includes(":"), 1) { + return name.replace(/:/,"-").toLowerCase(); + } else { + return "ceteicean-" + name.toLowerCase(); + } +} + +template(str, elt) { + let result = str; + if (str.search(/\$(\w*)(@([a-zA-Z:]+))/ )) { + let re = /\$(\w*)@([a-zA-Z:]+)/g; + let replacements; + while (replacements = re.exec(str)) { + if (elt.hasAttribute(replacements[2])) { + if (replacements[1] && utilities[replacements[1]]) { + result = result.replace(replacements[0], utilities[replacements[1]](elt.getAttribute(replacements[2]))); + } else { + result = result.replace(replacements[0], elt.getAttribute(replacements[2])); + } + } else { + result = result.replace(replacements[0], ""); + } + } + } + return result; +} + +/* + Registers the list of elements provided with the browser. + Called by makeHTML5(), but can be called independently if, for example, + you've created Custom Elements via an XSLT transformation instead. +*/ +define(names) { + for (let name of names) { + try { + let fn = this.getHandler(this.behaviors, name); + window.customElements.define(this.tagName(name), class extends HTMLElement { + constructor() { + super(); + if (!this.matches(":defined")) { // "Upgraded" undefined elements can have attributes & children; new elements can't + if (fn) { + fn.call(this); + } + // We don't want to double-process elements, so add a flag + this.setAttribute("data-processed", ""); + } + } + // Process new elements when they are connected to the browser DOM + connectedCallback() { + if (!this.hasAttribute("data-processed")) { + if (fn) { + fn.call(this); + } + this.setAttribute("data-processed", ""); + } + }; + }); + } catch (error) { + // When using the same CETEIcean instance for multiple TEI files, this error becomes very common. + // It's muted by default unless the debug option is set. + if (this.debug) { + console.log(tagName(name) + " couldn't be registered or is already registered."); + console.log(error); + } + } + } +} + +/* + Provides fallback functionality for browsers where Custom Elements + are not supported. + + Like define(), this is called by makeHTML5(), but can be called + independently. +*/ +fallback(names) { + for (let name of names) { + let fn = getFallback(this.behaviors, name); + if (fn) { + for (let elt of Array.from(( + this.dom && !this.done + ? this.dom + : document + ).getElementsByTagName(tagName(name)))) { + if (!elt.hasAttribute("data-processed")) { + append(fn, elt); + } + } + } + } +} + /********************** * Utility functions * **********************/ + static savePosition() { window.sessionStorage.setItem(window.location + "-scroll", window.scrollY); } @@ -247,7 +497,6 @@ class CETEI { } } else { setTimeout(function() { - // LMD added decodeURI() to handle Unicode ids: let h = document.querySelector(window.decodeURI(window.location.hash)); if (h) { h.scrollIntoView(); @@ -268,5 +517,5 @@ try { } catch (e) { console.log(e); } -// Make main class available to pre-ES6 browser environments -export default CETEI; + +export default CETEI diff --git a/docs/js/CETEI/behaviors.js b/docs/js/CETEI/behaviors.js index 03a6b38328..8c70c2b7c7 100644 --- a/docs/js/CETEI/behaviors.js +++ b/docs/js/CETEI/behaviors.js @@ -1,4 +1,3 @@ -import {define, fallback} from './customElements.js'; /* Add a user-defined set of behaviors to CETEIcean's processing @@ -49,11 +48,30 @@ export function addBehavior(ns, element, b) { this.behaviors[`${p}:${element}`] = b; } +/* + Removes a previously-defined or default behavior. Takes a namespace prefix or namespace definition + and the element name. +*/ +export function removeBehavior(ns, element) { + let p; + if (ns === Object(ns)) { + for (let prefix of Object.keys(ns)) { + if (!this.namespaces.has(ns[prefix])) { + this.namespaces.set(ns[prefix], prefix); + p = prefix; + } + } + } else { + p = ns; + } + delete this.behaviors[`${p}:${element}`]; +} + // Define or apply behaviors for the document export function applyBehaviors() { if (window.customElements) { - define.call(this, this.els); + this.define.call(this, this.els); } else { - fallback.call(this, this.els); + this.fallback.call(this, this.els); } } diff --git a/docs/js/CETEI/customElements.js b/docs/js/CETEI/customElements.js deleted file mode 100644 index 32a6443184..0000000000 --- a/docs/js/CETEI/customElements.js +++ /dev/null @@ -1,250 +0,0 @@ -import * as utilities from './utilities.js' - -/* - Appends any element returned by the function passed in the first - parameter to the element in the second parameter. If the function - returns nothing, this is a no-op aside from any side effects caused - by the provided function. - - Called by getHandler() and fallback() -*/ -function append(fn, elt) { - if (elt) { - let content = fn.call(utilities, elt); - if (content && !childExists(elt.firstElementChild, content.nodeName)) { - appendBasic(elt, content); - } - } else { - return function() { - if (!this.hasAttribute("data-processed")) { - let content = fn.call(utilities, this); - if (content && !childExists(this.firstElementChild, content.nodeName)) { - appendBasic(this, content); - } - } - } - } -} - -function appendBasic(elt, content) { - utilities.hideContent(elt); - elt.appendChild(content); -} - -// Given an element, return its qualified name as defined in a behaviors object -function bName(e) { - return e.tagName.substring(0,e.tagName.indexOf("-")).toLowerCase() + ":" + e.getAttribute("data-origname"); -} - -/* - Private method called by append(). Takes a child element and a name, and recurses through the - child's siblings until an element with that name is found, returning true if it is and false if not. -*/ -function childExists(elt, name) { - if (elt && elt.nodeName == name) { - return true; - } else { - return elt && elt.nextElementSibling && childExists(elt.nextElementSibling, name); - } -} - -/* - Takes a template in the form of either an array of 1 or 2 - strings or an object with CSS selector keys and either functions - or arrays as described above. Returns a closure around a function - that can be called in the element constructor or applied to an - individual element. - - Called by the getHandler() and getFallback() methods -*/ -function decorator(template) { - if (Array.isArray(template) && !Array.isArray(template[0])) { - return applyDecorator(template) - } - return function(elt) { - for (let rule of template) { - if (elt.matches(rule[0]) || rule[0] === "_") { - if (Array.isArray(rule[1])) { - return decorator(rule[1]).call(this, elt); - } else { - return rule[1].call(this, elt); - } - } - } - } -} - -function applyDecorator(strings) { - return function (elt) { - let copy = []; - for (let i = 0; i < strings.length; i++) { - copy.push(template(strings[i], elt)); - } - return insert(elt, copy); - } -} - -/* - Returns the fallback function for the given element name. - Called by fallback(). -*/ -function getFallback(behaviors, fn) { - if (behaviors[fn]) { - if (behaviors[fn] instanceof Function) { - return behaviors[fn]; - } else { - return decorator(behaviors[fn]); - } - } -} - -/* - Returns the handler function for the given element name - Called by define(). -*/ -function getHandler(behaviors, fn) { - if (behaviors[fn]) { - if (behaviors[fn] instanceof Function) { - return append(behaviors[fn]); - } else { - return append(decorator(behaviors[fn])); - } - } -} - -function insert(elt, strings) { - let span = document.createElement("span"); - for (let node of Array.from(elt.childNodes)) { - if (node.nodeType === Node.ELEMENT_NODE && !node.hasAttribute("data-processed")) { - processElement(node); - } - } - // If we have before and after tags have them parsed by - // .innerHTML and then add the content to the resulting child - if (strings[0].match("<[^>]+>") && strings[1] && strings[1].match("<[^>]+>")) { - span.innerHTML = strings[0] + (strings[1]?strings[1]:""); - for (let node of Array.from(elt.childNodes)) { - span.firstElementChild.appendChild(node.cloneNode(true)); - } - } else { - span.innerHTML = strings[0]; - span.setAttribute("data-before", strings[0].replace(/<[^>]+>/g,"").length); - for (let node of Array.from(elt.childNodes)) { - span.appendChild(node.cloneNode(true)); - } - if (strings.length > 1) { - span.innerHTML += strings[1]; - span.setAttribute("data-after", strings[1].replace(/<[^>]+>/g,"").length); - } - } - return span; -} - -// Runs behaviors recursively on the supplied element and children -function processElement(elt) { - if (elt.hasAttribute("data-origname") && ! elt.hasAttribute("data-processed")) { - let fn = getFallback(bName(elt)); - if (fn) { - append(fn,elt); - elt.setAttribute("data-processed", ""); - } - } - for (let node of Array.from(elt.childNodes)) { - if (node.nodeType === Node.ELEMENT_NODE) { - processElement(node); - } - } -} - -// Given a qualified name (e.g. tei:text), return the element name -function tagName(name) { - if (name.includes(":"), 1) { - return name.replace(/:/,"-").toLowerCase();; - } else { - return "ceteicean-" + name.toLowerCase(); - } -} - -function template(str, elt) { - let result = str; - if (str.search(/\$(\w*)(@([a-zA-Z:]+))/ )) { - let re = /\$(\w*)@([a-zA-Z:]+)/g; - let replacements; - while (replacements = re.exec(str)) { - if (elt.hasAttribute(replacements[2])) { - if (replacements[1] && utilities[replacements[1]]) { - result = result.replace(replacements[0], utilities[replacements[1]](elt.getAttribute(replacements[2]))); - } else { - result = result.replace(replacements[0], elt.getAttribute(replacements[2])); - } - } - } - } - return result; -} - -/* - Registers the list of elements provided with the browser. - Called by makeHTML5(), but can be called independently if, for example, - you've created Custom Elements via an XSLT transformation instead. -*/ -export function define(names) { - for (let name of names) { - try { - let fn = getHandler(this.behaviors, name); - window.customElements.define(tagName(name), class extends HTMLElement { - constructor() { - super(); - if (!this.matches(":defined")) { // "Upgraded" undefined elements can have attributes & children; new elements can't - if (fn) { - fn.call(this); - } - // We don't want to double-process elements, so add a flag - this.setAttribute("data-processed", ""); - } - } - // Process new elements when they are connected to the browser DOM - connectedCallback() { - if (!this.hasAttribute("data-processed")) { - if (fn) { - fn.call(this); - } - this.setAttribute("data-processed", ""); - } - }; - }); - } catch (error) { - // When using the same CETEIcean instance for multiple TEI files, this error becomes very common. - // It's muted by default unless the debug option is set. - if (this.debug) { - console.log(tagName(name) + " couldn't be registered or is already registered."); - console.log(error); - } - } - - } -} - -/* - Provides fallback functionality for browsers where Custom Elements - are not supported. - - Like define(), this is called by makeHTML5(), but can be called - independently. -*/ -export function fallback(names) { - for (let name of names) { - let fn = getFallback(this.behaviors, name); - if (fn) { - for (let elt of Array.from(( - this.dom && !this.done - ? this.dom - : document - ).getElementsByTagName(tagName(name)))) { - if (!elt.hasAttribute("data-processed")) { - append(fn, elt); - } - } - } - } -} \ No newline at end of file diff --git a/docs/js/CETEI/defaultBehaviors.js b/docs/js/CETEI/defaultBehaviors.js index c7bc439d8c..e4deefcf26 100644 --- a/docs/js/CETEI/defaultBehaviors.js +++ b/docs/js/CETEI/defaultBehaviors.js @@ -8,11 +8,11 @@ export default { "eg": ["
","
"], // inserts a link inside using the @target; the link in the // @href is piped through the rw (rewrite) function before insertion - "ptr": ["
$@target"], + "ptr": ["$@target"], // wraps the content of the in an HTML link // LMD ref with 'role' - which becomes 'target' on the 'a' "ref": [ - // LMD: in the original: ["[target]", ["",""]] + // LMD: in the original: ["[target]", ["",""]] ["[role]", ["",""]], ["_" , ["" ,""]] ], @@ -79,37 +79,6 @@ export default { // , // ["_", ["(",")"]] ], - "table": function(elt) { - let table = document.createElement("table"); - table.innerHTML = elt.innerHTML; - if (table.firstElementChild.localName == "tei-head") { - let head = table.firstElementChild; - head.remove(); - let caption = document.createElement("caption"); - caption.innerHTML = head.innerHTML; - table.appendChild(caption); - } - for (let row of Array.from(table.querySelectorAll("tei-row"))) { - let tr = document.createElement("tr"); - tr.innerHTML = row.innerHTML; - for (let attr of Array.from(row.attributes)) { - tr.setAttribute(attr.name, attr.value); - } - row.parentElement.replaceChild(tr, row); - } - for (let cell of Array.from(table.querySelectorAll("tei-cell"))) { - let td = document.createElement("td"); - if (cell.hasAttribute("cols")) { - td.setAttribute("colspan", cell.getAttribute("cols")); - } - td.innerHTML = cell.innerHTML; - for (let attr of Array.from(cell.attributes)) { - td.setAttribute(attr.name, attr.value); - } - cell.parentElement.replaceChild(td, cell); - } - return table; - }, "teiHeader": function(e) { this.hideContent(e, false); }, diff --git a/docs/js/CETEI/dom.js b/docs/js/CETEI/dom.js index 3bd2aaf003..ccabc1862e 100644 --- a/docs/js/CETEI/dom.js +++ b/docs/js/CETEI/dom.js @@ -1,18 +1,16 @@ export function learnElementNames(XML_dom, namespaces) { const root = XML_dom.documentElement; + let i = 1; + let qname = function(e) { + if (!namespaces.has(e.namespaceURI ? e.namespaceURI : "")) { + namespaces.set(e.namespaceURI, "ns" + i++); + } + return namespaces.get(e.namespaceURI ? e.namespaceURI : "") + ":" + e.localName; + }; const els = new Set( - Array.from(root.querySelectorAll("*"), - e => ( - namespaces.has(e.namespaceURI ? e.namespaceURI : "") - ? namespaces.get(e.namespaceURI ? e.namespaceURI : "") + ":" - : "" - ) + e.localName) ); + Array.from(root.querySelectorAll("*"), qname)); + // Add the root element to the array - els.add( - ( - namespaces.has(root.namespaceURI ? root.namespaceURI : "") - ? namespaces.get(root.namespaceURI ? root.namespaceURI : "") + ":" - : "" - ) + root.localName); + els.add(qname(root)); return els } \ No newline at end of file diff --git a/docs/js/CETEI/utilities.js b/docs/js/CETEI/utilities.js index 643a5e9f12..f14dcf9ee2 100644 --- a/docs/js/CETEI/utilities.js +++ b/docs/js/CETEI/utilities.js @@ -34,7 +34,7 @@ export function copyAndReset(node) { } } return result; - } + }; return clone(node); } @@ -88,7 +88,25 @@ export function repeat(str, times) { return result; } -/* +/* + Resolves URIs that use TEI prefixDefs into full URIs. + See https://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-prefixDef.html +*/ +export function resolveURI(uri) { + let prefixdef = this.prefixDefs[uri.substring(0,uri.indexOf(":"))]; + return uri.replace(new RegExp(prefixdef["matchPattern"]), prefixdef["replacementPattern"]); +} + +/* + Convenience function for getting prefix definitions, Takes a prefix + and returns an object with "matchPattern" and "replacementPattern" + keys. +*/ +export function getPrefixDef(prefix) { + return this.prefixDefs[prefix]; +} + +/* Takes a relative URL and rewrites it based on the base URL of the HTML document */ @@ -110,7 +128,7 @@ export function serialize(el, stripElt, ws) { let str = ""; let ignorable = (txt) => { return !(/[^\t\n\r ]/.test(txt)); - } + }; if (!stripElt && el.nodeType == Node.ELEMENT_NODE) { if ((typeof ws === "string") && ws !== "") { str += "\n" + ws + "<"; diff --git a/docs/js/tei.js b/docs/js/tei.js index 2bee714559..86d4931df7 100644 --- a/docs/js/tei.js +++ b/docs/js/tei.js @@ -1,4 +1,5 @@ -import CETEI from './cetei.js' +//import CETEI from './CETEI/CETEI.js' +import CETEI from './CETEI.js' export default function loadTei(tei) { let wrapper = document @@ -25,6 +26,5 @@ export default function loadTei(tei) { CETEIcean.getHTML5(tei, function (data) { teiDiv.innerHTML = ""; teiDiv.appendChild(data); - CETEIcean.addStyle(document, data); }); }