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

Move derive macros docs to scylla crate #907

Merged
merged 7 commits into from
Jan 12, 2024

Conversation

Lorak-mmk
Copy link
Collaborator

This PR moves docs for serialization / deserialization related derive macros from scylla-cql crate to scylla crate.
This is done to work around the issue that this documentation was not rendered correctly on docs.rs for scylla crate.
It's hard to tell why that is exactly - it's probably a bug / limitation in rustdoc.
It looks like when we have item X in crate A, re-export X as Y in crate B and document it, and re-export Y az Z in crate C,
Y's docs won't be rendered in crate C, only X's and Z's will.

Fixes: #904

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

@Lorak-mmk Lorak-mmk requested a review from piodul January 9, 2024 13:09
@Lorak-mmk
Copy link
Collaborator Author

After this is merged, we should release a new version, so that users are able to find documentation.

Copy link
Collaborator

@piodul piodul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the documentation in the scylla crate looks much better, it looks like the docstrings from multiple crates are still being squashed. For example, the message about the macro being documented in the scylla crate still appears in scylla::macros::ScyllaCql:

image

However, I can't find anything on the net about overriding docstrings on reexport, so I can't suggest any way to get rid of them (if it is possible at all). As we discussed on slack, let's at least make the message from scylla-macros more separated from the rest by putting a separator at the end of the docstrings in scylla.

scylla/src/macros.rs Show resolved Hide resolved
scylla-macros/src/lib.rs Outdated Show resolved Hide resolved
@Lorak-mmk Lorak-mmk force-pushed the workaround_macros_docs branch from a7c7b06 to 9261bed Compare January 12, 2024 11:38
This will be required to move documentation of serialization macros into
 scylla crate. This in turn is required to workaround the issue that
 documentation for those macros is not rendered on docs.rs correctly.
When both original item and re-export are documented, documentations are
merged. Before this commit, both original item and re-export were
documented - identically or at least very similarly. This caused docs
in scylla-cql crate to be copy-pasted twice. Replace docs with stubs
pointing to the scylla crate to avoid it and point users to proper
documentation.
This module is now so small it doesn't make much sens to keep it in
separate file.
Documentation was moved from scylla-cql to scylla, which made some paths
used in those docs incorrect. This commit updates paths to correct ones.
Rustdocs merges documentation of re-exports with documentation
of original item.
Because of this there is a need for separator, so that stubs from
scylla-macros crate are not mixed up with docs present in scylla crate.
Without those lines, whole doc for an item is merged and shown
in the summary, which makes it hard to read.
@Lorak-mmk Lorak-mmk force-pushed the workaround_macros_docs branch from 9261bed to 7933112 Compare January 12, 2024 11:40
@Lorak-mmk
Copy link
Collaborator Author

v2

  • Addresed review comments (fixed typos, added separators in scylla crate instead of empty lines in scylla-macros)
  • Added empty lines in documentation of old macros, so that only the first line is shown in the summary in the main page of documentation.
  • Fixed formatting of commit messages

@Lorak-mmk Lorak-mmk requested a review from piodul January 12, 2024 11:41
@piodul piodul merged commit e86823b into scylladb:main Jan 12, 2024
8 checks passed
@Lorak-mmk Lorak-mmk mentioned this pull request Feb 1, 2024
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.

Documentation for proc macros not rendered correctly
2 participants