https://github.com/rubyworks/yard-bird
Custom YARD Documentation
https://github.com/rubyworks/yard-bird
Last synced: 6 months ago
JSON representation
Custom YARD Documentation
- Host: GitHub
- URL: https://github.com/rubyworks/yard-bird
- Owner: rubyworks
- Created: 2011-05-14T17:05:25.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-11-12T04:48:52.000Z (over 14 years ago)
- Last Synced: 2024-04-30T10:19:57.012Z (almost 2 years ago)
- Language: Ruby
- Homepage: http://rubyworks.github.com/yard-bird
- Size: 287 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rdoc
- Changelog: HISTORY.rdoc
Awesome Lists containing this project
README
= Yard Bird
"Sing sweet documentation in my ear."
== Description
Yardbird is a YARD plugin that allows you, the developer, to customize your
documentation parsing system.
== Resources
* {Homepage}[http://rubyworks.github.com]
* {Source Code}[http://github.com/rubyworks]
* {Mainling List}[http://groups.google.com/group/rubyworks-mailinglist]
* {
}[http://travis-ci.org/rubyworks/yard-bird]
== Check It Out
Sound like a chore? Until you see it allows you do this:
# .yard/example.bird
When /^Returns\s+(.*?)$/ do |matchdata, comment|
create_tag(:return, matchdata[1])
end
Now, whenever your documentation starts with 'Returns ', the
remainder of the line will be added to YARD as a :return tag.
Now we can get even crazier a create a simplified implementation of {Tomdoc}[http://tomdoc].
require 'tomdoc/tomdoc'
When /\A.*?\Z/m do |matchdata, comment|
tomdoc = TomDoc::TomDoc.new(comment)
tomdoc.examples.each {|ex| create_tag(:example, "\n" + ex) }
tomdoc.args.each {|arg| create_tag(:param, "#{arg.name} #{arg.description}") }
tomdoc.raises.each {|r| create_tag(:raise, r.sub(/\ARaises\s+/, '')) }
tomdoc.returns.each {|r| create_tag(:return, r.sub(/\AReturns\s+/, '')) }
tomdoc.description
end
Now it's your turn. You have the _power_*, Yard Bird will singe _Your_ song.
And YARD will happily spit it out all pretty.
== License
(MIT License)
Copyright (c) 2011 Rubyworks
See NOTICE.rdoc file for more details.