-
Notifications
You must be signed in to change notification settings - Fork 441
Adding YARD document support to RDoc #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@st0012 Sorry. I forgot to confirm whether YARD style tag feature should be orthogonal to markups such as RDoc format and Markdown or not. If YARD style tag feature is orthogonal to markups, we may implement it in (I'm not familiar with RDoc code base yet but I feel that YARD style tag feature is orthogonal to markups. It seems that YARD also uses orthogonal approach.) @okuramasafumi How about using check list markup for the * [ ] Adding support of YARD tags that already works with current RDoc such as `@yield` and `@private`
* [ ] Adding support of YARD tags that needs simple modification of RDoc such `@deprecated`
* [ ] Adding features such as type support to utilize information from YARD
* [ ] Adding support of YARD directives and macros |
@kou At first I thought I can use sub-issues feature, but I couldn't. So I agree, I'll converted them into a list. |
@st0012 This is a friendly ping about the approach to implement YARD parsing, whether we should implement is as a standalone documentation format or as a tag support along other formats such as rdoc format. I'd love to hear opinion. |
I'll give it a look this weekend, sorry |
I'd like to give my perspective on this one. I see YARD comments falling into two categories: directives (or "attributes") and type annotations. DirectivesThese are all of the things that are not related to types, like For example, the Ruby LSP will be able to index that information and then we can show that a method is deprecated or private in the editor. We can also allow go to definition if the new substitute method is link to. Something like this class Foo
# @deprecated because of a, b and c. Use {Foo#baz} instead
# ^ going to definition here can take you to baz
def bar; end
def baz; end
end Type annotationsFor the So I wonder if we shouldn't instead standardize that type annotations must be made using RBS. While I understand that a lot of projects are already annotated with YARD, making this move towards standardizing the type annotations will help the entire tooling ecosystem to have guarantees about indexing type information. They can all speak a single language - the frontend of annotations is the same. So I would vote that RDoc should lead the way and standardize like this: class Foo
# @deprecated because of a, b and c. Use {Foo#baz} instead
#: (Integer) -> String
def foo(a); end
#: (Integer, String) -> String
def baz(a, b); end
# @private
#: -> void
def bar; end
end Finally, if people agree with this direction, then I think all markups should support these features. |
@soutaro Do you have any opinion for the type annotation parts in #1344 (comment) ? |
Background
I implemented a plugin system for RDoc in #1321 and YARD parsing plugin is implemented.
In the discussion with @st0012, @kou and @vinistock we decided that we should implement YARD parsing feature as a standalone feature without plugin.
The note exists in #1257 (comment)
Steps
There are some steps to have effective YARD parsing feature in RDoc.
RDoc::Yard
class or similar)@yield
and@private
@yield
@private
@deprecated
:deprecated
directive@deprecated
@return
@param
@!attribute
I will implement these step by step.
Note
The idea of plugin system is not completely abandoned but postponed.
The text was updated successfully, but these errors were encountered: