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

yard server ignores --query #1527

Closed
krystof-k opened this issue Jan 9, 2024 · 2 comments
Closed

yard server ignores --query #1527

krystof-k opened this issue Jan 9, 2024 · 2 comments

Comments

@krystof-k
Copy link

krystof-k commented Jan 9, 2024

yard server ignores --query parameter and renders everything.

Steps to reproduce

This is the minimal reproduction for the issue. I've done my best to remove
all extraneous code and unique environment state on my machine before providing
these steps:

  1. Run the following command: yard server --reload --query 'has_tag?(:todo)'
  2. Open browser at http://localhost:8808
  3. You see everything
  4. Run the following command: yard doc --query 'has_tag?(:todo)'
  5. Open browser at the doc/index.html
  6. You see only items tagged as @todo

Actual Output

yard server ignores the query, yard doc respects it.

Expected Output

Both yard server and yard doc behave the same and respects the query.

Environment details:

  • OS: macOS
  • Ruby version (ruby -v): ruby 3.1.4p223
  • YARD version (yard -v): yard 0.9.34

I have read the Contributing Guide.

@lsegal
Copy link
Owner

lsegal commented Aug 26, 2024

You should be seeing the following, since yard server does not support --query:

[warn]: Unrecognized/invalid option: --query

This is intended behavior since yard server does not directly run yard doc. In order to filter, you would need --query in the specific project's .yardopts file. In the case of serving a single directory, "specific project" means your current project.

Closing this since it works as intended, you should specify arguments to yard doc in your .yardopts, and yard server is not meant to be a superset of yard doc.

@krystof-k
Copy link
Author

Thanks @lsegal, you're right, I see, I just didn't look, sorry about that:

[warn]: Unrecognized/invalid option: --query
[warn]: Unrecognized/invalid option: --hide-tag

Anyway I find it a little confusing, I'd expect all the options of yard doc to work as well, it would be nice to add support for it.

.yardopts doesn't quite work, because I want to run two servers, one with everything and one with just a specific tag, maybe it is somehow possible to use different files for each server, I'll try to look that up.

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

No branches or pull requests

2 participants