Graphical Shells (Sometimes called "OS"es) are rather common in ComputerCraft. However, the way that they store important metadata such as the program's name, description, and icons, differs per-shell. I propose a simple, optional, standard for this metadata. This standard would be implemented by the shells. The format is detailed below:
The metadata is stored in comments tacked onto the top of the file of the form:
-- @MetaName: Meta Value
For example:
-- @Name: My Awesome Program
-- @Description: Way too awesome for anybody else to have made.
-- @Icon[4]: /path/to/icon-4x4
-- @Icon[4x3]: /path/to/icon-4x3
-- @Author: Amanda Cameron
-- @Usage: awesome-program
print("My Program Rocks!") -- Announce our awesome-ness
To start with, I'd propose the following meta values:- Author – Human-readable name of the maker os the program
- Name – Human-readable name of the program.
- Description – Human-readable description of the program.
- Icon[font] – Location of an size icon for this program. Format should be npaintpro or vanilla CC's paint program's format. The size can be in the format of width x height or, if you don't provide any height it will assume the icon to be square.[/font]
- Usage – Allows for usage information for non-graphical shells.
- Version – Version number of the program, in any format you wish.
Notes on icons
Icons are by definition going to be differently sized for every shell. To compensate for this, they can be given in multiple sizes. I'd propose that shells should follow this pattern to determine what one to use: If there's an exact match, use that. (Of course) – Otherwise, you should use the biggest one that's not larger than the size you need, and center it. This allows the icon to show the best details for app creater's wishes.
Usage Attribute
The Usage Attribute is used for allowing people to specify hints for non-graphical shells as to the usage of the program, potentially also working out auto-completion details. This can be specified multiple times, for example:
-- @Name: Chat
-- @Description: Dan200's Chat Program.
-- @Author: Dan200
-- @Usage: chat host <name>
-- @Usage: chat join <name> <nick>
Repeated Entries
While the Icon and Usage entry can be repeated, I'd propose that the Author elements can also be repeated, in the case of multiple creators. Another idea I had was a comma-seperated Authors field, for example:
-- @Author: Awesome Coder
-- @Author: Amanda Cameron
-- @Description: Does things, picked up from Awesome Coder when he abandoned it.
-- @Name: Thing-y-thing.
print("Hello World.")
Fin.
Comments are welcome, both on the format, as well as additional data to included in the spec.
Change Log
- 2014-05-26
- Change the Icon command to use a width x height optional value, for non-square icons.
- Add the Usage attribute.
- 2014-05-12 Initial public release.