Commit Graph

1787 Commits

Author SHA1 Message Date
Ruin0x11
c72ce182d5 Rewrite links in Markdown to point to fallback if missing in translation
It will follow relative links to other pages and embedded images.
2021-09-15 14:14:47 -07:00
Ruin0x11
ee740aceff Remove 'default' property on languages, use book.language instead 2021-09-15 14:13:48 -07:00
Ruin0x11
a042cfc72b Make mdbook init output multilingual structure 2021-09-15 14:12:11 -07:00
Ruin0x11
5e223e074e Support localizing book title/description 2021-09-15 14:10:15 -07:00
Ruin0x11
e17ce64f2b Fix test using create_missing 2021-09-15 14:10:15 -07:00
Ruin0x11
282fdaa3ac Redirect to a 404 page when serving translated
We can't redirect in warp based on the URL, so redirect to the default
language's 404 page instead.

See: https://github.com/seanmonstar/warp/issues/171
2021-09-15 14:10:12 -07:00
Ruin0x11
85ab4d39cd Redirect to translation index page in serve command 2021-09-15 14:08:01 -07:00
Ruin0x11
8869c2cf06 Build multiple books from localizations at once
Changes how the `book` module loads books. Now it is possible to load
all of the translations of a book and put them into a single output
folder. If a book is generated this way, a menu will be created in the
handlebars renderer for switching between languages.
2021-09-15 14:07:02 -07:00
Ruin0x11
96d9271d64 Specify language for book in command line args
- Add a [language] table to book.toml. Each key in the table defines a
new language with `name` and `default` properties.
- Changes the directory structure of localized books. If the [language]
table exists, mdBook will now assume the src/ directory contains
subdirectories named after the keys in [language]. The behavior is
backwards-compatible if you don't specify [language].
- Specify which language of book to build using the -l/--language
argument to `mdbook build` and similar, or omit to use the default
language.
- Specify the default language by setting the `default` property to
`true` in an entry in [language]. Exactly one language must have `default`
set to `true` if the [language] table is defined.
- Each language has its own SUMMARY.md. It can include links to files
not in other translations. If a link in SUMMARY.md refers to a
nonexistent file that is specified in the default language, the renderer
will gracefully degrade the link to the default language's page. If it
still doesn't exist, the config's `create_missing` option will be
respected instead.
2021-09-15 14:00:10 -07:00
Ruin0x11
3049d9f103 Actually, don't change source root
The book paths have to gracefully degrade to the default language if
they aren't available.
2021-09-15 13:56:01 -07:00
Ruin0x11
24e6d6b605 Change book source root depending on language 2021-09-15 13:55:59 -07:00
Ruin0x11
e4b443cd4a Add language config section
Referencing https://github.com/rust-lang/mdBook/issues/5#issuecomment-323573492.
2021-09-15 13:53:50 -07:00
Eric Huss
93008cf20b
Merge pull request #1643 from apogeeoak/update-open
Update open crate to latest version.
2021-09-07 10:20:24 -07:00
apogeeoak
3f9f681b9e Update open crate to latest version. 2021-09-06 15:52:43 -04:00
Eric Huss
63680d0786
Merge pull request #1480 from pauliyobo/preprocessor_docs
Improving documentation on implementation of preprocessors.
2021-09-05 18:46:09 -07:00
Eric Huss
656a1825cc Minor fixes for preprocessor docs. 2021-09-05 18:45:37 -07:00
pauliyobo
1a2fa29209 introduced proposed suggestions related to the documentation 2021-09-04 23:44:27 +02:00
Eric Huss
d22299d998
Merge pull request #1631 from benarmstead/master
Format better, remove unnecessary borrows, and update depends
2021-09-03 10:15:16 -07:00
Eric Huss
0af417085f
Merge pull request #1634 from vv9k/master
Add information about a new backend `mdbook-man`
2021-09-03 10:11:32 -07:00
Eric Huss
9634798eb7
Merge pull request #1637 from notriddle/no-headers
Include chapters with no headers in the search index
2021-09-03 10:10:07 -07:00
Michael Howell
2a8af1c21d Include chapters with no headers in the search index 2021-08-31 12:48:21 -07:00
Wojciech Kępka
981f8695ff Add information about a new backend mdbook-man 2021-08-26 17:45:22 +02:00
Eric Huss
48b5e52f62
Merge pull request #1632 from tsoutsman/patch-1
Fix preprocessor example
2021-08-24 10:23:06 -07:00
Klim Tsoutsman
c4fec94c4c
Appease Clippy 2021-08-24 23:04:32 +10:00
Ben Armstead
ab0c338c08 Update depends 2021-08-24 08:57:36 +01:00
Ben Armstead
8a82f6336a Format with cargo correctly 2021-08-24 08:48:24 +01:00
Ben Armstead
1700783594 Format better and remove unnecessary borrows 2021-08-24 08:45:06 +01:00
Eric Huss
e6629cd75b
Merge pull request #1623 from ehuss/release-next
Update to 0.4.12
2021-08-02 08:40:26 -07:00
Eric Huss
5a077b9ff4 Update to 0.4.12 2021-08-02 08:19:34 -07:00
Eric Huss
8b4e488de1
Merge pull request #1621 from ehuss/revert-highlightjs11
Revert #1597 - Update to highlight.js 11.0.
2021-08-02 08:15:45 -07:00
Eric Huss
68d8ceec47 Revert #1597 - Update to highlight.js 11.0. 2021-08-02 08:02:13 -07:00
Eric Huss
db337d4a6f
Merge pull request #1616 from joshrotenberg/add_cleanup_contributors
Add a couple contributors, clean up a little
2021-07-27 08:59:46 -07:00
josh rotenberg
5e277140be add a couple, clean up a little 2021-07-26 21:23:42 -07:00
Eric Huss
14add9c290
Merge pull request #1615 from ehuss/release-next
Update to 0.4.11
2021-07-26 13:47:37 -07:00
Eric Huss
87877a9dae Update to 0.4.11 2021-07-26 13:47:08 -07:00
Eric Huss
2cf00d0880
Merge pull request #1597 from ehuss/update-hightlight.js
Update to highlight.js 11.0.
2021-07-26 13:22:42 -07:00
Eric Huss
8c7af3c767
Merge pull request #1614 from joshrotenberg/code_of_conduct
Add explicit code of conduct, copying other rust-lang repos
2021-07-26 12:42:15 -07:00
Eric Huss
6dd785ea6c Update to highlight.js 11.0. 2021-07-26 12:40:28 -07:00
Eric Huss
8d131b4310
Merge pull request #1598 from ehuss/update-contributing
Some minor updates to contributing docs.
2021-07-26 12:38:06 -07:00
Eric Huss
97b38063b1
Merge pull request #1613 from FWYongxing/master
Don't highlight `inline code` blocks in headers with output.html. playpen(playgroud).editable=true
2021-07-26 12:37:39 -07:00
josh rotenberg
d23734f82e add explicit code of conduct, copying other rust-lang repos 2021-07-26 11:52:24 -07:00
Eric Huss
2ccfaadd1d
Merge pull request #1609 from joshrotenberg/intro_updates
Updates to the mdbook introduction
2021-07-26 11:41:51 -07:00
Eric Huss
3d04e5c7ff
Merge pull request #1612 from joshrotenberg/update_tokio_warp
Update tokio and warp to latest versions
2021-07-26 11:37:54 -07:00
FWYongxing
49ef7b6f02 Don't highlight inline code blocks in headers with output.html.playpen(playgroud).editable=true 2021-07-27 01:02:17 +08:00
josh rotenberg
da7026190c add Cargo.lock change too 2021-07-26 09:49:38 -07:00
josh rotenberg
92377013cc 1.46.0 has if, match, and loop expressions can now be used in const functions. 2021-07-25 19:33:21 -07:00
josh rotenberg
34b586ab32 tokio msrv is 1.45.2 2021-07-25 19:27:47 -07:00
josh rotenberg
a79065b0d3 update warp and tokio versions 2021-07-25 19:14:40 -07:00
josh rotenberg
b3ab93a4b3 update warp and tokio versions 2021-07-25 19:14:34 -07:00
josh rotenberg
49b75810fa fix a few typos 2021-07-24 21:17:41 -07:00