-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Clarify which version of source code was used to generate docs #1595
Comments
Adding a timezone to the timestamp seems reasonable. Would accept a PR to fix this. As far as git commit hash and library version, these aren't something that YARD necessarily knows about. Git commit would require integrating with the system VCS which has a lot of sharp edges (git isn't in the PATH, contents generated against dirty checkout so SHA isn't valid, VCS might not be git, YARD opens itself up to fielding feature requests for ). Getting the library version is even harder as there is no static way to get this information without evaluating code. The good news is you can build a custom template footer pretty easily with all the information you want by throwing a file into <!-- templates/default/layout/html/footer.erb -->
<div id="footer">
Generated <code>MY_LIBRARY</code> <%= YARD::VERSION %> <!-- insert your library's VERSION const here -->
(<%= `git rev-parse HEAD`.strip[0,6] %>) at <%= Time.now %>.
</div> |
I saw this fragment here and thought it is possible: <script>
window.yard_library_name = '<%= @library.name %>';
window.yard_library_version = '<%= @library.version %>';
</script> https://github.com/docmeta/rubydoc.info/blob/main/templates/default/layout/html/footer.erb#L8 |
Rubydoc intentionally pulls information that yard alone does not have-- specifically the rubygems package release list or git repos. That's because rubydoc explicitly pulls from these sources. YARD only uses disk. |
Currently when yard generates docs it attaches the following footer:
Which is not enough to understand which version of the source code was used:
Ideally all of that need to be present to understand if the doc is up to date or not.
Please add this information to footer.
The text was updated successfully, but these errors were encountered: