feat: splitting
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
// Source: https://git.scient.ing/education/coursebank
|
||||
|
||||
//! The on-disk layout of a course directory.
|
||||
//!
|
||||
//! Two of these directories hold fragments of the course file rather than files
|
||||
//! of their own kind: `lectures/` and `objectives/` are merged into one
|
||||
//! [`crate::course::CourseFile`] on load, along with `references.yaml`. See
|
||||
//! [`crate::course::fragment`].
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -35,6 +40,25 @@ impl Layout {
|
||||
self.root.join(COURSE_FILE)
|
||||
}
|
||||
|
||||
/// Path to `references.yaml`, the bibliography when it is kept out of
|
||||
/// `course.yaml`.
|
||||
///
|
||||
/// Optional: absent means the course keeps its `references:` section in the
|
||||
/// course file, which is how an unsplit course is arranged.
|
||||
pub fn references_file(&self) -> PathBuf {
|
||||
self.root.join(crate::course::fragment::REFERENCES_FILE)
|
||||
}
|
||||
|
||||
/// Directory holding one file per lecture.
|
||||
pub fn lectures(&self) -> PathBuf {
|
||||
self.root.join("lectures")
|
||||
}
|
||||
|
||||
/// Directory holding one file per learning objective.
|
||||
pub fn objectives(&self) -> PathBuf {
|
||||
self.root.join("objectives")
|
||||
}
|
||||
|
||||
/// Directory holding item bank YAML files.
|
||||
pub fn banks(&self) -> PathBuf {
|
||||
self.root.join("banks")
|
||||
@@ -93,6 +117,8 @@ impl Layout {
|
||||
pub fn create_all(&self) -> Result<()> {
|
||||
for dir in [
|
||||
self.root.clone(),
|
||||
self.lectures(),
|
||||
self.objectives(),
|
||||
self.banks(),
|
||||
self.assessments(),
|
||||
self.data(),
|
||||
|
||||
Reference in New Issue
Block a user