Skip to content

DescribeGrammar decorators

Viktor Chernev edited this page Nov 11, 2024 · 10 revisions

Decorators are basically some text enclosed in curly brackets - { and }. Decorators are used to add different kinds of data to items - whether it is additional text or an instruction to change the color or the style of the item or even more . Decorators can either be simple ones, consisting of just a key, or complex ones, consisting of a key and a value, delimited by a pipe symbol |. (Decorators can even be ternary ones consisting of a name, key and value, again delimited by a pipe symbol, although those have not been implemented yet).

A list of decorators and instructions for their use follows. However, in the Describe language grammar, a decorator is just some text in curly brackets. What a particular decorator will do is implemented per translator, and if users are developing their own translators, they are free to implement their own decorators.

  • empty {empty}
    The empty entry decorator is a simple decorator used to create empty entries. Those empty entries essentially act as new lines in lists. This decorator cannot be applied on an item that is a head of a production.

  • comment {comment}
    The comment decorator is a simple decorator used to make an entry green and italicized.

  • nlcomment {nlcomment}
    The nlcomment decorator is the same as the comment decorator, but adds an empty entry before the decorated entry, if the decorated entry is not the first in the list.

  • color {color|VALUE}
    The color decorator is a complex one, and is used for setting the fore-color of the text of the item it is applied to. VALUE is any CSS compatible color - either in the hex notation #1234AA or a named color like limegreen.

  • bgcolor {bgcolor|VALUE}
    The bgcolor decorator is a complex one, and is used for setting the back-color of the text of the item it is applied to. VALUE is any CSS compatible color - either in the hex notation #1234AA or a named color like limegreen.

  • bold {bold}
    The bold decorator is a simple decorator used to make an entry bold.

  • italic {italic}
    The italic decorator is a simple decorator used to make an entry italicized.

  • underline {underline}
    The underline decorator is a simple decorator used to make an entry underlined.

  • striked {striked}
    The striked decorator is a simple decorator used to add the strike-through CSS effect to an entry.

  • sensitive {sensitive}
    Entries can be marked as sensitive and productions can as well. When marked as such, nothing happens until we use the cmd switch censor. If we do, marked entries are obscured with '?' instead. That is, if the translator supports the feature. Our inbuilt HTML translators do.

  • secret {secret}
    Entries can be marked as secret and productions can as well. When marked as such, nothing happens until we use the cmd switch censor. If we do, marked entries are replaced with random number of black squares. That is, if the translator supports the feature. Our inbuilt HTML translators do.

  • hidden {hidden}
    Entries can be marked as hidden and productions can as well. When marked as such, nothing happens until we use the cmd switch censor. If we do, marked entries are replaced with random gibberish text. That is, if the translator supports the feature. Our inbuilt HTML translators do.


Using decorators:
decorators 1

Using decorators (added comments):
decorators 2

Links

Next
Prev

Clone this wiki locally