Skip to content

Commit d5ea277

Browse files
committed
Merge branch 'master' of github.com:goby-lang/api.doc
2 parents cd28033 + ec49023 commit d5ea277

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

README.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -33,61 +33,4 @@ After that, commit and push them for update. GitHub will handle the rest.
3333

3434
## Documenting Goby Code
3535

36-
We use Markdown to document. All markdown syntax are supported.
37-
38-
### Documenting Classes
39-
40-
All classes can be found in `/vm` directory. Each class is represented by a file. For example, you can find `Integer` class in `integer.go` file.
41-
42-
The class definition can be found with the `type` named as the filename or suffixed with "Object". The documentation for this class is right above this `type`. For example, `Integer` class is documented as:
43-
44-
```go
45-
// Integer represents number objects which can bring into mathematical calculations.
46-
//
47-
// ```
48-
// 1 + 1 # => 2
49-
// 2 * 2 # => 4
50-
// ```
51-
type IntegerObject struct {
52-
Class *RInteger
53-
Value int
54-
}
55-
```
56-
57-
### Documenting Methods
58-
59-
Methods of a class are stored in an array, with its name prefixed with `builtin` and suffixed with `Methods`. For example, the name for `Integer` class is `builtinIntegerMethods`.
60-
61-
Each method comes with two keys, `Fn` and `Name`. The document of a method comes right above `Name`. For example:
62-
63-
```go
64-
var builtinIntegerMethods = []*BuiltInMethod{
65-
{
66-
// Returns the sum of self and another Integer.
67-
//
68-
// ```
69-
// 1 + 1
70-
// ```
71-
Name: "+",
72-
Fn: func(receiver Object) builtinMethodBody {
73-
// ...
74-
},
75-
},
76-
}
77-
```
78-
79-
Remember to leave one space after `//`.
80-
81-
### Others
82-
83-
Currently the documentation only supports `//` comments, not `/* */`. The following style will not be parsed:
84-
85-
```go
86-
/*
87-
Integer represents number objects which can bring into mathematical calculations.
88-
*/
89-
type IntegerObject struct {
90-
Class *RInteger
91-
Value int
92-
}
93-
```
36+
Go to [Goby wiki](https://github.com/goby-lang/goby/wiki/Documenting-Goby-Code).

0 commit comments

Comments
 (0)