August 14, 2007
UKB Post Formats (v2)
DRAFT
Limits and recommendations apply to the Users’ Knowledge Base (UKB) formats, to maintain a consistent appearance across the site. This article provides a brief overview on related topics (for further information and specific examples refer to the posts within the Contributors category: AmiBroker Users’ Knowledge Base » Contributors )
TEXT FORMATTING
‘Pages’ are generated from CSS stylesheets that have been customized, for the UKB site, by the administrator. The stylesheets act as a default, and filter, for the site. As a rule of thumb, text formatting is limited to the basics: upper and lower case, size, bold, italics, underline, strikethrough, ordered lists, unordered lists, alignment and block quotes. Outlining, embossing, engraving, shadows etc are not recommended.
IMAGES
Please include images, as much as possible, to illustrate the point. It is recommended that they should be limited to ‘plain’ images. Where a border is used it should be a simple line style. Avoid using shadow, 3D or torn edge borders etc.
CODE
HTML code is limited to affecting what comprises the ‘body’ of a post. All other elements of the ‘page’ are set by default.
POST FORMATS
Contributions can be made by posting (HTML) or by attaching Portable Document Files (PDF) or Word documents to a post. The order of precedence is HTML, PDF then Word. HTML posts are inline for searching and printing. Attached documents are not in line for searching (they will not be searched by the UKB engine) and they can only be printed individually.
The pros and cons of post formats:
- - Web-pages (HTML) are a universal format, and accessible to all visitors to the site.
- - PDF documents are the accepted universal standard for portable documents and printing.
- - Word documents have a high level of accessibility and they can be used where PDF creation is not available to the author.
AUXILIARY FILES
Authors are encouraged to attach auxiliary files to posts to facilitate the exchange of information, especially in popular formats, or in a format that is specific to AmiBroker e.g. spreadsheets, AFL files (.afl), ticker lists (.tls) etc
FORMULAS
Formulas can be presented in posts in two ways; as plain text or as a formula table. Both formats are clear, familiar and allow readers to copy and paste the formula back into the Formula Editor.
Plain Text
To insert an AFL formula into a post, copy it from the Formula Editor and paste in into the publishing editor as plain text.
/*P_BarsInYear*/
InYearFlag = IIf(DateNum() >= 1060101 AND DateNum() <= 1061231,1,0);
InYear = Cum(InYearFlag);
Plot(InYear,”BarsInYear”,2,2|4);
// Logic.
// line 3 returns one if a bar is within the calendar range, or zero if not, and assigns it to the InYearFlag variable;
// line 4 cumulates the ones from line 3 and assigns the result to InYear;
// line 5 plots the cumulated result in a chart;
Formula Tables
Formula tables are a custom UKB format. They prevent conflict between AFL code and the HTML used to generate the ‘page’. They also present the formula with line numbers, for reference, and syntax highlighting.
To insert an AFL formula into a post, as a custom table, copy it from the Formula Editor and paste in into the publishing editor as plain text. Then surround the formula with AFL markers.
Note: To prevent this example from rendering as a custom table it was copied and inserted as an image (object). It is a replica of the ‘text’ that underlies Formula 1.
Formula 1
1 2 3 4 5 6 7 8 9 10 | /*P_BarsInYear*/ InYearFlag = IIf(DateNum() >= 1060101 AND DateNum() <= 1061231,1,0); InYear = Cum(InYearFlag); Plot(InYear,"BarsInYear",2,2|4); // Logic. // line 3 returns one if a bar is within the calendar range, or zero if not, and assigns it to the InYearFlag variable; // line 4 cumulates the ones from line 3 and assigns the result to InYear; // line 5 plots the cumulated result in a chart; |
Note: Exceptions will be encountered when inserting code into posts, depending on the editor used. Specific instructions and examples for a range of editors, can be found within the posts in the Contributors category: AmiBroker Users’ Knowledge Base » Contributors
CAPTIONS
For clarity, it is preferable to use captions when referencing figures (images), tables and formulas.
HYPERLINKS
Links to other sites, or pages within the UKB site, can be used as a means to extend the scope of a post.
WARNING: LINKS CAN BE BROKEN IF THE TARGETED WEBSITE CHANGES, OR CEASES TO FUNCTION. LINKS TO OTHER UKB POSTS WILL ALSO BE BROKEN, IF THE POST TITLE (FILENAME) IS CHANGED, OR IF THE POST DATE (TIMESTAMP) IS CHANGED. AUTHORS NEED TO MANUALLY MAINTAIN LINKS CONTAINED WITHIN THEIR POSTS.
PAGES
Authors, who plan on making substantial contributions, can apply for authority to create their own page that presents as a link in the sidebar. Pages allow authors to quarantine, customize and feature their presentation.
REVISIONS
At the time of writing the UKB does not have a policy on revisions. It is helpful, to readers, to track revisions in some way. Revisions can be noted by appending comments to posts. They can also be marked by notation within the post itself (an example of registering revisions at the bottom of a post has been provided by the author at: AmiBroker Users’ Knowledge Base » Introduction To Editing).
Revised versions can be ‘forced’ to list as a Recent Post by changing the timestamp (date of publication) and re-publishing the post. This also forces the new version into the RSS feedstream . It is recommended that authors reset the timestamp to the current day and re-publish after making significant revisions. This will alert readers to the fact that new material has been introduced to the post.
WARNING: POSTS ARE STORED ON THE SERVER ON A MONTHLY BASIS. RESETTING THE TIMESTAMP WILL ‘BREAK’ ANY EXISTING UKB LINKS TO A POST IF IT IS ‘MOVED’ TO ANOTHER MONTH. IN THIS SITUATION THE LINKS NEED TO BE MANUALLY RENEWED BY THE AUTHOR.
Another way to highlight revisions is to add a version number to the title e.g. UKB Post Formats (v2) etc. This will display clearly in the Table Of Contents if a post has undergone a revision.
WARNING: CHANGING A POST’S TITLE WILL ALSO BREAK ANY LINKS, THAT EXIST TO IT, IN OTHER POSTS
ORDERING POSTS
The order of posts, as they appear in the Table Of Contents, can be set using a custom Page Order property. In all other places the posts are ordered by the published date.
SPECIFICATIONS
At the time of writing the UKB does not have a policy on declaring software specs. It is helpful, to readers, to indicate what software, or version, was used to produce the examples included in posts, or the files attached to posts e.g. if an attached file was produced in a different version of Word, compared to what the reader has installed on their machine, then it will help them to access the file if they know that in advance.
SITE INTERACTIVITY
Please set post defaults to allow comments and pings.
At the time of writing, the UKB does not have a policy on track backs or keywords.
A resources page to provide links to affiliate sites is planned.
RSS FEEDS
The UKB is RSS enabled for distribution to readers who are subscribed. Posts become part of the feedstream according to their date of publication.
Note: Posts do not always view the same in RSS Feed Readers as they do at the site itself e.g. using I.E. v7 as the ‘reader’ custom formula tables are truncated to a ‘text’ format and larger images are cut off at the right hand side, to fit into the web-page as it is viewed (if the Favorites Center is open the ‘page’ width will be less than full-screen).
SUPPORT
For additional information, or guidance, on UKB formatting please direct your queries to support [at] amibroker.com or (the editor) psytek [at] magma.ca
- Version 1 – Aug14/2007 – by Brian_z - written using Windows Live Writer beta 2
- Version 2 – Aug14/2007 – by Brian_z - extended comments on Revisions and added a section on RSS Feeds
Filed by brian_z at 5:54 am under Contributors

