Skip to content
prusnak edited this page May 30, 2011 · 17 revisions

Syntax of ThingDoc is very similar to Javadoc. It also uses the same comment style. All comment lines starting with @keyword have special meaning (see below), the rest is considered as a thing description.

Typical ThingDoc block:

/**
 * Slides on the x-axis with extruder.
 * @id x-carriage
 * @name X carriage
 * @category Printed
 * @using 4 m3x10
 * @using 4 m3washer
 * @using 4 m3nut
 * @using 4 bushing
 */

Keywords

@id

  • sets the identifier for the thing
  • this keyword is mandatory
  • this is used in @using keyword for instance
 * @id x-carriage

@root

  • this thing is the root of the project
  • you cannot use @id for root object and you can have only one root object in the wholep project
 * @root

@name

  • sets the descriptive name of the thing
  • this keyword is mandatory
 * @name X carriage

@common

  • thing is so common it won't be shown in things reviews etc., but will be shown in BoM
 * @common

@assembled

  • thing is made up of other things, so it won't be shown in BOM
 * @assembled

@category

  • sets the category of the thing
  • it is used in BOM to split things into more sections
 * @category Printed

@type

  • sets the type of the thing
  • it is more detailed than category (e.g. RP, fastener, etc.)
 * @type Fastener

@step

  • contains assembly instructions for the thing
  • you can use this keyword more than once for one thing
  • it will produced the ordered list in HTML and TeX
  • each step can contain an image, just append [[image.jpg]] or [[image.png]] at the end of the line
 * @step Find bottle opener [[opener.jpg]]
 * @step Open beer bottle
 * @step Pour into a glass [[beerglass.jpg]]
 * @step Enjoy beer

@since

  • since when does the thing exist (can be YYYY-MM-DD or some tag, e.g. "Mendel")
 * @since 2010-05-27

@comment

  • can contain various comments
  • can be used more than once
 * @comment this one should be made thicker

@image

  • thing image (filename with extension)
  • if this tag is not provided, ThingDoc will try to check whether the file IMAGEDIR/<id>.{jpg,png} exists and if it does, it will use it (<id> stands for thing id provided using the @id tag)
 * @image pulley.png

@using

  • sets the dependency between things
  • accept two parameters, first is the count, second is other item id
  • if the first parameter is ommited then it defaults to one
  • can be used more than once for one thing
 * @using m8spring
 * @using 2 m8nut

@price

  • price of the part in dollars (experimental)
 * @price 1.49

@weight

  • weight of the part in grams (experimental)
 * @weight 150

@time

  • how long does it take to assemble the part (in minutes)
  • suppose that dependencies are already done done
 * @time 10

Clone this wiki locally