homenewslegalreferencedownloadfaqlinksabout
TRASHY (Tags Resized and Alternative Syntax for Html made by Yayo)

TRASHY reference guide



    index

TRASHY code syntax

     Before starting to write TRASHY code you must learn some basic rules about the syntax.

Note: To know how manage the trashy.php file for getting started in coding, please refer to the last section of the download page.


1

Always write your code inside single quotes ( ' ).

DO NOT use double quotes ( " ).
Double quotes expand into php code some of the characters used by TRASHY.

Example of correct syntax:

trashy('trashycode');



2

When you need to add normal text (text which must not be parsed by TRASHY), you must write it between special quote characters.

There are 2 choices available for this:
  • you can use:

    1. ` to stop parsing/start normal text
    2.  ´ to restart parsing/end normal text

  • if you have a text editor which displays placeholders for control characters (those ones with an ASCII code lower than 32), then you can use the 2 control characters:

    1. "start of text" (ASCII code 2)
    2. "end of text" (ASCII code 3)

examples of correct syntax:

trashy('trashy code`normal text´trashy code');
trashy('trashy codepicture of placeholder for start of text control characternormal textpicture of placeholder for end of text control charactertrashy code');

Remember to use them in the right order. Not reversed!
Attribute values don't need to be quoted: using these quote characters for attribute values leads to incorrect results!


3

Close all tags which don't require closing.

DT, LI, OPTION, P, TBODY, TD, TFOOT, TH, THEAD and TR are all marked on W3C specifications as tags which don't need to be closed (the close tag is optional).
At present time TRASHY is missing a feature which lets you manage optional closing tags, so when you use TRASHY you MUST close all these tags, too.


4

To close tags you must use one of these three aliases: )]}.


The right round bracket ( ) ) close only THE LAST tag.
The right square bracket ( ] ) close the LAST TWO tags.
The right curly bracket ( } ) close the LAST FIVE tags.

You can combine them to close as much tags as you need.

Examples:
use ]] to close last 4 tags (2+2)
use }) or )} to close last 6 tags (1+5)
use }} to close last 10 tags (5+5)

When you mix different brackets you can write them in any order, and you can also use spaces between them.

Remember: only RIGHT brackets close tags! (Left brackets are used as tag aliases.)


5

The tag/attributes sequence is made with a tag alias followed by one or more attribute sequences, without spaces inbetween.
Each attribute sequence is made by these elements (in this order):
  • attribute alias
  • [question mark]
  • [attribute value]
  • double quote


The picture which follows shows you an example of this.

picture which explain the syntax for tag/attribute sequence

Spaces (but not tabs, CarriageReturn or LineFeed) ARE ALLOWED ONLY as a part of the attribute value, which means between question mark and double quote sign. Using spaces in any other way during the sequence of attributes or between the tag and the 1st attribute alias will break the tag/attributes sequence, and then the part which follows the space will be ignored.

After each double quote you can place another attribute, a new tag or separation spaces.

When an attribute allows itself as the only possible value you can avoid rewriting, and place the double quote after it to close the sequence.
(example: when you need to write <IMG ismap.. you can use &im" instead of &im?ismap").

Example of correct syntax:

&im"s?file.ext"a?alternative text"w?120"h?24"

which produces

<IMG ismap src="file.ext" alt="alternative text"
width="120" height="24">



This software and its documentation are licensed under the terms of the CC-GNU GPL license v.2! SourceForge.net LogoThis page is valid -//W3C//DTD HTML 4.01 Strict//EN!
This page uses valid CSS!
This site conforms to the W3C-WAI Web Content Accessibility Guidelines.
This site conforms to the US Government Section 508 Accessibility Guidelines.
All the pages of this website/documentation, as well as the TRASHY software itself, are released under the terms of the CC-GNU GPL license v.2.

End of page      -      TRASHY (C) 2005 yayo (Roberto Correzzola)