-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Yard Tags into a template (#20)
Yard object have tags linked to them https://rubydoc.info/gems/yard/file/docs/TagsArch.md These tags contain a lot of useful information - returned type, accepted attributes, deprecation notices, links to more documentation and etc. It's a pity that yard-markdown doesn't include that information, this is a PR that resolves that. I'm going through all possible tags that CodeObject has associated and adding them to output. ## Technical part I added `example_yard.rb` file that we can use to generate yard example, that has these yard tags. `example.rb` go renamed to `example_rdoc.rb` to align with this naming. --------- Co-authored-by: Stanislav (Stas) Katkov <github@skatkov.com>
- Loading branch information
Showing
13 changed files
with
343 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
yard-markdown (0.3.6) | ||
yard-markdown (0.4) | ||
csv | ||
yard | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Module: Aquatic | ||
|
||
**Defined in:** example_yard.rb | ||
|
||
A mixin for aquatic creatures. | ||
|
||
# Public Instance Methods | ||
## swim() [](#method-i-swim) | ||
Swim in the water. | ||
|
||
**return** [void] | ||
|
||
|
||
# Constants | ||
## DEFAULT_SALMON_SPEED [](#constant-DEFAULT_SALMON_SPEED) | ||
|
||
|
||
## MAX_DEPTH [](#constant-MAX_DEPTH) | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Class: Fish | ||
**Inherits:** Object | ||
|
||
**Defined in:** example_yard.rb | ||
|
||
The base class for all fish. | ||
|
||
# Public Instance Methods | ||
## make_sound() [](#method-i-make_sound) | ||
Make a sound. | ||
|
||
**return** [void] | ||
**yield** [sound] The sound produced by the fish | ||
**yieldparam** [String] The actual sound | ||
## swim(direction, speed) [](#method-i-swim) | ||
Swim in a specific direction. | ||
|
||
Swimming is the most critical feature of fish. | ||
|
||
**param** [Symbol, String] The direction to swim | ||
**param** [Integer] The speed at which to swim | ||
**return** [Boolean] Whether the swim was successful | ||
|
||
**example** | ||
```ruby | ||
swim(:north, 30) | ||
``` | ||
|
||
# Constants | ||
## DEFAULT_SALMON_SPEED [](#constant-DEFAULT_SALMON_SPEED) | ||
|
||
|
||
## MAX_DEPTH [](#constant-MAX_DEPTH) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Class: Salmon | ||
**Inherits:** Fish | ||
|
||
**Includes:** Aquatic | ||
|
||
**Defined in:** example_yard.rb | ||
|
||
A salmon is an Aquatic Fish. | ||
|
||
## Features | ||
|
||
* **Fish** | ||
* make_sound | ||
* swim | ||
* **Aquatic** | ||
* swim (overridden) | ||
|
||
# Public Instance Methods | ||
## initialize(farmed, wild) [](#method-i-initialize) | ||
Creates a new salmon. | ||
|
||
**param** [Boolean] Whether the salmon is farmed | ||
**param** [Boolean] Whether the salmon is wild | ||
**return** [Salmon] a new instance of Salmon | ||
## make_sound() [](#method-i-make_sound) | ||
Salmon overrides generic implementation. | ||
|
||
**return** [void] | ||
**yield** [sound] The sound produced by the salmon | ||
**yieldparam** [String] The actual sound | ||
## sustainable?() [](#method-i-sustainable?) | ||
Checks if this salmon is sustainable. | ||
|
||
**return** [Boolean] Whether the salmon is sustainable | ||
## swim() [](#method-i-swim) | ||
Swim in the water. | ||
|
||
**return** [void] | ||
|
||
# Public Class Methods | ||
## wild_salmon() [](#method-c-wild_salmon) | ||
**return** [Array<Salmon>] List of all wild salmon | ||
|
||
# Attributes | ||
## farmed[RW] [](#attribute-i-farmed) | ||
|
||
**return** [Boolean] True for farmed salmon | ||
## wild[RW] [](#attribute-i-wild) | ||
|
||
**return** [Boolean] True for wild salmon | ||
|
||
# Constants | ||
## DEFAULT_SALMON_SPEED [](#constant-DEFAULT_SALMON_SPEED) | ||
|
||
|
||
## MAX_DEPTH [](#constant-MAX_DEPTH) | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
name,type,path | ||
Waterfowl,Module,Waterfowl.md | ||
Waterfowl#DEFAULT_DUCK_VELOCITY,Constant,Waterfowl.md#constant-DEFAULT_DUCK_VELOCITY | ||
Waterfowl#DEFAULT_SPEED,Constant,Waterfowl.md#constant-DEFAULT_SPEED | ||
Waterfowl.swim,Method,Waterfowl.md#method-i-swim | ||
Bird,Class,Bird.md | ||
Bird#DEFAULT_DUCK_VELOCITY,Constant,Bird.md#constant-DEFAULT_DUCK_VELOCITY | ||
Bird#DEFAULT_SPEED,Constant,Bird.md#constant-DEFAULT_SPEED | ||
Bird._fly_impl,Method,Bird.md#method-i-_fly_impl | ||
Bird.fly,Method,Bird.md#method-i-fly | ||
Bird.speak,Method,Bird.md#method-i-speak | ||
Duck,Class,Duck.md | ||
Duck#DEFAULT_DUCK_VELOCITY,Constant,Duck.md#constant-DEFAULT_DUCK_VELOCITY | ||
Duck#DEFAULT_SPEED,Constant,Duck.md#constant-DEFAULT_SPEED | ||
Duck.initialize,Method,Duck.md#method-i-initialize | ||
Duck.speak,Method,Duck.md#method-i-speak | ||
Duck.swim,Method,Duck.md#method-i-swim | ||
Duck.useful?,Method,Duck.md#method-i-useful? | ||
Duck.rubber_ducks,Method,Duck.md#method-c-rubber_ducks | ||
domestic,Attribute,Duck.md#attribute-i-domestic | ||
rubber,Attribute,Duck.md#attribute-i-rubber | ||
Aquatic,Module,Aquatic.md | ||
Aquatic.DEFAULT_SALMON_SPEED,Constant,Aquatic.md#constant-DEFAULT_SALMON_SPEED | ||
Aquatic.MAX_DEPTH,Constant,Aquatic.md#constant-MAX_DEPTH | ||
Aquatic.swim,Method,Aquatic.md#method-i-swim | ||
Fish,Class,Fish.md | ||
Fish.DEFAULT_SALMON_SPEED,Constant,Fish.md#constant-DEFAULT_SALMON_SPEED | ||
Fish.MAX_DEPTH,Constant,Fish.md#constant-MAX_DEPTH | ||
Fish.make_sound,Method,Fish.md#method-i-make_sound | ||
Fish.swim,Method,Fish.md#method-i-swim | ||
Salmon,Class,Salmon.md | ||
Salmon.DEFAULT_SALMON_SPEED,Constant,Salmon.md#constant-DEFAULT_SALMON_SPEED | ||
Salmon.MAX_DEPTH,Constant,Salmon.md#constant-MAX_DEPTH | ||
Salmon.initialize,Method,Salmon.md#method-i-initialize | ||
Salmon.make_sound,Method,Salmon.md#method-i-make_sound | ||
Salmon.sustainable?,Method,Salmon.md#method-i-sustainable? | ||
Salmon.swim,Method,Salmon.md#method-i-swim | ||
Salmon.wild_salmon,Method,Salmon.md#method-c-wild_salmon | ||
farmed,Attribute,Salmon.md#attribute-i-farmed | ||
wild,Attribute,Salmon.md#attribute-i-wild |
File renamed without changes.
Oops, something went wrong.