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

Frequently Asked Questions



    index

Requirements



What do I need to write TRASHY code?

  1. 1st of all the function itself, of course! The link to the package is on the download page.
  2. php (please, refer to the next question/answer for minimum version required)
  3. Some HTML knowledge
Useful but not strictly required: a text editor which displays a placeholder for control characters (those ones with ASCII code lower than 32). See links page for a list of some text editors which provide this feature.




What version of php is required?

     The newest function used in TRASHY seems to be array_key_exists() which was added to php in version 4.1.0.
So, to get TRASHY to work correctly you need at least php 4.1.0.


Development/help



Why a "php code version"?
There are other ways to code TRASHY?

     TRASHY uses only php at this moment, but TRASHY is not only a PHP script, it is also a set of aliases and syntax rules and could be implemented in software projects in many ways.
If someone else provides a different way to use TRASHY I will place the link of their homepage on the links page.

If you made some software or a CGI script which can expand TRASHY aliases, let me know.


Why did you choose just THOSE chars aliases?

     I've tried to make good associations, but those characters were not made for this purpose, of course, so maybe you will find some associations a bit forced.
Anyway there are many rules I've tried to keep in mind during development of the associations.
  • meaning correspondence (between character and tag)
    (example: paragraph character used for paragraph tag <P>).
  • general meaning resemblances (between character and tag)
    (example: ? is used for <FORM> tag because when you use a question mark you are asking for something, just like form tag does! : )
  • resemblances between the shape of the character and the meaning of the tag
    (example: / for the italic font style tag <I>)
  • shrinking of existing tags
    (example: number x in place of header <Hx> tags group)
  • use of an alphabetic character for tags used to mark the meaning of a block of text
    (example: C for CITE, B for BLOCKQUOTE...)
  • reuse of the same character for tags with similar meaning, when possible (example: ¯ for every heading tag, like <HEAD>, <THEAD> and <TH>)
  • the use of common characters for common tags and vice versa.
  • the use of remaining characters to fix orphan tags (for those ones for which I was not able to provide a better alias)
I hope that the associations I made using these rules help you in learning TRASHY quickly.
I simply chose what I felt was the best set of associations.




Are you planning to go on with its development?

     I give you no guarantees for future development.

I wrote TRASHY for myself, to write and manage HTML quickly, but at this moment I'm not interested in making it a masterpiece project. It works fine and this is all I need for now. I will fix the code step-by-step, according to my requirements.

If you use it a lot and would like to see it grow, the best way to make me motivated about this is money! I'm in lack of money, so a donation could help a lot.
Read the next question/answer to know more about this point.


Note: to understand why this text is deleted, please refer to the next question.

However, some things which would be interesting to add are:
  • a set of aliases for inline style setting
  • resizing the main code/file by exchanging all the repeated lines with internal aliases and/or crosses references.
  • some kind of debug option

Some other minor things:
  • adding a multiplier alias
  • a "close all" alias, to close all the open tags in one step, when you have nothing more to add to your page.
  • a way to manage optional closing tags
  • option for choosing between compact and indented HTML output
  • support for XHTML code
  • ..?



I like this project! How can I help you?

     Thanks! I'm glad you like it!
There are many ways to support/help this project.
  • Money! This could be very useful!
    Sadly at the present time I have no money accounts which could be used to accept donation (I'm poor: computer and internet connection are provided by my family! :P), but if you really want to donate something, contact me and we will find a way! I will be very grateful for this!

    Also if you have one, you could send me a piece of hardware you no longer use (like an usb memory stick or something else related to computer use). Something working (of course! yes, ok, the project is called TRASHY, but this doesn't means that I can get something useful from your trash! I'm not a wizard! :P) and recent, (no more than 3-4 years old).
    Be careful! I cannot provide money for postage. :/


    Note: due to some restrictions of the sourceforge hosting service, I cannot solicit donation except via paypal, but I don't have a monetary account and then also not a credit card to use it.
    This is the reason because the previous text was deleted.

    «[...]You may not use your project web site [...] to solicit donations except via the SourceForge.net Donation System.[...]»

    Doh! »¦'/
  • If you made a webpage written with TRASHY or you simply want to add a link to this site on your page, you can use the TRASHY link/logo. This gives me credit and helps grow the number of pages which link to TRASHY homepage: in this way this site will rise up in search engines ranking and will be easier to find for other PHP/HTML coders on the net.
    See next question to get more information about this.
  • Report bugs to me, if you find one. Remember to also tell me about the way to reproduce the bug and any other information which could be useful. (Please be sure it's an actual TRASHY bug, not your coding mistake.) See bottom of the page for information on how to contact me.
  • Provide suggestions about alias arrangement to manage characters coding different to ISO-8859-1.
  • If you are a coder, you can provide some other ways to use it, like a text editor which recognize and expand the TRASHY code, or a function made in another CGI language for the development of dynamic web pages.
  • Finally by sending me a simple mail to say me that you use TRASHY and you like it, could be useful to make me feel happy. ¦ )
Remember that this software is free software (free like "free speech") and you can use it without giving me anything. (Help is simply appreciated a lot!)
Thanks!


How can I place the TRASHY link/logo on my webpage?

     Choose from these pictures the one which fit in your site style:

picture:filename:
black / pale blue TRASHY logoTRASHY_logo1.png
black / pale pink TRASHY logoTRASHY_logo2.png
black / pale yellow TRASHY logoTRASHY_logo3.png
black / pale green TRASHY logoTRASHY_logo4.png
black / pale grey TRASHY logoTRASHY_logo5.png


Copy the picture into your site folder (you can find the files inside your TRASHY documentation folder, or you can save the selected one by right-clicking on it and selecting "save image as..." from the menu).
Then select and copy the code you need (HTML or TRASHY, both are written below) into the clipboard and paste it into your page code.
Finally change the picture filename to the name of the picture you chose (also fix the path, if required).

This is the HTML code required:

<A href="http://trashy.sourceforge.net/index.html"> <IMG src="TRASHY_logo1.png" width="77" height="13" alt="TRASHY site logo" style="border-width: 0px;"> </A>

and this is the equivalent TRASHY code:

@h?http://trashy.sourceforge.net/index.php" &s?TRASHY_logo1.png"w?77"h?13"a?TRASHY site logo"st?border-width:0px;")


Your page should now display a button like this:

TRASHY site logo



Charset



What kind of chars are used as aliases?

     Tag aliases use base ASCII chars (code from 33 to 126, hex 20 to 7E) and some other chars from extended latin (ISO-8859-1, code from 161 to 255, hex from A0 to FF).
Attribs use only lowercase letters from a to z.




Why ISO-8859-1?

     ISO-8859-1 because I'm Italian and this is the standard for this area.
If you live in a different area and you use a different charset, this could be a problem with recognizing and understanding the graphical associations I made for chars with a code bigger than 128, even if the code will work well anyway.




Why not codes between 128 and 159?

     I've not used codes from 128 to 159 because those ones are not part of the ISO standard code. The ones I see on my pc are windows specific chars: ISO is a standard, not Microsoft Windows which is only the most used OS. This way also Linux, BSD, Unix... users can make TRASHY code. : )


Performances/limits



I've tried it, but that combination of tags doesn't work. You lie!

     Nope.
Only correct tag sequences are allowed.
You cannot open a TD if you are not inside an TR tag. You cannot use TITLE outside of the HEAD tag, and so on.
This way the code is reduced in size and helps you to make correct html. Not permitted sequences are simply ignored, so if you try to add an alias which doesn't make sense, the function jumps over it and continues.

     Anyway, perhaps I made a mistake in checking the code (there are a lot of combinations!), so if you are absolutely sure that a specified sequence is ok but is not supported by TRASHY, you can send me a mail, also providing a valid reference for this to help me to fix it.
See feedback section to know how to contact me.
Thanks.




What kind of tags and attributes are supported?

     See general notes about aliases on trashy reference page.
See also the W3C HTML pages for an official reference about currently used and deprecated tags and attributes.




Why there is not an alias for the tag <HTML>?

     Because the HTML tag is the 1st tag open and the last one closed, so I left it implied to avoid wasting an alias on it.




How fast is TRASHY?

     Fast enough to let you use it in common ways without worring about its speed performance.
Consider that all the pages of this website are written with TRASHY, and some of them are written with a single TRASHY session. This should give you the proof that it's fast enough.
Anyway it's obvious that TRASHY slows down the rendering time of the page a bit. This means that if you have many other lines of php code, you should avoid giving unrequired text to TRASHY, to gain the time that the function wastes in parsing it.

Example: if you need to print the content of the variable $output, which contains a lot of normal text, you can write it as

echo trashy('codebefore').$output.trashy('codeafter');


instead of

echo trashy('codebefore$outputcodeafter');





How much space can I gain using TRASHY?

     1st of all, keep in mind that the amount of space gained by the file using TRASHY is not the 1st target of this project: it's a side effect.
The 1st target is to resize the HTML code on the page of your text editor to let you manage/write your code better: writing (or changing) a single character is much faster and easier than doing the same with a word.

     This page is made with a single TRASHY session and doesn't use dynamic content which could change the number of tags/attributes in it, and with a quick verify I counted 884 tags and 201 attributes in HTML code produced, with 5899 total characters (without counting text, attribs values, spaces, tabs, CR and LF)
It's TRASHY version is made with only 1995 characters!
The characters which follow were no longer required by using TRASHY:
  1. 884 "<" (double, by counting also ">")
  2. 349 forward slash (used for closing tags),
  3. 201 double quote (used as left enclosing char for attribute values), and also
  4. 201 spaces to divide attributes!
If I didn't make any mistakes in computation, this means that in this case TRASHY code takes 33,8% (around 1/3rd) of the html equivalent! :D

Note: when I made this verify, this page was not already complete, and with the latest changes I've obviously changed the code of the page. This means that if you check the code by yourself you will see some little differences in values. However these values are still useful to let you see the average space saved by the use of TRASHY.


     Be careful! The trashy.php file is around 65Kb of text. You must consider this if you plan to distribute php code based on TRASHY.
The amount of space gained by using TRASHY starts to make sense after these 65kb.
An example: supposing that the code you wrote is around 90kb and by using TRASHY to rewrite the HTML you resize it to 50kb. At this point you still need to add the "trashy.php" file to your code to make it work. So you dropped 40kb, but you need to add 65kb, which ultimately means 25kb of space wasted and nothing gained!
You will probably start to gain space using TRASHY within big projects.

Yes, these few bytes are not such a sensible amount of space at the present time, and you will probably zip your code before you distribute it, reducing these values to something which it doesn't make sense to care about.

And after all you still can choose to add the trashy.php file to your project, as well as leaving the users to download it by themselves, writing about it under the software requirements section of your documentation.
Anyway, I think it's better for you to know this.

Note: zipped trashy.php file is 12kb, while a .7z archive with a high compression level is 9kb.

     Another thing must be said about this: the TRASHY file can at present time still be reduced a lot: it contains a big array with many repeated lines. By adding some internal aliases and crossed references to the code, many of these lines can be removed.
Even if it works fine just now, TRASHY it's still not optimized (usually software projects are developed step-by-step, they're not already perfect when they appear, and TRASHY is still taking its 1st steps! :P). So if you would like to see it optimized, consider that providing a little monetary donation could make me feel motivated to go on with its development.
To know more about this, please refer to the how can I help question.




How can it be possible to reuse characters?
Doesn't this lead to confusion?

     Nope.
The function memorizes tag history and recognizes what kind of tag you are going to add attributes to. In this way the a attrib can only be action inside FORM tag, alt for INPUT, IMG, or AREA tags, and archive for OBJECT (and will be ignored in every other kind of tag).
The - alias, can be TR inside TBODY and HR in every other place HR is allowed.
And so on.




What about the variable names you've used?
Must I pay attention to this?

     I don't think that you will really need to take care about this.
TRASHY uses some global variables. Supposing that by mistake you give to the variables of your php code one of the names used for TRASHY variables, that original variable would be overwritten with your values and the program would stop working.
To avoid this I've set all TRASHY global variables names to have a _TRASHY_ prefix.
These are the names used:
  1. $_TRASHY_tags
  2. $_TRASHY_history
  3. $_TRASHY_attribs
  4. $_TRASHY_control
  5. $_TRASHY_emptytags
  6. $_TRASHY_specialattribs
  7. $_TRASHY_htmlattribs
I think that you would be very unlucky to use by mistake one of these names for your variables. : )




Does this TRASHY version has know issues/limits?

     Yes, TRASHY at this moment has some limits.

The limits (not bugs) that I know about, at this moment, are:
  • missing controls for tags which don't make sense to write more than once in code, like the HEAD tag: if you write the ¯ alias after you've closed the one you've already written, another HEAD will be opened. This is wrong. But in fact you could also make this by writing normal HTML, because it is supposed that you check this by yourself.
    Anyway I think that it would be good to let TRASHY check this, to refuse to repeat unuseful things helping you to avoid this kind of mistake, so I think that I will add this feature in future releases.
  • missing verify for unsupported values on attribute which allow only fixed ones (like method attribute in FORM which could accept only GET or POST)
    At present time you could write everything as value for method and attributes like this one.
  • close tag always required, even when W3C documentation consider them as optional.
Anyway, I've tryed to do my best to remove all the bugs I found: at the present time the code seems to be stable enough to be used.




I've found a bug. What must I do?

     Please, 1st of all be sure that it's a real TRASHY bug/issue, not your coding mistake.
Then get as much information you can about it (what happens and how can the bug be reproduced).
And finally write to me all the info you got, and I will try to fix it.
See feedback section below to know how to contact me.


Feedback



How can I contact you?

     You can contact me at this email address:

yayo75katamailcom
.@.

     Note: As you can see you cannot click this address to open your mail client, and if you select it trying to get a copy in your clipboard you will get an invalid address.
It is written in this way to prevent spammers bot/spider/crawler software finding it and recognize it as a valid email address.
The only way to use it is to copy it by hand.

     In case this measure doesn't display you my actual address due to possible browser troubles, here is another attempt to show you my address, to be sure you get it.

     Sometimes people turn off the picture display feature of their browser, to speed up page loading. If you're viewing this page with pictures, this table with mixed text and pictures shows you my actual address (it will be perfectly displayed with windows verdana font).

yyo.75@ktmil.com


     Please remember to place on the subject of your email something like [TRASHY] or [about TRASHY], with square brackets too, to help me quickly find your mail in the load of usual spam.

     Also remember to write to me only in the English or Italian language.


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)