Skip to content
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

Model#active_entities Should have Linked Return Type #23

Closed
jimfoltz opened this issue Dec 11, 2016 · 12 comments
Closed

Model#active_entities Should have Linked Return Type #23

jimfoltz opened this issue Dec 11, 2016 · 12 comments
Labels

Comments

@jimfoltz
Copy link

The Return type of the Model#active_entities method should link to the Sketchup::Entities docs.

This is true for many of the methods thoughout the site.

@thomthom
Copy link
Member

Yes, a lot of methods is missing type info not only for return values but also param types. The reason for this is that with 1000+ methods it actually takes a long time to go through each and every one. We decided to launch as-is and incrementally correct this. Since we launched the new docs I've often made some sweeping corrections when fixing typos etc.

@thomthom thomthom added the bug label Dec 12, 2016
@jimfoltz
Copy link
Author

I understand the amount of work it is. I wish there was a way we could make pull requests to help spread out the workload.

@thomthom
Copy link
Member

I've been toying with YARD, learning more about it.

One thought I wanted to explore was if I could manage to write a tool that could take a Git diff (Pull Request) with changes made to the Ruby API stubs and place the comment back to it's original position in our CPP source. Not sure how feasible it is.

Another alternative we could try out in the short run; accept PR in the stubs repo, where we then copy+pasted the comment back our our CPP code manually. Making a script that convert the Ruby comment to CPP style comment would be trivial. Even that could be off loading some of this work for us - as we'd spend less time formatting. I have yet to fully test running YARD on the stubs though.

Some how I really want to figure out a system where user-improvements to the API docs can be near-automated.

Right now I have started using the stubs with RubyMine and I'm catching some mistakes like that - when I see it flagging a warning for a method that I know is correct.

@jimfoltz
Copy link
Author

Can yard generate the docs from just the comments, or does it need to eval the Ruby source (stubs in this case) in order to build them?

@thomthom
Copy link
Member

It doesn't eval any Ruby code, but it naively parse Ruby and C/C++ code to build it's database.
So it would need the stubs for the method signature.

In some cases it can pick up RDoc declarations, but I wasn't always able to rely on that. For instance in parsing our C++ code I had to add some dummy code that was #ifdef'ed out for the compiler - just so that YARD could process it. For instance the Tool class - which isn't actually a class we define. It's just a meta-class.

@jimfoltz
Copy link
Author

Discussion continued here:

http://forums.sketchup.com/t/ruby-api-docs-contributing/35656

@DanRathbun
Copy link

DanRathbun commented Dec 13, 2016

Can yard generate the docs from just the comments, or does it need to eval the Ruby source (stubs in this case) in order to build them?

Yes, YARD can generate method documentation from directive comments only (without stubs.)

See the directives in the YARD documentation:

(I echoed this to the forum discussion thread.)

@thomthom
Copy link
Member

The method now document the return type.

@DanRathbun
Copy link

Just a note, that overhauling return types should be created as sub-project of the stubs repo.

@thomthom
Copy link
Member

Yea, we'll have to organize the issues better when we have finally settled on the structure of this repos.

@jimfoltz
Copy link
Author

jimfoltz commented Jan 29, 2017

Just a note, that overhauling return types should be created as sub-project of the stubs repo.

How would this be setup? Entering correct retun types is a primary enhancement for the documentation and navigation.

Edit - I see. GitHub has things named Projects to organize work.

@jimfoltz
Copy link
Author

See #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants