-
-
Notifications
You must be signed in to change notification settings - Fork 226
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 versioned book on readthedocs.org #1036
Conversation
Just one question: can we generate it for older versions as well? And also: we need to add a link to the book in the API documentation (at the crate level I suppose?). |
Not really, not easily. You need a readthedocs.yaml file in the revision that you want to document. Readthedocs did allow to add the content of that file in a web form instead, but that feature was removed, for reproducibility's sake or something. They suggest that you create a branch I wouldn't like to add a branch just to document older releases, but maybe we could do a point release |
@djc 👈🏻 👈🏻 It's not nice that only future versions will be documented, but I daresay that 0.13.0 won't be the last version, so better late than never? |
book/theme/index.hbs
Outdated
@@ -0,0 +1,365 @@ | |||
<!DOCTYPE HTML> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was this generated? How do we keep it up to date in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was this generated?
I copied https://github.com/rust-lang/mdBook/blob/master/src/theme/index.hbs, and edited inside nav#sidebar.
How do we keep it up to date in the future?
I guess we can write a reminder somewhere to look into https://github.com/rust-lang/mdBook/commits/master/src/theme/index.hbs before tagging a new version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a script to do it easily instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
Sorry -- I'd prefer for the script to be written in Rust. |
Sure: fn main() {
if !std::process::Command::new("./update-theme.py")
.spawn()
.except("could not start")
.status()
.except("could not run")
.success
{
panic!("script failed");
}
} :P Sorry, but feel free to translate the script. |
Thinking more about it, it would also be possible not to commit index.hbs, but let RTD generate the file during the build process. After all, only they actually need the file. A local built or https://djc.github.io/askama/ as a beeding-edge version, can use the default index.hbs. |
Sounds good to me. |
This PR adds the file `.readthedocs.yaml`, which is used by readthedocs.org to generate the book on their servers. RTD can be used easily host docs for every Askama version, so users can explore how to use the current stable version, the current HEAD, and an older version. For older versions then the current PR, the books won't be built, because we did not provided the needed `.readthedocs.yaml`. Also an `index.hbs` is added to made mdbook and RTD work better together. Only the left sidebar was changed, but you have to override the whole file to make changes.
So, yay or nay? |
Sorry, I don't want to merge this Python script. Happy to take the other improvements here, though. |
This PR adds the file
.readthedocs.yaml
, which is used by readthedocs.org to generate the book on their servers. RTD can be used to easily host docs for every Askama version, so users can explore how to use the current stable version, the current HEAD, and an older version.For older versions then the current PR, the books won't be built, because we did not provided the needed
.readthedocs.yaml
.Also an
index.hbs
is added to made mdbook and RTD work better together. Only the left sidebar was changed, but you have to override the whole file to make changes.You can preview the book on: https://test-askama-rtd.readthedocs.io/pr-rtd/.
Resolves #1030.
Fixes https://github.com/djc/askama/issues/720.