Skip to content

Commit 9423215

Browse files
authored
fix: links in type functions (#412)
# Summary Episode 53 of fixing links
1 parent dbb1c49 commit 9423215

File tree

1 file changed

+14
-5
lines changed
  • crates/lad_backends/mdbook_lad_preprocessor/src

1 file changed

+14
-5
lines changed

crates/lad_backends/mdbook_lad_preprocessor/src/sections.rs

+14-5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub(crate) enum SectionData<'a> {
5151
lad_type: &'a LadType,
5252
},
5353
FunctionDetail {
54+
types_directory: PathBuf,
5455
function: &'a LadFunction,
5556
},
5657
}
@@ -214,7 +215,10 @@ impl<'a> Section<'a> {
214215
Section::new(
215216
child_parent_path.clone(),
216217
self.ladfile,
217-
SectionData::FunctionDetail { function },
218+
SectionData::FunctionDetail {
219+
function,
220+
types_directory: PathBuf::from("../types"),
221+
},
218222
)
219223
})
220224
.collect()
@@ -230,7 +234,10 @@ impl<'a> Section<'a> {
230234
Some(Section::new(
231235
child_parent_path.clone(),
232236
self.ladfile,
233-
SectionData::FunctionDetail { function },
237+
SectionData::FunctionDetail {
238+
function,
239+
types_directory: PathBuf::from("../../types"),
240+
},
234241
))
235242
})
236243
.collect(),
@@ -350,12 +357,14 @@ impl<'a> Section<'a> {
350357
},
351358
]
352359
}
353-
SectionData::FunctionDetail { function } => {
354-
let types_directory = PathBuf::from("../types");
360+
SectionData::FunctionDetail {
361+
function,
362+
ref types_directory,
363+
} => {
355364
vec![SectionItem::FunctionDetails {
356365
function,
357366
ladfile: self.ladfile,
358-
types_directory,
367+
types_directory: types_directory.clone(),
359368
}]
360369
}
361370
}

0 commit comments

Comments
 (0)