SunoikisisDC / SunoikisisDC-2020-2021

Sunoikisis Digital Classics 2020–2021 syllabuses
19 stars 2 forks source link

Help with Sublime Text and free-form markup exercise #4

Closed gabrielbodard closed 3 years ago

gabrielbodard commented 3 years ago

If you have any technical problems or other difficulties with the exercise for Session 2, please feel free to ask it in this thread, and we or your colleagues will try to address it.

despinaborcea commented 3 years ago

Hello!

I have a question with regards to the exercise. When I tried to copy and paste the text into Sublime, I added a header and when I opened the file in the browser it was showing only the header, but not the rest of the text or the root- what can I do to make the text and the root appear in browser view too?

Thank you in advance!

jonathanblaney commented 3 years ago

Hi there.

I wonder if you're mixing up HTML and XML element and that is confusing the browser. You could try - if you haven't already done this - putting an html element around everything.

Normally with errors like this is a good approach to get the minimum working and then keep adding until you hit the problem. So in your case you've got the header working and I would add a very small amount of text underneath, eg a paragraph, and see if that will display.

Feel free to paste your markup here if it's still not displaying.

despinaborcea commented 3 years ago

Thank you for your message. This is the bit I was working on:

Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur.

When I save it as an xml file it does not display the text or the root element, it only shows 'Gallia'. Is there a Sublime viewer that would allow me to see the final result? I have tried saving it as .html and opening it with a browser, but it still does not display the root.

jonathanblaney commented 3 years ago

I don't there is an easy way to view XML in a browser: because you can invent your own elements there is no automatic way for the browser to render any given element. The standard way to do it is to write a stylesheet in a language called XSLT, where you would specify a mapping from XML to HTML, but XSLT takes a bit of time to learn.

For these exercises I would do them either in XML or HTML (or both) but only render the result in a browser if you're doing HTML. With XML it's quite normal just to use it in a text editor like Sublime. Sublime has an XML add-on that display XML a bit more nicely than the default, I think, but it will still look pretty plain. Don't worry about that: it's how people generally work with XML.

despinaborcea commented 3 years ago

Thank you very much for your helpful clarifications - I will try again with Sublime!

jonathanblaney commented 3 years ago

Good luck! Let me know if you have any questions as you go along. Happy to try to help.