Zen1th 14 Posted December 10, 2018 Share Posted December 10, 2018 (edited) OHML v1.0.3 OHML is a markup language based on the eXtensible Markup Language (XML), it is a simpler and OC-graphics adapted version of HTML. Why OHML? It all started when i noticed that most network programs/libraries were either DNS system, or Website system. However it is very important to maintain an universal language for webpages. It is the first step of having a stable and universal "OCranet", which will follow with server and client implementations. Protocols, etc.. Concepts HRef: Shortcut for Hyperlink Reference Document Versions OHML patch versions (1.0.1, 1.0.5, etc.) minor changes (more understandable descriptions, new optional arguments) can be asked in comments section, might get accepted, and when features are froze, set as a new minor version of OHML specifications. OHML minor versions (1.2, 1.1, 1.42) OHML major versions (2, 4, 5) are to be proposed in comments sections and feature froze. Once released they will replace the outdated data in this post. Tags Table about all tags and their (XML) arguments is available in png format, attached to this topic. h1-h5 6-2 sized OC character font title, each letter must be made from the number of character both in width and height. The font can be any font, as long as it respects the size rule. This would usually be made using a big font library. text This tag allows to display a text line. If putting the text in the plain document, due to the XML nature line breaks wouldn't be counted. In the text tag they aren't counted neither, but at each tag end, a line is skipped. script This contains any script made for any scripting language supported by the Browser. The attribute "lang" defines the scripting language, it defaults to "application/lua" for LuaWeb, however it remains an XML tag and will not work well with multi lines, the solution is CDATA, simply add a comment and add <![[CDATA, then at the end of script do another command and put ]]> , this will effectively allow the use of multi-line scripts. link Displays inline text, it haves, by default, a blue color. When it is clicked the page jumps to the hyperlink reference defined by "href" attribute. image Contains one attribute: "file". This is the path of the image treated as an Hyperlink reference. br Breaks a line, which mean that a text line is skipped, this act the same as <text></text> but cannot contains any text. button Clickable button with text being inside the tag. The text doesn't support OHML but will still be parsed as XML (a CDATA section is then recommended). Any <script> tag can set a listener on the button. "onclick" listener Arguments: mouseButton mouseButton is "left" for left button, "middle" for middle button and "right" for right button. box Container. It can contains any possible tags in OHML. It can be used for styling the element's bounds are fully customizable using Positioning, and while by default it is transparent, using Styling this can be used as a resizable background color. Tags Attributes Positioning Introduced in OHML v1.0.2, Positioning allows to position tags in an absolute or relative way. Tags have optional arguments "x", "y", "width", "height" and "relative" The "relative" argument is for using relative positions, vertical at first, and horizontal at last, we can use "up" (default) or "bottom", put a ";" for splitting, and add the horizontal value that can be "left" or "right". Relative positions works that if for example the value is "bottom;right", and if x = -5 and y = -5, the element Y will be at the most bottom point of the page (meaning that bottom for a page with elements not going after 10 for y, the bottom would be 10), added -5, which is equivalent of minus 5, and the element X will be at most-right point (generally viewport width) and will have minus 5. Meaning that for a page sizing 80;25, it would go at 75;20 Styling Introduced in OHML v1.0.3, this allows elements to be stylized in little ways. This should eventually be superseded by a dedicated styling language. The styling addition introduces many attributes, these attributes are also by default transmitted to the element's childs bgcolor This attribute takes an hexadecimal RGB value and sets the background color of an element. The background is effective on the bounds of the element, which are its absolute x, y, width and height. color This attribute takes an hexadecimal RGB value and sets the foreground color of an element. Like bgcolor, the background is effective on the bounds of the element. Hyperlink Reference An hyperlink reference can be relative or absolute. If a HRef starts with any supported protocol name followed by "://" (ex: ohtp://), the link is fully absolute and will replace the current address. It must be an URI. Otherwise, if an HRef starts with "/", it is relative to the website host (e.g: ohtp://test.com), so, the full path is: {WEBSITE HOST} + {HREF} Finally, starts with nothing above, it is relative and should be appended to the actual URL URI are in the same format than real ones which is "protocol://host(/page)" OHML, being a markup language, will not support any kind of dynamic coding like <if> statements, <print> statements, etc., dynamic coding is handled by <script> tags and scripts languages supported by the browser. (Currently no script language has been made, it's coming). For now one implementation has been made and it is the reference one called Minescape. Edited March 4, 2020 by Zen1th OHML v1.0.3 Molinko 1 Quote Link to post Share on other sites
MajGenRelativity 0 Posted December 10, 2018 Share Posted December 10, 2018 Do you have a Discord (preferred) or IRC account we can use to talk more about this? I'm interested since you mentioned GERT Quote Link to post Share on other sites
Zen1th 14 Posted December 10, 2018 Author Share Posted December 10, 2018 Yes i have discord, anyways if i mentionned GERT it's because i find interesting the idea of connecting minecraft servers each other. It allows for a OC "internet", since oc servers can now technically be acessed from any minecraft server having a GERT address. Which allows for endless possibilities in oc web. Quote Link to post Share on other sites
Zen1th 14 Posted July 12, 2019 Author Share Posted July 12, 2019 I made a first implementation capable of parsing and displaying OHML. This implementation supports most things except: relative positions, buttons, images and progress bars. It's called minescape and for now is only published on my repo (available with Fuchas's fpm command) Quote Link to post Share on other sites