-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Load additional (external) resources #940
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
base: master
Are you sure you want to change the base?
Load additional (external) resources #940
Conversation
Adding one or more sections like this to book.toml: ```toml [[output.html.additional-resources]] output-dir="img" src="../uml/*.png" ``` Will copy the files to the book output directory.
Thanks Diff in /home/travis/build/rust-lang-nursery/mdBook/src/config.rs at line 388:
}
}
-
/// Additional files not normaly copied (like external images etc), which
/// you want to add to the book output.
/// In book.toml:
Diff in /home/travis/build/rust-lang-nursery/mdBook/src/config.rs at line 422:
}
}
-
/// Configuration for the build procedure.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(default, rename_all = "kebab-case")]
Diff in /home/travis/build/rust-lang-nursery/mdBook/src/config.rs at line 487:
pub git_repository_icon: Option<String>,
/// The additional resources to copy
- pub additional_resources: Option<Vec<AdditionalResource>>
+ pub additional_resources: Option<Vec<AdditionalResource>>,
}
impl HtmlConfig {
Diff in /home/travis/build/rust-lang-nursery/mdBook/src/config.rs at line 670:
git_repository_url: Some(String::from("https://foo.com/")),
git_repository_icon: Some(String::from("fa-code-fork")),
additional_resources: Some(vec![
- AdditionalResource {
- src: String::from("foo*.*"),
- output_dir: PathBuf::from("bar"),
- },
- AdditionalResource {
- src: String::from("chuck*.*"),
- output_dir: PathBuf::from("norris"),
- }
- ]),
+ AdditionalResource {
+ src: String::from("foo*.*"),
+ output_dir: PathBuf::from("bar"),
+ },
+ AdditionalResource {
+ src: String::from("chuck*.*"),
+ output_dir: PathBuf::from("norris"),
+ },
+ ]),
..Default::default()
}; |
@Dylan-DPC I already made these changes yesterday, or am I missing something? Regards, Sytse |
I think this would also need documentation in config.md. |
@ehuss I was wondering where the documentation was generated from, now I know. Documentation added. |
☔ The latest upstream changes (possibly #2681) made this pull request unmergeable. Please resolve the merge conflicts. |
Allow users to insert additional resources from other directories
Adding one or more sections like this to book.toml:
Will copy the files to the book output directory.