-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Feedback for upstream mdbook #1092
Comments
Hi, thanks for checking in and congrats on your new maintainership duties! I'd love a way to generate an EPUB or PDF with mdbook! And you've discovered correctly that the biggest item on our wishlist would be translation support-- I'd love to be able to incorporate translations in a way that makes sense for people doing the translations and for the main repo. I don't know exactly what that would look like, but I'm up for trying things! |
Awesome! To get started it might be a good idea to ask what exactly does maintaining multiple translations require, that way we can figure out a set of requirements, deal breakers, etc. For example, what's stopping you from just having multiple separate books which are maintained in parallel? Feel free to CC in anyone who might have an opinion on translations, or just |
@sebasmagri will definitely have more informed thoughts than I will-- Sebastián, I'm ccing you on this issue which is the new maintainer of mdbook asking for feedback on what the rust book could use from mdbook, including translation support. We'd love your thoughts/ideas if they've changed at all since this comment of yours! rust-lang/mdBook#5 (comment) My thoughts: I see a few stakeholders here, only some of which I can really speak for... Main repo maintainers/deployment
Nothing, that's what we're doing right now-- but we're just linking to them from an appendix which isn't very discoverable. I'd also like to recognize the translations as being "official" (have them in a rust-lang repo, have them available at doc.rust-lang.org), although not managing all the pull requests/issues for all the translations in this repo is a plus of the current system... We're also not shipping the translations with Rust for offline reading. Currently the way that works is that rust-lang/rust has a git submodule of this repo and the rust-lang/rust build process runs mdbook. We could add more submodules and run mdbook more times, but that means we'd have to send a PR to rust-lang/rust to modify the build system for every new translation-- it'd be nicer if we could just add a translation to this repo and have it included the next time the git submodule is updated. I suppose there's probably a hacky solution we could do where this repo has git submodules as well??? ReadersAs far as the reader experience goes, I would imagine this from rust-lang/mdBook#5 would be ideal:
But I don't actually know! Do people switch between the English and a translation and read both together? Or do people just switch to a translation and stay with the translation? TranslatorsThis comment is interesting, about tools to help manage translation efforts: rust-lang/mdBook#5 (comment) I have no idea the level of effort of integrating with something like this or if it's desirable! |
It's basically
|
There's an open PR (rust-lang/mdBook#472) which adds search functionality to the book. The author also included a proof-of-concept of TRPL with search enabled which looks really, really nice! Unfortunately that PR has developed a couple merge conflicts as bits and pieces of the code base have been refactored, but hopefully they shouldn't be too difficult to resolve.
I feel like you'd want to choose a translation in the language you're most comfortable with and stick to that. Chopping and changing between language means you're constantly context switching, I remember it used to take about 5-10 minutes for my brain to properly change from English to French although that could just be me. One possible idea is you have multiple separate books which share a
With the equivalent pages table looking something like this:
(actual format subject to bikeshedding) The root |
Hi! Thanks for the mention @carols10cents! I agree in general terms with the mapping proposal, which has also been discussed in the existing issues. Generally, at least in my experience, people switches languages and stay in that language, so the mapping should also affect links and ToCs. Other than some bikeshedding feedback like having the default language without a directory prefix, having a directory prefix for all translations like in I remember I asked @carols10cents about how would a workflow to integrate translations into the TRPL builds work based on this. An idea I had was that the translation directories could be git submodules, but we'd need some sort of acceptance criteria. So if mdBook could provide some sort of |
I was thinking we could take a leaf out of regarding directory structure
File linking in "multilingual" mode
[translations]
en = "translations/trpl-en"
fr = "translations/trpl-fr"
ru = "translations/trpl-ru"
translation-links = "equivalents.csv" ... Or is that going to over-complicate things in the long run?
#507 introduces the ability to implement your own backend, which is essentially just some program that's given a representation of the loaded book so the backend can do something with it. There's nothing stopping you from implementing your own TRPL-specific "backend" to do things like spell and link checking, coverage reporting, or whatever you want. A backend is just some command which is invokable (e.g. So even though we may not provide a Sorry for the wall of words! |
Just a little update on how things are going... The alternate backends PR landed on I've continued working on the epub renderer and, other than poor styling because I haven't really tweaked the embedded stylesheet, it looks really really good! Here's a sample when I run |
FYI I created a mdbook-linkcheck backend for checking links. I've tried it out on several repositories so far and it's been fairly robust. It managed to find a couple broken links in Rust By Example (rust-lang/rust-by-example#990), but I wasn't able to find anything when I ran it over both the first and second versions of TRPL other than false positives like EDIT: There's now a tutorial on how you can create your own tools on top of |
I just updated the "add a spellchecker" issue for If you know anyone who may be keen to take on the job, please let them know 🙂 |
We'll continue to send you upstream issues, but I don't think tracking them here makes sense. Thanks for all of your work <3 |
I recently became the main maintainer of mdbook and was wondering what I can do to make the process of working on TRPL easier? I know The Book is one of our biggest users, so it probably makes sense for there to be a bit more communication/collaboration between the maintainers of
mdbook
and TRPL.For example, one of the big things I've been working on lately is alternate backends. There's an EPUB renderer in the works, as well as a backend for running tests through
rust-skeptic
(mdbook-test). Especially given there are programs like @killercup's trpl-ebook, would a more bespoke solution like this be useful?Are there any other things we can do which could really help out TRPL? Your README mentions translations are currently blocked on upstream support. There's currently an issue for this (rust-lang/mdBook#5) but it looks like discussion has stalled and it's not apparent from the comments what exactly is desired. We've recently cleaned up a lot of the internals, so it may be a good time to revisit multilingual support.
The text was updated successfully, but these errors were encountered: