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
Is it possible to generate a single page per method? #1499
Comments
It's certainly possible to generate pages per method. YARD server already exposes individual method pages via permalink (example) and it should in fact be fully supported by the defaulte template already (breadcrumbs and all). The biggest limitation is that the yardoc CLI tool specifically omits method when generating: https://github.com/lsegal/yard/blob/main/lib/yard/cli/yardoc.rb#L325-L358 The good news is this is very possible to customize by either having your plugin/extension manually generate said method objects (using the same methodology as #run_generate above), or by overriding the related Hope that helps. |
As far as language settings go, this might be a little tougher. YARD doesn't make any assumptions about the code's language format, and arguably it would be incorrect to assume Link underlining etc would be acceptable as a PR (please include screenshots of what is being changed) but a change to lang etc would probably require some general purpose way to customize the language (without requiring code) if we were to default to English. |
Yep, I figured as much. I think it would make sense for a language method in setup.rb that defaults to nil, and when overridden, will set lang=whatever when the language is set.
I will investigate and get back to this!
The color changing I think is straight forward. The link underlining, TBH, is ugly (see current S3 docs, it's every link pretty much), but I think some exceptions can be made to ignore summary signatures and some other areas. |
I wasn't able to get method to generate when overwriting all_objects. I may have to dig into internals. Any other advice? I created a rake task similar to the yardoc executable with a monkey patch like so:
Edit - I see the files are there, however, with no breadcrumb and styling! |
Hello Loren. We (AWS Ruby SDK) are needing to address some accessibility concerns with our docs. Our Client docs (i.e. s3) have many methods. We are investigating whether it's possible to have each method on a single page, and have it breadcrumbed under the Client's CodeObject. If this is possible, what is the best way to achieve this?
Also - we've had to make some minor changes to colors, link underlining, setting page language "en", etc. I am also wondering if any of these changes can be merged upstream or if any of them are considered breaking? https://github.com/aws/aws-sdk-ruby/pull/2861/files
Thanks
The text was updated successfully, but these errors were encountered: