TEIC / TEI-Simple

Legacy Repository: TEI SimplePrint now merged into TEI Repository. Originally TEI Simple aimed to define a new highly-constrained and prescriptive subset of the Text Encoding Initiative (TEI) Guidelines suited to the representation of early modern and modern books, a formally-defined set of processing model rules that enable web applications to easily present and analyze the encoded texts, mapping to other ontologies, and processes to describe the encoding status and richness of a TEI digital text.
50 stars 12 forks source link

Handling for tei:code #13

Closed joewiz closed 9 years ago

joewiz commented 9 years ago

An implementation question:

As I was reviewing @wolfgangmm's tei-simple-pm app, I noticed the documentation.xml file used the <code> element, which the TEI-Simple docs say is...:

not allowed in TEI SImple, but should be transformed to another element

... namely, <hi>. I found an appropriate @rendition value: simple:typewriter, and could wrap blocks in <ab> (possibly with a CSS @rend override of white-space: pre to ensure preservation of line breaks? or is @rend not allowed?). We'd lose the possibility of language- or vocabulary-specific syntax highlighting that we had with the old <code lang="xquery">, etc., but at least we'd have standard TEI-Simple. Then I noticed that the TEI-Simple-PM docs do use <code>, so I started to wonder if <code> really isn't intended to be allowed in TEI-Simple?

While project documentation may not be the primary case for TEI-simple, it occurred to me that the question might be worth raising, because it gets at a question I had: what's the best route for a project that wants to extend or customize TEI Simple?

joewiz commented 9 years ago

For the naïve approach described above, see https://github.com/joewiz/tei-simple-pm/commit/e5782cebe5405616b6b6da7fa30e5e818f232be7. The biggest deficiency here is the lack of white-space: pre; I'm interested in how to approach this? Any ideas for @lang? (c.f. http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-code.html.)

tuurma commented 9 years ago
  1. @rend is not allowed but @rendition is
  2. being 'standard' TEI Simple is maybe not the greatest of concerns, but on the other hand I think you've made a very fair point for keeping in TEI Simple

About customizing/extending TEI Simple, give me a while and I'll try to put our discussion from Berlin into writing, but if you'll have a look at a diagram attached, from the processing model point of view various XML vocabularies are 'kosher' as long as you can write ODD for them using only functions from TEI Simple Library. And this we call 'customizing' for now (customizing of the processing model, not of TEI Simple as a whole, as this assumes starting with TEI Simple vocabulary as a base). 'Extending' would be something that involves adding to the TEI Simple Function Library (thus necessitating tinkering with implementation).

On 19 May 2015 at 23:25, Joe Wicentowski notifications@github.com wrote:

An implementation question:

As I was reviewing @wolfgangmm https://github.com/wolfgangmm's tei-simple-pm app, I noticed the documentation.xml https://github.com/wolfgangmm/tei-simple-pm/blob/master/doc/documentation.xml file used the element, which the TEI-Simple docs http://htmlpreview.github.io/?https://github.com/TEIC/TEI-Simple/blob/master/teisimple.html#index.xml-body.1_div.3_div.1 say is...:

not allowed in TEI SImple, but should be transformed to another element

... namely, . I found an appropriate @rendition value: simple:typewriter, and could wrap blocks in (possibly with a CSS @rend override of white-space: pre to ensure preservation of line breaks? or is @rend not allowed?). We'd lose the possibility of language- or vocabulary-specific syntax highlighting that we had with the old <code lang="xquery">, etc., but at least we'd have standard TEI-Simple. Then I noticed that the TEI-Simple-PM docs http://htmlpreview.github.io/?https://github.com/TEIC/TEI-Simple/blob/master/tei-pm.html do use , so I started to wonder if really isn't intended to be allowed in TEI-Simple?

While project documentation may not be the primary case for TEI-simple, it occurred to me that the question might be worth raising, because it gets at a question I had: what's the best route for a project that wants to extend or customize TEI Simple?

— Reply to this email directly or view it on GitHub https://github.com/TEIC/TEI-Simple/issues/13.

joewiz commented 9 years ago

Thanks, @tuurma, for your reply - it reminded me about the differences between the processing model and the base TEI Simple vocabulary. The distinction between customizing and extending is also helpful.

You mentioned an attached diagram, which didn't seem to make it into the GitHub issue. Could you try attaching it through the web interface?

sebastianrahtz commented 9 years ago

On 20 May 2015, at 20:30, Joe Wicentowski notifications@github.com wrote:

You mentioned an attached diagram, which didn't seem to make it into the GitHub issue. Could you try attaching it through the web interface?

you can see it embedded in http://htmlpreview.github.io/?https://github.com/TEIC/TEI-Simple/blob/master/tei-pm.html

Sebastian

sebastianrahtz commented 9 years ago

the docs for PM don’t claim to me conformant to TEI Simple, and I am not sure they want to be. TEI PM is, after all, independent of Simple. Whether we need in simple, I wonder. Does one use code outside born-native docs?

... While project documentation may not be the primary case for TEI-simple, it occurred to me that the question might be worth raising, because it gets at a question I had: what's the best route for a project that wants to extend or customize TEI Simple?

do you mean customise Simple or do you mean extend PM?

i would not that the source on Github includes an example of customizing Simple; tests/myteisimple.odd. its a working example of chaining ODDs.

Sebastian

sebastianrahtz commented 9 years ago

my thought, which i have done, is to add an alloweed value for @rendition of simple:literal, has is like typewriter but has the whitespace:pre stanza as well

Senastian

joewiz commented 9 years ago

Thanks, @sebastianrahtz! I have started to (re-?)absorb the differences between the PM and the TEI Simple ODD. Please disregard my previous muddled implication that <code> should be integrated into the main teisimple.odd file. Of course, any project that needed such a thing could make their own ODD that both introduced the <code> element as a project-specific customization and (if needed) defined a processing model @behaviour for this <code> element.

Also, upon further study, I realized that @wolfgangmm used <code> precisely to illustrate how one might extend TEI-Simple. It's a good illustration, particularly since he's added a hook for customizations.

I do like your addition of the @rendition value of simple:literal. I just sent a small pull request (#14) to help with that change.

joewiz commented 9 years ago

(Not to prevent further comment, but I think I will close this to indicate I understand the issues now and that I don't think any action is needed.)