def links
This commit is contained in:
parent
00947ec966
commit
38e7781c8d
4 changed files with 9 additions and 5 deletions
|
@ -13,8 +13,8 @@ pub struct Config {
|
|||
/// User-defined keys.
|
||||
pub user: HashMap<String, String>,
|
||||
|
||||
/// Links exported to Markdown for use with reference syntax `[text][key]`.
|
||||
pub links: HashMap<String, String>,
|
||||
/// Links exported to Markdown for use with reference syntax `[text][def:key]`.
|
||||
pub defs: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
|
|
@ -84,6 +84,10 @@ pub fn branch_to_html(
|
|||
.reference
|
||||
.split_once(':')
|
||||
.and_then(|(kind, linked)| match kind {
|
||||
"def" => config
|
||||
.defs
|
||||
.get(linked)
|
||||
.map(|link| (link.clone().into(), "".into())),
|
||||
"branch" => treehouse
|
||||
.branches_by_named_id
|
||||
.get(linked)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue