Hey guys,
Do you write a lot of HTML code and do you hate the fact that the code is unreadable and huge?
If so, let me introduce you a new way to write HTML. I just released SHTML.
Here is basic syntax:
h1 > h3{hello} > h5 <p p
This will lively generate: <h1><h3>Hello<h5></h5></h3><p></p><p></p></h1>
If you are interested, or would like to try it go and download the module at: https://github.com/juliarLang/Juliar_shtml
You will need to have juliar installed in order to use this:
You can go to https://github.com/juliarLang/ to download the language core.
HI Rattar I’m guesing you are too young to remember when shtml was more of a thing?
Are you sure this won’t cause confusion, or even worse conflict for some? eg
Apache httpd.conf
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
@Mittineague I edit Apache httpd.conf all the time. I never noticed that pieces of code. SSL HTML interesting…This won’t cause the problem as this is a juliar module and all juliar modules are saved with an extension of .juliar. The way you run it is placing this text *shtml *.
@TechnoBear The main issue that this module solves is closing tag issue. A lot of people write very long code and miss a div tag for example…you would have to debug long code and find the issue. Sometimes you don’t even notice this issue. With this software, you can write code into more compressed and more readable syntax.
I can’t help thinking a validation service will do a better job of picking up HTML syntax errors, than writing in this form - ultimately it has to validate as HTML anyway, so I’m a little lost at to why use the intermediary form.
My editor automatically inserts tags in pairs, which eliminates this issue. I was under the impression that most editors behave this way.
But I still don’t understand your example. What, exactly, is h1 > h3{hello} > h5 supposed to mean, and why does it produce the strange nested code you showed, with extra <p> tags included?
The tags follow XML syntax. This code may not be valid in HTML, but it is valid in XML. Since, it is a SHTML, I need to update this. Do you mind submitting an issue report on github?
The Chances are, you are not using just HTML, but a lot of other languages, like javascript for example. The validation service may not be able to pickup some parts of code. With this module, you don’t have to validate, each time you make changes as the code gets generated at run time.
Many editors do have this feature. However, if you are writing many lines of code, you might delete a closing tag. Although, this module doesn’t prevent any grammar checking (maybe it should?) It does, make sure that closing tags are placed correctly. Also, the code size will be much smaller than the normal html code. So it will be faster to read.
It is based on Emmet script as stated in the module.There are few differences.
Emmet only works as a plugin and only generates the code in the editor, while with this, you can save files in this syntax and they will run.
Emmet script doesn’t allow spaces while this module forces the use of spaces to separate each tag, child symbol, and parent symbol. In Emmet, ^ is used to go to parent, while in this module < is used for parent and ^ is used to go to the “root” or first Node. Emmet uses + symbols for siblings, while in this module you just use space. If you know Emmet, you will definitely know how to code with this.
^ : root
> : Child
< : Parent
#: id
. : class
{}:input
[]: attributes
But it’s still perfectly possible to create invalid code, as your first post demonstrated. It may prevent closing tags from being missed, but it doesn’t negate the need for code validation.
Aww, whilst I agree that the syntax does seem cryptic there’s room in the world for projects like this Haml and Jade. The examples were confusing but it doesn’t have to look so weird.
I do agree that smart closing rules like significant white space can really tidy up the place and add a lot of clarity. Only someone with a heavy bias would argue this is clearer and easier to work with.
<div class="class-one" id="id-one">
<div class="row">
<h3>This is text</h3>
<h3>This is text</h3>
<h3>This is text</h3>
<h3>This is text</h3>
<h3>This is text</h3>
</div>
</div>