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

doc: Use intra-doc-links instead of relative paths to html pages #1084

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

MarijnS95
Copy link
Contributor

Using intra-doc-links saves quite a bit of code in gir, looks cleaner in the markdown files and resulting docs ([src] button mostly), and has the advantage of being checked by rustdoc for validity.

That last point is not totally fair as most of these trait "implements" / "implementors" segments are generated inside macros, for whichrustdoc does not seem to emit any warnings or errors currently.


This has only been tested on GStreamer-rs, and only sampled at random because of aforementioned "no-warnings-in-macros" issue 😞

@MarijnS95
Copy link
Contributor Author

@sophie-h Rebased and conflict automatically resolved (first commit was already applied), please review on gtk-rs :)

@sophie-h
Copy link
Contributor

I try. Great chance to understand the separated lgpl-docs.

Copy link
Contributor

@sophie-h sophie-h left a comment

Choose a reason for hiding this comment

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

Everything else looks great. (Not an expert in this at all though.)

src/codegen/doc/mod.rs Outdated Show resolved Hide resolved
Using intra-doc-links saves quite a bit of code in gir, looks cleaner in
the markdown files and resulting docs (`[src]` button mostly), and has
the advantage of being checked by `rustdoc` for validity.

That last point is not totally fair as most of these trait "implements"
/ "implementors" segments are generated inside macros, for which
`rustdoc` does not seem to emit any warnings or errors currently.
@MarijnS95
Copy link
Contributor Author

This supposedly also fixes broken links in gtk4 where no documentation for external crates is generated and uploaded, like a reference to glib::object::ObjectExt. Most of the crate relies on --extern-html-root-url=glib=https://gtk-rs.org/gtk-rs/ to point all glib references to a different link, but the explicit relative paths emitted here are (obviously) not caught by that.

CC @bilelmoussaoui :)

@GuillaumeGomez
Copy link
Member

Nice, thanks!

@GuillaumeGomez GuillaumeGomez merged commit 8dd201f into gtk-rs:master Apr 18, 2021
@MarijnS95 MarijnS95 deleted the intra-instead-of-file-link branch April 18, 2021 15:32
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.

5 participants