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

RFC: Use YARD to document API #4538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slonopotamus
Copy link
Contributor

@slonopotamus slonopotamus commented Jan 17, 2024

Motivation:

  1. While rubydoc.org understands some of the current documentation format, there are other tools that do not. Most notable example is RubyMine. I haven't checked VSCode, to be honest.
  2. Tools (including rubydoc.org) cannot infer nullability from current documentation (should I say "nillability" in Ruby?).
  3. Tools (including rubydoc.org) do not properly understand variant types.
  4. Things like visibility are already described by code itself and feel redundant.

Motivation:

1. While rubydoc.org understands some of the current documentation format, there are other tools that do not.
Most notable example is RubyMine.
2. Tools (including rubydoc.org) cannot infer nullability from current documentation (should I say "nillability" in Ruby?).
3. Tools (including rubydoc.org) do not properly understand variant types.
4. Things like visibility are already described by code itself and feel redundant.
@mojavelinux
Copy link
Member

I came to similar conclusions when working on Asciidoctor core...though I've yet to fully apply the change there.

@slonopotamus
Copy link
Contributor Author

I don't think converting the whole codebase in one go is manageable, because at least nullability requires conscious thoughts. In total, I spent ~20mins on AbstractBlock in current PR and not fully sure I got everything right. So, my suggestion is to do it gradually.

@ggrossetie
Copy link
Member

Speaking of YARD it would be great if we could publish the API documentation on https://docs.asciidoctor.org/ (HTML pages) instead of relying on https://www.rubydoc.info/

@slonopotamus If you are interested it might be a good idea to set it up on the Asciidoctor EPUB3 project first?

@slonopotamus
Copy link
Contributor Author

slonopotamus commented Jan 21, 2024

Sure, we can use other project for testing.

Though, I want to add a couple of thoughts:

  1. I'm not sure publishing API on a website has much value. We use API when writing code, so we're in IDE, which we use to navigare through code. And why argument/return types are important is because they allow IDE to offer autocomplete and provide warnings when wrong types are used.
  2. Asciidoctor Core is much more important API-wise because it is used by extensions. I haven't heard about anyone writing code that would extend Asciidoctor EPUB3. Type info can be useful within a program, but my main interest is about externally-visible stuff.

@mojavelinux
Copy link
Member

Please discuss hosting the API in asciidoctor/asciidoctor.org#1011 (or in the dev stream in the project chat).

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

Successfully merging this pull request may close these issues.

None yet

3 participants