Project

yard-bird

0.0
No commit activity in last 3 years
No release in over 3 years
Yardbird is a YARD plugin that allows you, the developer, to write documentation Your Way. Do you like TomDoc, but wish it were just a tad bit different? You can fix that. Have some radical idea for using ASCII table in your docs? You can do that too.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 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¶ ↑

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.

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 © 2011 Rubyworks

See NOTICE.rdoc file for more details.