How to install third-party libraries offline

How to install third-party libraries offline?I want use 'mdbook' library.

Take a copy of the library, then use cargo vendor to download all of its transitive dependencies. For example, this session:

$ git clone https://github.com/rust-lang/mdBook.git

$ cargo vendor
To use vendored sources, add this to your .cargo/config.toml for this project:

[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

You can then do whatever you want with mdBook, or its dependencies, without an internet connection.

3 Likes

thanks