def links
This commit is contained in:
parent
00947ec966
commit
38e7781c8d
|
@ -52,10 +52,10 @@
|
||||||
- so you may see me doing other random and weird stuff
|
- so you may see me doing other random and weird stuff
|
||||||
|
|
||||||
% id = "01H89P3CH89P2Q9XGQD7BCF0R6"
|
% id = "01H89P3CH89P2Q9XGQD7BCF0R6"
|
||||||
- perhaps [compilers][stitchkit/repo] are one of those weird things
|
- perhaps [compilers][def:stitchkit/repo] are one of those weird things
|
||||||
|
|
||||||
% id = "01H89P3CH8DYZHMQTGZDAEBNXN"
|
% id = "01H89P3CH8DYZHMQTGZDAEBNXN"
|
||||||
+ or [audio][dawd3/repo]
|
+ or [audio][def:dawd3/repo]
|
||||||
|
|
||||||
% id = "01H89P3CH859AAGFEABN8EANSJ"
|
% id = "01H89P3CH859AAGFEABN8EANSJ"
|
||||||
- my favorite part of that is blowing my own eardrums out with my math skill, which is rather *underdeveloped* so to speak
|
- my favorite part of that is blowing my own eardrums out with my math skill, which is rather *underdeveloped* so to speak
|
||||||
|
|
|
@ -13,8 +13,8 @@ pub struct Config {
|
||||||
/// User-defined keys.
|
/// User-defined keys.
|
||||||
pub user: HashMap<String, String>,
|
pub user: HashMap<String, String>,
|
||||||
|
|
||||||
/// Links exported to Markdown for use with reference syntax `[text][key]`.
|
/// Links exported to Markdown for use with reference syntax `[text][def:key]`.
|
||||||
pub links: HashMap<String, String>,
|
pub defs: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
|
|
|
@ -84,6 +84,10 @@ pub fn branch_to_html(
|
||||||
.reference
|
.reference
|
||||||
.split_once(':')
|
.split_once(':')
|
||||||
.and_then(|(kind, linked)| match kind {
|
.and_then(|(kind, linked)| match kind {
|
||||||
|
"def" => config
|
||||||
|
.defs
|
||||||
|
.get(linked)
|
||||||
|
.map(|link| (link.clone().into(), "".into())),
|
||||||
"branch" => treehouse
|
"branch" => treehouse
|
||||||
.branches_by_named_id
|
.branches_by_named_id
|
||||||
.get(linked)
|
.get(linked)
|
||||||
|
|
|
@ -4,6 +4,6 @@ site = "http://localhost:8080"
|
||||||
title = "liquidex's treehouse"
|
title = "liquidex's treehouse"
|
||||||
author = "liquidex"
|
author = "liquidex"
|
||||||
|
|
||||||
[links]
|
[defs]
|
||||||
"stitchkit/repo" = "https://github.com/liquidev/stitchkit"
|
"stitchkit/repo" = "https://github.com/liquidev/stitchkit"
|
||||||
"dawd3/repo" = "https://github.com/liquidev/dawd3"
|
"dawd3/repo" = "https://github.com/liquidev/dawd3"
|
||||||
|
|
Loading…
Reference in a new issue