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

Add links from Rust and C++ to the common platform backend docs #3347

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

tronical
Copy link
Member

@tronical tronical commented Aug 25, 2023

... and adjust the C++ platform backend docs a little to the current
state.

cc #3208

@tronical
Copy link
Member Author

This is the side-bar for the C++ reference. It's mirroring the "Advanced Topics" and there's a little icon that tries to indicate that it's an external link.

Screenshot 2023-08-25 at 11 05 31

In Rust it's under "Related Topics":

Screenshot 2023-08-25 at 11 06 12

Comment on lines 43 to 45
Debugging Techniques <../slint/src/advanced/debugging_techniques.html#http://>
Selecting a Widget Style <../slint/src/advanced/style.html#http://>
Platform Backends <../slint/src/advanced/backends.html#http://>
Copy link
Member

Choose a reason for hiding this comment

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

Can we have comments in .rst and add a comment mentioning sphinx-doc/sphinx#701 (comment) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good point. If we proceed with this, then I'll add that.

@ogoffart
Copy link
Member

To be honnest, i don't think this is required. Because these link are accessible already if one follow "slint documentation" and then gets there.
In fact, i think it's even more confusing on the C++ one because you think you stay in the same website but you don't.

That said, i'm not objecting to this change if you like it this way.

@tronical
Copy link
Member Author

The main issue I have is that in the C++ and Rust reference we have documentation about the backend feature selection, but we don't link to the platform backend does.

I'll try to do that for C++ in cmake.md - that section may need an overhaul anyway.

I'd also love to do it for the Rust crate feature docs, but I don't know how to do the concat dance in Cargo.toml where we document the features ;-)

@tronical
Copy link
Member Author

So I agree with you, I'll make at least the change for C++ to remove those "misleading" links and try to have the links to the backend docs right in cmake.md. Those will still be external, but perhaps less misleading.

@ogoffart
Copy link
Member

The main issue I have is that in the C++ and Rust reference we have documentation about the backend feature selection, but we don't link to the platform backend does.

Maybe where we talk about the backend, we should link to the relevant documentation
(so in Cargo.toml for rust)

@ogoffart
Copy link
Member

I don't know how to do the concat dance in Cargo.toml where we document the features ;-)

Good point, this won't work :-/

@tronical
Copy link
Member Author

The main issue I have is that in the C++ and Rust reference we have documentation about the backend feature selection, but we don't link to the platform backend does.

Maybe where we talk about the backend, we should link to the relevant documentation (so in Cargo.toml for rust)

Yep. Any idea how to do that?

@tronical
Copy link
Member Author

Maybe document_features!() would support not only feature_label but also something like this:

#[doc = document_features!(ext_link_foo = concat!("https://slint.dev/releases/", env!("CARGO_PKG_VERSION"), "/docs/slint/blah.html"))]

and then in Cargo.toml:

## This is the [Foo](${ext_link_foo}) backend.
backend-foo = []

Is that possible in terms of the nested macro use?

... and adjust the C++ platform backend docs a little to the current
state.

cc #3208
@tronical tronical changed the title Add back-links to advanced topics for Rust and C++ Add links from Rust and C++ to the common platform backend docs Aug 25, 2023
@tronical
Copy link
Member Author

New PR has the sidebar links removed, cmake.md overhauled, and just one link added to the "Related Topics" on the Rust side - as a compromise.

@ogoffart
Copy link
Member

#[doc = document_features!(ext_link_foo = concat!("https://slint.dev/releases/", env!("CARGO_PKG_VERSION"), "/docs/slint/blah.html"))]

So be my guest if you want to implement that :-)
There is already support for some template, but it could be something like

 #[doc = document_features!(replacments = {LINK_FOO = concat!("https://slint.dev/releases/", env!("CARGO_PKG_VERSION"), "/docs/slint/blah.html") })]

But honestly, i think this is overdoing it.

Either

  1. keep it the way you did it
  2. hardcode the link to the latest version (slint.dev/docs/slint/...) doesn't matter if people looking our old docs have the wrong link
  3. hardcode the link to the snapshot version, and we replace the links in the repository before publishing a version. (we have other things we need to replace, so we can as well add that)
  4. implement a something in document-feature

My preference would be 3. , but i'd accept any other.

@tronical
Copy link
Member Author

But honestly, i think this is overdoing it.

Agreed. So let's go with 5 ;-) : A link under "related topics"

@tronical tronical merged commit e7a8833 into master Aug 25, 2023
31 checks passed
@tronical tronical deleted the simon/backend-doc-links branch August 25, 2023 11:22
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.

2 participants