From 03a98e2f9333afd0b45d28d9253623ba9f9dfed4 Mon Sep 17 00:00:00 2001 From: Martin Rocek Date: Sun, 28 Jan 2024 16:24:46 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Initial=20commmit,=20yay!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.md | 21 +++ README.md | 37 +++++ assets/CETEI.js | 1 + assets/styles.css | 241 ++++++++++++++++++++++++++++++ config.css | 52 +++++++ index.html | 20 +++ xml/example.xml | 362 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 734 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 assets/CETEI.js create mode 100644 assets/styles.css create mode 100644 config.css create mode 100644 index.html create mode 100644 xml/example.xml diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..83ae034 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Martin Roček + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..6268435 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Tiny template for TEI editions + +Have you ever run a workshop on TEI and then struggled with where or how to publish the students' work? This template was created for that very reason. It has been designed to be as simple as possible, while still allowing students to make at least some adjustments so that they feel a sense of ownership over their work. + +## Limitations +- It does not work with images +- It does not work with multiple files +- It does not work very well with different readings + +However in future versions I hope to address these issues and extend the functionality of the template. If you have any suggestions, please let me know. + +## How to use this template +1. You can either fork this repository or download it as a zip file in the release section. +2. Copy your XML edition to the `xml` folder. +3. Edit the `index.html` file to include the correct path to your XML file. Look for following line + ```html + + ``` +4. You can tweak colour, text-size etc. in the `config.css` file at the root of the repository. +5. Publish it on GitHub pages or any other web-server. + +## Publishing on GitHub pages +1. Create a new repository on GitHub. +2. Upload the files from the template to the repository. +3. Go to the settings of the repository and scroll down to the GitHub pages section. +4. Select the `master` branch as the source and click save. +5. Wait a few minutes and then click on the link provided in the GitHub pages section. + +## Copyright and licence +This template is released under the [MIT licence](LICENSE.md) and is free to use, modify and redistribute. The example XML file should be considered as a demonstration of the template and is not covered by the licence. + +This template uses the [CETEIcean](https://github.com/TEIC/CETEIcean) library, which is released under the [BSD 2-Clause "Simplified" License](https://github.com/TEIC/CETEIcean/blob/master/LICENSE.md). diff --git a/assets/CETEI.js b/assets/CETEI.js new file mode 100644 index 0000000..d8ba4c2 --- /dev/null +++ b/assets/CETEI.js @@ -0,0 +1 @@ +var CETEI=function(){"use strict";var e={namespaces:{tei:"http://www.tei-c.org/ns/1.0",teieg:"http://www.tei-c.org/ns/Examples",rng:"http://relaxng.org/ns/structure/1.0"},tei:{eg:["
","
"],ptr:['$@target'],ref:[["[target]",['',""]]],graphic:function(e){let t=new Image;return t.src=this.rw(e.getAttribute("url")),e.hasAttribute("width")&&t.setAttribute("width",e.getAttribute("width")),e.hasAttribute("height")&&t.setAttribute("height",e.getAttribute("height")),t},list:[["[type=gloss]",function(e){const t=e.ownerDocument;let i=t.createElement("dl");for(let n of Array.from(e.children))if(1==n.nodeType){if("tei-label"==n.localName){let e=t.createElement("dt");e.innerHTML=n.innerHTML,i.appendChild(e)}if("tei-item"==n.localName){let e=t.createElement("dd");e.innerHTML=n.innerHTML,i.appendChild(e)}}return i}]],note:[["[place=end]",function(e){const t=e.ownerDocument;this.noteIndex?this.noteIndex++:this.noteIndex=1;let i="_note_"+this.noteIndex,n=t.createElement("a");n.setAttribute("id","src"+i),n.setAttribute("href","#"+i),n.innerHTML=this.noteIndex;let s=t.createElement("sup");s.appendChild(n);let r=t.querySelector("ol.notes");r||(r=t.createElement("ol"),r.setAttribute("class","notes"),this.dom.appendChild(r));let o=t.createElement("li");return o.id=i,o.innerHTML=e.innerHTML,r.appendChild(o),s}],["_",["(",")"]]],teiHeader:function(e){this.hideContent(e,!1)},title:[["tei-titlestmt>tei-title",function(e){const t=e.ownerDocument;let i=t.createElement("title");i.innerHTML=e.innerText,t.querySelector("head").appendChild(i)}]]},teieg:{egXML:function(e){let t=e.ownerDocument.createElement("pre"),i=this.serialize(e,!0).replace(/{let n;switch(e.nodeType){case 1:n=t.createElement(e.nodeName);break;case 9:n=t.implementation.createDocument();break;case 11:n=t.createDocumentFragment();break;default:n=e.cloneNode(!0)}if(e.attributes)for(let t of Array.from(e.attributes))"data-processed"!==t.name&&n.setAttribute(t.name,t.value);for(let t of Array.from(e.childNodes))if(1==t.nodeType){if(t.hasAttribute("data-original")){for(let e of Array.from(t.childNodes)){let t=n.appendChild(i(e));1===t.nodeType&&t.hasAttribute("data-origid")&&(t.setAttribute("id",t.getAttribute("data-origid")),t.removeAttribute("data-origid"))}return n}t.hasAttribute("data-origname")&&n.appendChild(i(t))}else n.appendChild(t.cloneNode());return n};return i(e)}function i(e){return e.replace(/ .*$/,"")}function n(e,t=!0){const i=e.ownerDocument;if(e.childNodes.length>0){let n=i.createElement("cetei-original");e.appendChild(n),n.setAttribute("hidden",""),n.setAttribute("data-original","");for(let t of Array.from(e.childNodes))if(t!==n){if(1===t.nodeType){t.setAttribute("data-processed","");for(let e of t.querySelectorAll("*"))e.setAttribute("data-processed","")}n.appendChild(e.removeChild(t))}if(t)for(let e of Array.from(n.querySelectorAll("*")))e.hasAttribute("id")&&(e.setAttribute("data-origid",e.getAttribute("id")),e.removeAttribute("id"))}}function s(e,t,i){let n="";const r=e=>!/[^\t\n\r ]/.test(e);if(9!==e.nodeType&&11!==e.nodeType||(n+='\n'),!t&&1==e.nodeType){n+="string"==typeof i&&""!==i?"\n"+i+"<":"<",n+=e.getAttribute("data-origname");let t=e.hasAttribute("data-origatts")?e.getAttribute("data-origatts").split(" "):[];for(let i of Array.from(e.attributes))i.name.startsWith("data-")||["id","lang","class"].includes(i.name)||(n+=" "+t.find((function(e){return e.toLowerCase()==i.name}))+'="'+i.value+'"'),"data-xmlns"==i.name&&(n+=' xmlns="'+i.value+'"');e.childNodes.length>0?n+=">":n+="/>"}for(let o of Array.from(e.childNodes))switch(o.nodeType){case 1:n+=s(o,!1,"string"==typeof i?i+" ":i);break;case 7:n+=``,9!==e.nodeType&&11!==e.nodeType||(n+="\n");break;case 8:n+=`\x3c!--${o.nodeValue}--\x3e`,9!==e.nodeType&&11!==e.nodeType||(n+="\n");break;default:if(t&&r(o.nodeValue)&&(n+=o.nodeValue.replace(/^\s*\n/,"")),"string"==typeof i&&r(o.nodeValue))break;n+=o.nodeValue}return!t&&1==e.nodeType&&e.childNodes.length>0&&(n+="string"==typeof i?"\n"+i+""),9!==e.nodeType&&11!==e.nodeType||(n+="\n"),n}function r(e){return e.includes(":"),e.replace(/:/,"-").toLowerCase()}function o(e,t=null,i=!1){try{window.customElements.define(r(e),class extends HTMLElement{constructor(){super(),this.matches(":defined")||t&&(t.call(this),this.setAttribute("data-processed",""))}connectedCallback(){this.hasAttribute("data-processed")||t&&(t.call(this),this.setAttribute("data-processed",""))}})}catch(t){i&&(console.log(r(e)+" couldn't be registered or is already registered."),console.log(t))}}var a=Object.freeze({__proto__:null,getOrdinality:function(e,t){let i=1,n=e;for(;n&&null!==n.previousElementSibling&&(!t||n.previousElementSibling.localName==t)&&(i++,n=n.previousElementSibling,n.previousElementSibling););return i},copyAndReset:t,first:i,hideContent:n,normalizeURI:function(e){return this.rw(this.first(e))},repeat:function(e,t){let i="";for(let n=0;n").replace(/"/,'"').replace(/'/,"'").replace(/&/,"&")},tagName:r,defineCustomElement:o});function l(e){if(e.namespaces)for(let t of Object.keys(e.namespaces))this.namespaces.has(e.namespaces[t])||Array.from(this.namespaces.values()).includes(t)||this.namespaces.set(e.namespaces[t],t);for(let t of this.namespaces.values())if(e[t])for(let i of Object.keys(e[t]))this.behaviors[`${t}:${i}`]=e[t][i];if(e.functions)for(let t of Object.keys(e.functions))this.utilities[t]=e.functions[t].bind(this.utilities);e.handlers&&console.log("Behavior handlers are no longer used."),e.fallbacks&&console.log("Fallback behaviors are no longer used.")}function d(e,t,i){let n;if(e===Object(e))for(let t of Object.keys(e))this.namespaces.has(e[t])||(this.namespaces.set(e[t],t),n=t);else n=e;this.behaviors[`${n}:${t}`]=i}function c(e,t){let i;if(e===Object(e))for(let t of Object.keys(e))this.namespaces.has(e[t])||(this.namespaces.set(e[t],t),i=t);else i=e;delete this.behaviors[`${i}:${t}`]}class h{constructor(t){this.options=t||{},this.document=this.options.documentObject?this.options.documentObject:void 0,void 0===this.document&&("undefined"!=typeof window&&window.document?this.document=window.document:"undefined"!=typeof global&&global.document&&(this.document=global.document)),this.addBehaviors=l.bind(this),this.addBehavior=d.bind(this),this.removeBehavior=c.bind(this),this.utilities={};for(const e of Object.keys(a))["getPrefixDef","rw","resolveURI"].includes(e)?this.utilities[e]=a[e].bind(this):this.utilities[e]=a[e];if(this.els=[],this.namespaces=new Map,this.behaviors={},this.hasStyle=!1,this.prefixDefs=[],this.debug=!0===this.options.debug,this.discardContent=!0===this.options.discardContent,this.options.base)this.base=this.options.base;else try{window&&(this.base=window.location.href.replace(/\/[^\/]*$/,"/"))}catch(e){this.base=""}this.options.omitDefaultBehaviors||this.addBehaviors(e),this.options.ignoreFragmentId&&window&&window.removeEventListener("ceteiceanload",h.restorePosition)}async getHTML5(e,t,i){window&&window.location.href.startsWith(this.base)&&e.indexOf("/")>=0&&(this.base=e.replace(/\/[^\/]*$/,"/"));try{const n=await fetch(e);if(n.ok){const e=await n.text();return this.makeHTML5(e,t,i)}console.log(`Could not get XML file ${e}.\nServer returned ${n.status}: ${n.statusText}`)}catch(e){console.log(e)}}makeHTML5(e,t,i){return this.XML_dom=(new DOMParser).parseFromString(e,"text/xml"),this.domToHTML5(this.XML_dom,t,i)}preprocess(e,t,i){this.els=function(e,t){const i=e.documentElement;let n=1,s=function(e){return t.has(e.namespaceURI?e.namespaceURI:"")||t.set(e.namespaceURI,"ns"+n++),t.get(e.namespaceURI?e.namespaceURI:"")+":"+e.localName};const r=new Set(Array.from(i.querySelectorAll("*"),s));return r.add(s(i)),r}(e,this.namespaces);let n=t=>{let s;if(this.namespaces.has(t.namespaceURI?t.namespaceURI:"")){let e=this.namespaces.get(t.namespaceURI?t.namespaceURI:"");s=this.document.createElement(`${e}-${t.localName.toLowerCase()}`)}else s=this.document.importNode(t,!1);for(let e of Array.from(t.attributes))"xmlns"==e.name?s.setAttribute("data-xmlns",e.value):s.setAttribute(e.name,e.value),"xml:id"==e.name&&s.setAttribute("id",e.value),"xml:lang"==e.name&&s.setAttribute("lang",e.value),"rendition"==e.name&&s.setAttribute("class",e.value.replace(/#/g,""));if(s.setAttribute("data-origname",t.localName),t.hasAttributes()&&s.setAttribute("data-origatts",t.getAttributeNames().join(" ")),0==t.childNodes.length&&s.setAttribute("data-empty",""),"head"==t.localName){let i=e.evaluate("count(ancestor::*[tei:head])",t,(function(e){if("tei"==e)return"http://www.tei-c.org/ns/1.0"}),1,null);s.setAttribute("data-level",i.numberValue)}if("tagsDecl"==t.localName){let e=this.document.createElement("style");for(let i of Array.from(t.childNodes))if(1==i.nodeType&&"rendition"==i.localName&&"css"==i.getAttribute("scheme")){let t="";i.hasAttribute("selector")?(t+=i.getAttribute("selector").replace(/([^#, >]+\w*)/g,"tei-$1").replace(/#tei-/g,"#")+"{\n",t+=i.textContent):(t+="."+i.getAttribute("xml:id")+"{\n",t+=i.textContent),t+="\n}\n",e.appendChild(this.document.createTextNode(t))}e.childNodes.length>0&&(s.appendChild(e),this.hasStyle=!0)}"prefixDef"==t.localName&&(this.prefixDefs.push(t.getAttribute("ident")),this.prefixDefs[t.getAttribute("ident")]={matchPattern:t.getAttribute("matchPattern"),replacementPattern:t.getAttribute("replacementPattern")});for(let e of Array.from(t.childNodes))1==e.nodeType?s.appendChild(n(e)):s.appendChild(e.cloneNode());return i&&i(s,t),s};this.dom=this.document.createDocumentFragment();for(let t of Array.from(e.childNodes))1==t.nodeType&&this.dom.appendChild(n(t)),7==t.nodeType&&this.dom.appendChild(this.document.importNode(t,!0)),8==t.nodeType&&this.dom.appendChild(this.document.importNode(t,!0));if(this.utilities.dom=this.dom.firstElementChild,!t)return"undefined"!=typeof window&&window.dispatchEvent(u),this.dom;t(this.dom,this),window&&window.dispatchEvent(u)}domToHTML5(e,t,i){if(this.preprocess(e,null,i),this.applyBehaviors(),this.done=!0,!t)return"undefined"!=typeof window&&window.dispatchEvent(u),this.dom;t(this.dom,this),window&&window.dispatchEvent(u)}processPage(){var e;this.els=(e=this.document,new Set(Array.from(e.querySelectorAll("*[data-origname]"),(e=>e.localName.replace(/(\w+)-.+/,"$1:")+e.getAttribute("data-origname"))))),this.applyBehaviors(),window&&window.dispatchEvent(u)}unsetNamespace(e){this.namespaces.delete(e)}setBaseUrl(e){this.base=e}append(e,t){let i=this;if(!t||t.hasAttribute("data-processed"))return function(){if(!this.hasAttribute("data-processed")){let t=e.call(i.utilities,this);t&&i.appendBasic(this,t)}};{let n=e.call(i.utilities,t);n&&i.appendBasic(t,n)}}appendBasic(e,t){this.discardContent?e.innerHTML="":n(e,!0),e.appendChild(t)}bName(e){return e.tagName.substring(0,e.tagName.indexOf("-")).toLowerCase()+":"+e.getAttribute("data-origname")}childExists(e,t){return!(!e||e.nodeName!=t)||e&&e.nextElementSibling&&this.childExists(e.nextElementSibling,t)}decorator(e){if(Array.isArray(e)&&0==e.length)return function(e){};if(Array.isArray(e)&&!Array.isArray(e[0]))return this.applyDecorator(e);let t=this;return function(i){for(let n of e)if(i.matches(n[0])||"_"===n[0])return Array.isArray(n[1])?t.decorator(n[1]).call(this,i):n[1].call(this,i)}}applyDecorator(e){let t=this;return function(i){let n=[];for(let s=0;s]+>")&&t[1]&&t[1].match("<[^>]+>"))i.innerHTML=t[0]+e.innerHTML+(t[1]?t[1]:"");else{i.innerHTML=t[0],i.setAttribute("data-before",t[0].replace(/<[^>]+>/g,"").length);for(let t of Array.from(e.childNodes))i.appendChild(t.cloneNode(!0));t.length>1&&(i.innerHTML+=t[1],i.setAttribute("data-after",t[1].replace(/<[^>]+>/g,"").length))}return i.childNodes.length<2?i.firstChild:i}processElement(e){if(e.hasAttribute("data-origname")&&!e.hasAttribute("data-processed")){let t=this.getFallback(this.bName(e));t&&(this.append(t,e),e.setAttribute("data-processed",""))}for(let t of Array.from(e.childNodes))1===t.nodeType&&this.processElement(t)}template(e,t){let i=e;if(e.search(/\$(\w*)(@([a-zA-Z:]+))/)){let n,s=/\$(\w*)@([a-zA-Z:]+)/g;for(;n=s.exec(e);)i=t.hasAttribute(n[2])?n[1]&&this.utilities[n[1]]?i.replace(n[0],this.utilities[n[1]](t.getAttribute(n[2]))):i.replace(n[0],t.getAttribute(n[2])):i.replace(n[0],"")}return i}applyBehaviors(){"undefined"!=typeof window&&window.customElements?this.define.call(this,this.els):this.fallback.call(this,this.els)}define(e){for(let t of e){o(t,this.getHandler(this.behaviors,t),this.debug)}}fallback(e){for(let t of e){let e=this.getFallback(this.behaviors,t);if(e)for(let i of Array.from((this.dom&&!this.done?this.dom:this.document).querySelectorAll(r(t))))i.hasAttribute("data-processed")||(this.append(e,i),i.setAttribute("data-processed",""))}}static savePosition(){window.sessionStorage.setItem(window.location+"-scroll",window.scrollY)}static restorePosition(){if(window.location.hash)setTimeout((function(){let e=this.document.querySelector(window.decodeURI(window.location.hash));e&&e.scrollIntoView()}),100);else{let e;(e=window.sessionStorage.getItem(window.location+"-scroll"))&&(window.sessionStorage.removeItem(window.location+"-scroll"),setTimeout((function(){window.scrollTo(0,e)}),100))}}}try{if("undefined"!=typeof window){window.CETEI=h,window.addEventListener("beforeunload",h.savePosition);var u=new Event("ceteiceanload");window.addEventListener("ceteiceanload",h.restorePosition)}}catch(e){console.log(e)}return h}(); diff --git a/assets/styles.css b/assets/styles.css new file mode 100644 index 0000000..7651c93 --- /dev/null +++ b/assets/styles.css @@ -0,0 +1,241 @@ +* { + box-sizing: border-box; + padding: 0; + margin: 0; +} + +body { + background-color: var(--background-color); + color: var(--text-color); + font-family: "Inter", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; + font-size: var(--text-size); + line-height: calc(var(--text-size) * 1.5); + padding: 7rem 3rem 10rem 3rem; +} + +tei-publicationStmt, +tei-sourceDesc, +tei-author:not(:first-of-type), +tei-facsimile, +tei-add, +tei-note[data-origname="note"], +tei-title:not(:first-of-type), +tei-editor, +tei-body [hidden], +[data-origname="rdg"], +tei-editionstmt { + display: none; +} + + +tei-teiheader cetei-original { + display: block; +} +tei-titleStmt { + text-align: left; + max-width: calc(var(--max-width) * var(--columns)); + width: 100%; + margin: 0 auto; + display: block; + display: grid; + grid-template-columns: repeat(calc(var(--columns) * 2), 1fr); +} +tei-titleStmt tei-title { + color: var(--title-color); + font-size: calc(var(--text-size) * 3); + line-height: calc(calc(var(--text-size) * 3) * 1.25); + grid-column-start: 1; + grid-column-end: calc(calc(var(--columns) * 2) + 1); + display: block; + padding: 0 0 .5rem 0; + text-align: center; + margin: 0; + text-transform: uppercase; + font-weight: bold; + letter-spacing: .1em; +} +tei-titleStmt tei-author { + display: block; + font-size: var(--text-size); + line-height: calc(var(--text-size) * 1.5); + grid-column-start: 1; + grid-column-end: calc(calc(var(--columns) * 2) + 1); + text-align: center; + color: var(--text-color); +} +tei-titleStmt tei-author::after { + content: 'Responsibility statements'; + font-weight: bold; + grid-column-start: 1; + margin-top: 6rem; + text-transform: uppercase; + letter-spacing: .1em; + text-align: left; + grid-column-end: calc(calc(var(--columns) * 2) + 1); + display: block; + margin-bottom: .5rem; + color: var(--text-color); +} +tei-titleStmt tei-respstmt { + display: block; + font-size: 1rem; + color: var(--text-color); +} +tei-encodingDesc { + display: block; + border-left: var(--border-size) solid var(--border-color); + padding: .5rem 1rem; + max-width: calc(var(--max-width) * var(--columns)); + margin-inline: auto; + margin-top: 3rem; + color: var(--text-color); +} +tei-encodingDesc::before { + content: 'Encoding description'; + color: var(--title-color); + font-weight: bold; + text-transform: uppercase; + letter-spacing: .1rem; + padding-bottom: .25rem; + margin-bottom: .25rem; + display: block; + width: 100%; +} +tei-encodingDesc tei-p { + color: var(--text-color); + display: block; + padding: 0 0 0 0; + margin: 0; +} + + +tei-lb, tei-lg, tei-l { + display: block; +} + +tei-text { + color: var(--text-color); + max-width: calc(var(--max-width) * var(--columns)); + display: block; + text-align: var(--text-align); + margin: 0 auto; +} +tei-body { + display: grid; + grid-template-columns: repeat(var(--columns), 1fr); + margin: 3rem 0 0; + padding: 0; +} +tei-body a { + color: var(--primary-color); + text-decoration: none; + border-bottom: 1px solid var(--primary-color); + transition: all .2s ease-in-out; +} +tei-body a:hover { + color: var(--text-color); + border-bottom: 1px solid var(--text-color); +} +tei-body tei-head { + font-size: calc(var(--text-size) * 2); + line-height: calc(calc(var(--text-size) * 2) * 1.5); + letter-spacing: .05rem; + font-weight: bold; + color: var(--title-color); + margin-bottom: 2rem; + display: block; + text-align: center; +} + +tei-placename { + white-space: nowrap; +} +tei-placename:hover { + border-bottom: 1px dashed var(--text-color); +} +tei-placename::before { + content: "📍 "; + padding: 0 .25rem 0 0; + display: inline-block; + white-space: nowrap; +} + +tei-persname { + white-space: nowrap; +} +tei-persname:hover { + border-bottom: 1px dashed var(--text-color); +} +tei-persname::before { + content: "👤 "; + display: inline-block; + padding: 0 .25rem 0 0; + white-space: nowrap; +} + +tei-p { + display: block; + padding: 0 0 calc(var(--text-size) * 1.5) 0; +} +tei-choice { + display: inline-block; + position: relative; + border-bottom: 1px dashed var(--border-color); +} +tei-choice tei-corr, +tei-choice tei-reg, +tei-choice tei-expan { + background-color:var(--primary-color); + color: var(--background-color); + border: 1px solid var(--border-color); + border-radius: .5rem; + padding: .5rem .5rem .5rem .5rem; + display: none; + position: absolute; + bottom: calc(var(--text-size) * 1.5); +} +tei-choice:hover tei-corr, +tei-choice:hover tei-reg, +tei-choice:hover tei-expan { + display: block; +} +tei-cit { + font-style: italic; +} +tei-cit tei-bibl { + font-style: normal; + display: inline-block; + padding-left: .5rem; +} +tei-supplied[reason="illegible"] { + text-decoration: line-through; +} +tei-body cetei-original { + display: inline-block; +} +tei-pb { + width: 100%; + display: block; + grid-column-start: 1; + grid-column-end: calc(var(--columns) + 1); + border-left: var(--border-size) solid var(--border-color); + margin: 1rem 0; +} +tei-pb::before { + content: 'fol. ' attr(n); + display: inline-block; + color: var(--primary-color); + font-weight: bold; + padding-left: .5rem; + font-size: 1rem; + grid-column-start: 1; + grid-column-end: 3; +} +tei-hi[rend='superscript:true;'] { + font-size: 0.8rem; + vertical-align: super; + line-height: 0.8rem; +} +tei-body > tei-div { + margin-top: 8rem; +} \ No newline at end of file diff --git a/config.css b/config.css new file mode 100644 index 0000000..ab47d74 --- /dev/null +++ b/config.css @@ -0,0 +1,52 @@ +:root { + /** + Specifies the number of columns of text. For example, if your manuscript has + has two columns, set this to 2. If you have a single column, set this to 1. + */ + --columns: 1; /* 1, 2, 3 etc. */ + + /** + Specifies the colour scheme of the document. The following variables are + available for tweaking. The default values are shown below. + + Primary colour is used for links, titles, and other important elements. + Text colour is used for the main body of text. + Background colour is used for the background of the document. + Border colour is used for the border of the document. + Title colour is used for the title of the document. + + Any valid CSS colour value is acceptable, e.g. rgb(0, 0, 0), #000000, etc. + */ + --primary-color: #315A3C; + --text-color: #132521; + --background-color: #F6F7F6; + --border-color: var(--primary-color); + --title-color: var(--primary-color); + + /** + Specifies the size of the border around the document. Any valid CSS unit is + acceptable (e.g. px, em, rem, etc.). + */ + --border-size: 5px; + + /** + Specifies the size of the text. the size of titles and other elements is + calculated relative to this value. + + Any valid CSS unit is acceptable (e.g. px, em, rem, etc.). + */ + --text-size: 1rem; /* sets the */ + + /** + Set the align of the body text. Any valid CSS align value is acceptable + (e.g. left, right, center, justify). + */ + --text-align: justify; + + /** + Sets the maximum width of the document. Any valid CSS unit will do + (e.g. px, em, rem, etc.). The document is centred on the page and the + final width is calculated relative to the number of columns specified above. + */ + --max-width: 700px; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..ad259d0 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + Tiny TEI Template + + + + + +
+ + + \ No newline at end of file diff --git a/xml/example.xml b/xml/example.xml new file mode 100644 index 0000000..e31de35 --- /dev/null +++ b/xml/example.xml @@ -0,0 +1,362 @@ + + + + + + + + Somniale Danielis + Dreambook of Daniel + Danielův snář + Unknown author + + Transribed and encoded by + Martin Roček + + + + Faculty of Arts + + Czech Republic + Prague + + + 3rd October 2020 + + +

This is an open access work licensed under a Creative Commons Attribution 4.0 International license.

+
+
+ + + + + + + Czech Republic + Třeboň + Státní oblastní archiv Třeboň + Rukopisy Třeboň + A 17 + + + + + + + ff. 58v-61r + Somniale Danielis + + + + +

+ Parchment. +

+
+ +

Written by one hand, the scriber is unknown.

+
+
+
+
+ + + + Czech Republic + Prague + Archive of Prague Castle + Archive of the Prague Metropolitan Chapter + D CIX + + + + + + + ff. 207v-214v + + </msItem> + </msContents> + <physDesc> + <objectDesc form="codex"> + <p> + <material>Parchment</material>. + </p> + </objectDesc> + <handDesc xml:id="Scriber_Unknown2" hands="1"> + <p>Written by one hand, the scriber is unknown.</p> + </handDesc> + </physDesc> + </msDesc> + </witness> + </listWit> + <!-- List of persons --> + <listPerson> + <person xml:id="Person_Daniel" sex="male"> + <persName xml:lang="eng"> + <forename>Daniel</forename> + </persName> + <socecStatus>Prophet</socecStatus> + <note> + Daniel (Aramaic and Hebrew: דָּנִיֵּאל‎ – Dāniyyēl,[a] meaning "God is my Judge"; Greek: Δανιήλ Daniḗl) is the hero of the biblical Book of Daniel. + A noble Jewish youth of Jerusalem, he is taken into captivity by Nebuchadnezzar of Babylon and serves the king and his successors with loyalty and ability until + the time of the Persian conqueror Cyrus, all the while remaining true to the God of Israel. + </note> + </person> + <person xml:id="Person_Joseph" sex="male"> + <persName xml:lang="eng"> + <forename>Joseph</forename> + </persName> + <socecStatus>Prophet</socecStatus> + <death notBefore="-1445-01-01" notAfter="-1444-01-01"> + 1445 BCE or 1444 BCE + </death> + <note> + In the biblical narrative, Joseph was sold into slavery by his jealous brothers, and rose to become vizier, the second most powerful man in Egypt next to Pharaoh, where his presence and office caused Israel to leave Canaan and settle in Egypt. + </note> + </person> + <person xml:id="Person_Pharaoh" sex="male"> + <socecStatus>Pharaoh</socecStatus> + <note> + The Bible makes reference to various pharaohs (פַּרְעֹה‎, /paʁˈʕo/) of Egypt. These include unnamed pharaohs in the legends of the Israelite settlement in Egypt, the subsequent oppression of the Israelites, and the period of the Exodus. They also include several later rulers, some of whom can be identified with historical pharaohs. + </note> + </person> + <person xml:id="Person_Nebuchadnezzar" sex="male"> + <persName xml:lang="eng"> + <forename>Nebuchadnezzar</forename> + <genName>II.</genName> + </persName> + <persName xml:lang="cze"> + <forename>Nebukadnesar</forename> + <genName>II.</genName> + </persName> + <persName xml:lang="lat"> + <forename>Nabuchodnozor</forename> + <genName>II.</genName> + </persName> + <socecStatus>King of Babylon, King of Sumer and Akkad, King of the Universe</socecStatus> + <birth notBefore="-0630-01-01" notAfter="-0635-01-01">c. 633 BC.</birth> + <death when="-0562-10-07">7th October 562 BC</death> + <note> + Nebuchadnezzar ascended the throne in 605 BC and subsequently fought several campaigns in the West, + where Egypt was trying to organize a coalition against him. His conquest of Judah is described in + the Bible's Books of Kings, Books of Chronicles and Book of Jeremiah. + </note> + </person> + </listPerson> + <!-- List of places --> + <listPlace> + <place xml:id="Place_Babylon" type="city"> + <placeName xml:lang="eng">Babylon</placeName> + <placeName xml:lang="grc">Βαβυλών Babylṓn</placeName> + <region>Mesopotamia</region> + <bloc type="kingdom">Kingdom of Babylonia</bloc> + <location> + <geo>32.536389 44.420833</geo> + </location> + </place> + <place xml:id="Place_Jerusalem" type="city"> + <placeName xml:lang="eng">Jerusalem</placeName> + <region>Middle East</region> + <location> + <geo>31.783333 35.216667</geo> + </location> + </place> + </listPlace> + <!-- Bibliographical lists --> + <listBibl> + <head>Already known editions</head> + <biblStruct xml:id="Edition_Martin" type="monography"> + <monogr> + <author> + <persName> + <forename>Lawrence</forename> + <forename>Theodore</forename> + <surname>Martin</surname> + </persName> + </author> + <title xml:lang="lat" level="m" type="main">Somniale Danielis + An Edition of a Medieval Latin Dream Interpretation Handbook + + + Germany + Frankfurt + + Peter Lang Gmbh, Internationaler Verlag Der Wissenschaften + 1980 + + + + + + + + Valerio + Cappozzo + + + Editions of the Somniale Danielis in Medieval and Humanist Literary Miscellanies + Ph.D. dissertation + + + United States + Bloomington + + Department of Italian, Indiana University + 2012 + + + + + + + Selected bibliography + + + + + Jesse + Keskiaho + + + Dreams and Visions in the Early Middle Ages + The Reception and Use of Patristic Ideas, 400–900 + + + United Kingdom + Cambridge + + Cambridge University Press + 2015 + + + + + +
+
+ + + +

This is a sample edition of the Somniale Danielis text to provide you with a demo.

+
+
+
+
+ + + +
+

Incipiunt sompniorum declaraciones, quas disposuit Daniel propheta in Babilone in diebus Nabuchodonozor regis. Omnes enim populi tradebant sompnia Danieli que videbant, ut solveret propheta ut olim gen. XI° Ioseph pharaoni. Hic Daniel de sancta civitate Ierusalem ductus in civitatem Babilonicam ostendet, que vera sompnia sunt vel quibus diebus vera existunt vel in qua linealuna non debent observari.

+

+ LineaLuna prima quidquid videbis ad gaudium. LineaLuna 2asecunda nihil ponas in animo tuo, quia nihil significat. LineaLuna 3, 4, 5. fiat cito sopmnium et erit vel videbis sicut est. LineaLuna 6, 7 custodi sopmnium Ut dicas alicui sed ora deum. LineaLuna 8, 9 quidquid videbis certum est. LineaLuna 10 non cogites de sompnio quia effectum non habet. Linea 11 infra dies 4 fiet sompnium tuum. LineaLuna 12 signat quod videris ita fiet sed cave malum. LineaLuna 13 infra 3 dies videbis vel infra quod sompnium. LineaLuna 14 si quid sompniaveris in brevi fiet tempore. LineaLuna 15 sompnium tuum post longum tempus eveniet tibi. LineaLuna 16 post breve tempus fiet. Linea 17 infra 4 dies inveniet tibi. LineaLuna 18 infra 10 vel 20 vel 30 dies eveniet tibi. LineaLuna 19 infra 9 dies eveniet tibi. LineaLuna 20 non dicas sopmnium tuum usque 3 dies quia certum est. LineaLuna 21 verum est et infra 9 dies eveniet. LineaLuna 22 sompnium ad gaudium perveniet et non reveles. LineaLuna 23 sompnium certum erit rixe concepcio et breviter eveniet. LineaLuna 24 sompnium promittit salutem et lucrum. LineaLuna 25 sompnium secundum metum futurum et infra 4 dies eveniet. LineaLuna 26. certissimum est et infra 9 dies eveniet. LineaLuna 27. sompnim effectum non habet. LineaLuna 28. sicut 26. LineaLuna 29. Sompnium certum est et infra 3 dies eveniet. Sequitur interpretatio sompniorum. +

+

+ + + Arma portare in sompno honorem ssignificat. + + + +

+

+ + + Arma perdere vel frangere dampnum ssignificat. + + + Arma perdere vel frangere dampnum. + + +

+

+ + + Aves contra se pugnare et videre litem ssignificat. + + + +

+

+ + + Aves apprehendere in sompno lucrum ssignificat. + + + Aves apprehendere lucrum ssignificat. + + +

+

+ + + Agnos videre in sompnis consolacionem osostendit. + + + Agnos ut edes habere consolacionem ssignificat. + + +

+
+
+

+ Zde začínají výklady snů, které složil prorok Daniel v Babyloně za dnů vlády Nabukadnezara. Všichni lidé totiž vyprávěli sny, které viděli, Danielovi, aby je prorok vyložil jako kdysi v genesis XI Josef faraonovi. Tento Daniel, odveden ze svatého města Jeruzaléma do Babylonu, ukazuje, které sny jsou pravdivé nebo za kolik dní se pravdivými stanou nebo, které dny není nutno sledovat. +

+

+ Den první, cokoliv uvidíš, [způsobí] radost. Den druhý, nezatěžuj tím svou duší, protože nic neznamená. Den 3.,4.,5. sen se brzy vyplní tak a bude nebo se ti vyjeví jeho význam. Den 6., 7., sen uchovávej v tajnosti, proto jej nikomu neříkej, ale modli se k Bohu. Den 8.,9., cokoliv uvidíš jistě se stane. Den 10., snem se netrap, protože se nevyplní. Den 11., sen se vyplní do čtyř dnů. Den 12., to, co jsi viděl se stane, ale vyvaruj se zlého. Den 13., do tří dnů uvidíš, to, co ve snu. Den 14., jestliže se ti něco zdálo, tak se to vyplní v krátké čase. Den 15., tvůj sen se ti vyplní za dlouhou dobu. Den 16., po krátkém čase se vyplní. Den 17., zjistíš do čtyři dny. Den 18. do deset nebo dvacet nebo třicet dní se ti vyplní. Den 19. do devíti dnů se ti naplní. Den 20., svůj sen nikomu neříkej po tři dny, protože je jistý. Den 21. je pravdivý a do 9 dní se splní. Den 22. sen způsobí radost a nesděluj ho nikomu. Řádek 23. sen je skutečně násilné podstaty a brzy se stane. Řádek 24., sen je příslibem zdraví a bohatství. Řádek 25., sen je založen na budoucí obavě a do čtyř dnů se vyplní. Řádek 26. je velmi jistý a stane se do devíti dnů. Řádek 27., sen nemá žádný účinek. Řádek 28. je stejný jako řádek 26. Den 29. sen je jistý a stane se do tří dnů. Následuje výklad snů. +

+

+ + + Nosit zbraně ve snu značí slávu. + + + +

+

+ + + Ztratit nebo zničit zbraně ve snu značí újmu. + + + Ztratit nebo zničit zbraně: újma. + + +

+

+ + + Vidět proti sobě bojovat ptáky značí hádku. + + + +

+

+ + + Lapat ptáky ve snu značí zisk. + + + Lapat ptáky značí zisk. + + +

+

+ + + Vidět jehňata ve snu značí úlevu z neštěstí. + + + Mít jehňata značí úlevu. + + +

+
+ +
+
\ No newline at end of file