The complete sourcecode to PerlNights.com, including all site assets, will be available shortly in the "Castle Blueprints" section. (gosh a self-replicating castle... whatever next?)

In the table below, input refers to information either loaded from disc, retrieved from a db, created by a plugin, or entered through the query data by an end user.

Output refers to the final produced output at end of processing.

In between these two there is usually no need to consider these specials at all as they are all automatically dealt with by the system, so unless your doing something very bizarre your not likely to ever see them or need to know what they are about.

Having said that for the sake of absolute completeness the special symbols work as follows;

Input Output
&lab; <
&rab; >
&lcb; (
&rcb; )
&lsb; [
&rsb; ]
<special>lab</special> &lab;
<special>lcb</special> &lcb;
<special>lsb<special> &lsb;
<special>rab<special> &rab;
<special>rcb</special> &rcb;
<special>rsb</special> &rsb;
&lab;special&rab; <special>
&lab;/special&rab; </special>

Note: if you want to use a tag other than "special" to instruct the parser to insert a special char, perhaps in the case where your using an XML file containing tags of the same name, provision has been made to rename the special tag by changing a value in the Conf.pm file.

It's also possible in theory, that since the end programmer is not expected to know or care about these symbols for the vast majority of their tasks, that the system could be automated such that input is scanned for the existence of <special> tags and automatically shift to using a different delimiter, for instance <special1>. I'm not sure if that would be overkill, there is such a thing as a sledgehammer and a nut.

In the case where you wish to output aXML code such as <db_mask> then you have the choice to either use &lab;/&rab; or &lt;/&gt;, either will work, and which you use depends on whether you want the literal output, or output is to be encoded for display in a browser. (the latter being I suspect the far more common requirement.

The following aXML file was used to test the round trip completeness for the parser code:

Listing of actions/test/body.aXML --------------------------------- <html> <head></head> <body> (displayqd)input(/displayqd) <hr> <buildform action="test" method="POST"> <input type="submit" value="Make it so!"><br/> <textarea name="input" rows="80" cols="80" >(textareaqd)input(/textareaqd)</textarea> </buildform> <br/><br/><br/> </body> </html>

As you can see, no mention of any specials is required at the document level, as they are all handled automatically at the parser/plugin level. The above code run with the standard set, can take the parser as input in the text area, and correctly displays it above, and encodes it in the input area for another go around the circle if you click submit again. Sending it around the circle multiple times has no detrimental effect; the output remains identical to the input.

Modifying the above like this :

<html> <head></head> <body> (highlightcode)(displayqd)input(/displayqd)(/highlightcode) <hr> <buildform action="test" method="POST"> <input type="submit" value="Make it so!"><br/> <textarea name="input" rows="80" cols="80" >(textareaqd)input(/textareaqd)</textarea> </buildform> <br/><br/><br/> </body> </html>

Causes fragments of perl wrapped in <code> tags to be highlighted in a similar fashion to the "nano" text editor, and fragments of aXML wrapped in <aXML> tags to be highlighted in a similar vein.

The highlighting is done with <span> tags and can then be styled using CSS. PerlNights currently has two colour-schemes, midnight (light-text on darkblue bg) and daytime (dark text on white bg), and more might be added later.

P.s, if you want a sneak peak at the PerlNights code before I'm finished writing it, you can drop me an email and I will bundle you over a ZIP or tar.gz file, I'm sure you know my address, either that or you can just wait till I'm done and PerlNights is operational, won't be too long!


In reply to Re^2: Thanks to Ikegami, Chromatic & Corion by Logicus
in thread Thanks to Ikegami, Chromatic & Corion by Logicus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.