Giter Club home page Giter Club logo

yard-tomdoc's Introduction

YARD TomDoc

Website / Documentation / Issues / Source Code

Gem Version Build Status     Flattr Me

Description

Implements TomDoc syntax for YARD. 'Nuff said.

Instruction

Since yard-tomdoc is a standard YARD plugin, utilize it with yard's --plugin option.

$ yard --plugin tomdoc [...]

Limitations

Before you use yard-tomdoc you should read Loren Segal's blog post about the differences between YARD and TomDoc syntax. But note that the YARD TomDoc plugin now supports a superset of TomDoc's syntax which provides additional YARD functionality via cap-tags. For example using Author: James Deam in the documentation is equivalent to using @author James Dean in regular YARD syntax. Support is limited, but it opens up much more of YARD's goodness to TomDoc users then Loren's blog post suggests.

Acknowledgements

Huge thanks to Loren Segal, the creator of YARD and the original author of this plugin. Without his patient assistance and coding genius, this library would not have been possible.

Licensing

YARD TomDoc is copyrighted open-source software.

Copyright (c) 2010 Rubyworks. All rights reserved.

YARD TomDoc can be modified and redistributed in accordance with the terms of the MIT licsnse.

See the LICENSE.txt file for details.

yard-tomdoc's People

Contributors

trans avatar lsegal avatar rogerleite avatar jonasoberschweiber avatar splattael avatar

Stargazers

Daniel Petelin avatar zouyu1026 avatar Angus H. avatar Misha Merkushin avatar Jordan Running avatar Andrei Beliankou avatar Steve Hill avatar Matthew Burket avatar Maximilian Haack avatar Phil Cohen avatar Lalit Shandilya avatar  avatar  avatar Vojtěch Kusý avatar Chris Mytton avatar Benedikt Deicke avatar Damon River avatar Carl Brasic avatar Ben Stolovitz avatar Anthony Bouch avatar Volkan Unsal avatar Jordan Sissel avatar Ezekiel Templin avatar Wong Liang Zan avatar Jesse Storimer avatar Sebi B. avatar Damien Wilson avatar  avatar Andrey D. Viana avatar Daniel Schierbeck avatar  avatar

Watchers

 avatar Nihad Abbasov avatar James Cloos avatar  avatar

yard-tomdoc's Issues

Spacing issues when using "Example"

It seems that newlines are removed and spaces are messed up.

Code:

# Example
#
#   class Child
#     extend AccountInheritance
#
#     belongs_to :parent
#
#     inherits_account_from :parent
#   end

Result:

Parse "Returns nothing."

Need to have it recognize Returns nothing and pass that on correctly to YARD. Right now YARD reports Object as the return type.

Multiple paragraphs in description ignored

It seems that yard-tomdoc parses only the first line of description and ignores params if description contains more than 1 paragraph:

  # Public: Some method.
  #
  # This is a longer description.
  #
  # id - The Integer id of tne campaign.
  #
  # Examples
  #
  #   puts "Hello world"
  #
  # Returns nothing

And the result is:

Add signature support

TomDoc recently add the signatures feature. So yard-tomdoc needs to add support for that,.

Description ´Internal:´ indicator yeilds errors

When running the yard script all my methods having the Internal: indicator in the description yields this error:

[error]: Unhandled exception in YARD::Handlers::Ruby::MethodHandler

Using:

* yard (0.7.5)
* yard-tomdoc (0.4.0 f3e9e3d)

Unabled to get yard-tomdoc working

Hi, I am trying to get this gem working, but I have no luck.

  • This is in my example.rb file:
    class Example
      # Public: Duplicate some text an arbitrary number of times.
      #
      # text  - The String to be duplicated.
      # count - The Integer number of times to duplicate the text.
      #
      # Examples
      #
      #   multiplex('Tom', 4)
      #   # => 'TomTomTomTom'
      #
      # Returns the duplicated String.
      def multiplex(text, count)
        text * count
      end
    end
  • I have yard (0.8.2.1) and yard-tomdoc gems installed. Then I run yard --debug --plugin yard-tomdoc example.rb and the result is
[debug]: Parsing ["example.rb"] with `ruby` parser
[debug]: Parsing example.rb
[debug]: Serializing to .yardoc/objects/root.dat
[debug]: Re-generating object ...
[debug]: Re-generating object Example...
[debug]: Generating asset js/jquery.js
[debug]: Serializing to doc/js/jquery.js
[debug]: Generating asset js/app.js
[debug]: Serializing to doc/js/app.js
[debug]: Generating asset js/full_list.js
[debug]: Serializing to doc/js/full_list.js
[debug]: Generating asset css/style.css
[debug]: Serializing to doc/css/style.css
[debug]: Generating asset css/common.css
[debug]: Serializing to doc/css/common.css
[debug]: Generating asset css/full_list.css
[debug]: Serializing to doc/css/full_list.css
[debug]: Generating asset class_list.html
[debug]: Serializing to doc/class_list.html
[debug]: Generating asset method_list.html
[debug]: Serializing to doc/method_list.html
[debug]: Generating asset file_list.html
[debug]: Serializing to doc/file_list.html
[debug]: Generating asset frames.html
[debug]: Serializing to doc/frames.html
[debug]: Serializing to doc/_index.html
[debug]: Serializing to doc/index.html
[debug]: Serializing to doc/file.README.html
[debug]: Serializing to doc/top-level-namespace.html
[debug]: Serializing to doc/Example.html
Files:           1
Modules:         0 (    0 undocumented)
Classes:         1 (    1 undocumented)
Constants:       0 (    0 undocumented)
Methods:         1 (    0 undocumented)
 50.00% documented
  • Generated example.html looks like this:
  • I think it's ignoring Parameters and Returns.

How can I document methods defined by macros in Rails?

Not sure where the best place is to ask this question—apologies if using an Issue was inappropriate.

Is it possible for me to document methods defined by macros in TomDoc. For example, Rails's delegate method.

class Person < ActiveRecord::Base

  ##
  # The project this person is associated with
  # Returns a Project
  belongs_to :project

  ##
  # The name of the {Project} this person is associated with.
  #
  # Returns a String
  delegate :name, to: :project, prefix: true

end

If I do the above, the documentation incorrectly reports the delegated method name as simply name, without the project_ prefix.

Is there another way?

Return type for description only docs

If a doc has nothing but a description, or more specifically, if it has no Returns specified, then see if there is a [Foo] notation tacked on to the end of the description, and use that. This would be very helpul for attributes, e.g.

# The files to use.  [Array<String>]
attr :files

Description ´Internal:´ indicator yeilds errors

When running the yard script all my methods having the Internal: indicator in the description yields this error:

[error]: Unhandled exception in YARD::Handlers::Ruby::MethodHandler

Using:

* yard (0.7.5)
* yard-tomdoc (0.4.0 f3e9e3d)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.