Recommend this page to a friend! |
Classes of Nicola Bombaci | swam | README.md | Download |
|
DownloadSWAM by Nicola BombaciShort Web Acronyms Merged<img style="float:right" src="./swam.png"> Link to the official page - LICENSESWAM (Short Web Acronyms Merged) is a great alternative for the Front-End developers. HTML is often filled with tags that during large works, generate projects slow and difficult to understand, for this reason SWAM promises to catalog all the HTML tags to have a website backward compatible, fluid and dynamics. The language is python like and require the presence of the tabs. Every line is considered like a node of tree, who is on top is the father, who is under the father is a son and so on Try the live code HEREYou can easily try the language and understand the syntax of SWAM. It's easy, it's fast, it could be yours. Let's click to discover. It's free How toInstallDownload the project from Github and copy Add in your php file the library
Get the contents from a file
And print your parsed file
And this is it! ProgrammingEvery time you will create a new SWAM file (.swa), you can compile it only by pass through the piece of code into the class of swam and exectue the parsing There is a debug mode that you can easily activate, opening the file CommentsWrite a comment is simple. It can just work only if you are using a whole line. The syntax used is like every language, you must use // and so on. An example > on div >> // This line is a comment >> on p >>> Here I am Be careful if you are typing a double slash inside a line with code, this will be removed and could cause error parsing An example > on p // I cannot stay here >> Ops. StructureThe on tagIn HTML to open some tag is used the syntax
In SWAM to open the tag you can easily use the syntax > on html ContainerON is a general container tag. It is helpful for every kind of tags like: div , section , form , p , and others. If you want to create a multilevel tag, you must start the new paragraph with one more tab than the previous element. Example > on div >> on section This will produce:
In lineIf you want to insert something inside an tag, you must start a new paragraph with one or more tabs than the previous element. You will write in the same tag until the number of tabs will be less than the father or a new tag has been inserted in. Example > on p >> Hello World >>> This is a test >> on strong >>> cool > on h1 >> Here This will produce:
Example> on html >> on head >>> on title >>>> SWAM >> on body >>> on p >>>> Hello World >>> on div >>>> Nothing This will produce:
JavaScriptsSWAM is fully compatible with JavaScript > on script type="text/javascript" >> var user = { >> name: 'Dolly'}; >>sprintf('Hello %(name)s', user); Fast attributesSWAM is fully backward compatible. You can use instead a ON tag, the same syntax of HTML. > Example : on div id="new" style="margin-top:20em" The important thing is use the white space only for declare a new value and the tab only for the row (the hierarchy of the nodes) To give a fast input I've introduced 2 important symbol:
Example> on html >> on head >>>on meta name="Welcome to SWAM" >> on body >>> on strong >>>> Example >>> on section >>>> on div #id1 >>>>> on p >>>>>> Section 1 >>>>> on div #id2 >>>>>> on p >>>>>>> Section 2 >>>>>> on div #id3 >>>>>>> on p style="color:white" >>>>>>>> Section 3 Results:
|