#2118 Type and Slot Meta-Data

SlimerDude Tue 26 Mar 2013

Both sys::Type.doc and sys::Slot.doc say:

If there is additional documentation meta-data available it is included an the start of the string as a series of "@name=value" lines.

How do you declare this meta-data in the Fandoc comment?

(I can't find it in the docs. Though I'm sure I've seen it mentioned and it's something to do with :'s)

Are there any common Fantom conventions for this meta-data, such as Since or See and if so, are they case-sensitive?

Is there a sample doc page on this site that shows how the meta-data is displayed?

brian Tue 26 Mar 2013

Actually that format is obselete, it just returns the raw fandoc string.

The way api docs are packaged into a pod got completely reworked when I built the new compilerDoc module. The new format is a more complex plain text format (from compilerDoc::ApiDocParser)

** The syntax is defined as:
**   <file>      :=  <class> <slot>*
**   <class>     :=  "== " <name> <nl> <attrs>
**   <slot>      :=  (<fieldSig> | <methodSig>) <attrs>
**   <fieldSig>  :=  "-- " <name> <sp> <type> [":=" <expr>] <nl>
**   <methodSig> :=  "-- " <name> "(" <nl> [<param> <nl>]* ")" <sp> <return> <nl>
**   <param>     :=  <name> <type> [":=" <expr>]
**   <return>    :=  <type>
**
**   <attrs>     :=  <meta>* <facet>* <nl> <doc>.
**   <meta>      :=  <name> "=" <expr> <nl>
**   <facet>     :=  "@" <type> ["{" <nl> [<name> "=" <expr> <nl>]* "}"] <nl>
**   <doc>       :=  lines of text until "-- "
**
**   <name>      :=  Fantom identifier
**   <type>      :=  Fantom type signature (no spaces allowed)
**   <expr>      :=  text until end of line
**   <nl>        :=  "\n"
**   <sp>        :=  " "
**
** Standard attributes:
**   - base: list of space separated base class type signatures
**   - mixins: list of space separated mixin type signatures
**   - loc: <file> ":" <line> "/" <docLine>
**   - flags: type or slot space separated flag keywords
**   - set: field setter flags
**
** Note that the grammar is defined such that expr to display
** in docs for field and parameter defaults is always positioned at
** the end of the line (avoiding nasty escaping problems).

SlimerDude Tue 26 Mar 2013

Okay, so looking at the code ApiDocParser it seems there is no custom @javadoc style meta-data. The only <attrs> parsed are few, very specific compiler ones like loc, mixins & facets.

In light of that, may I suggest the Fandoc for both Type and Slot are updated to just say:

Return the raw fandoc for this slot or null if not available.

The only thing worse than no documentation is wrong documentation!

brian Tue 26 Mar 2013

Yes the attrs are compiler driven. I already updated the docs.

SlimerDude Tue 26 Mar 2013

Ah, that's were I saw the other ref to meta-data: fandoc::index#header - is this meta also obsolete?

brian Tue 26 Mar 2013

No that is still used (but only in stand alone documentation chapters)

Login or Signup to reply.