Skip to content

Commit

Permalink
Add verso tags for transcription types
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr committed Jul 30, 2023
1 parent e9bb327 commit a6327b4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/data/course_generator/transcription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::data::{
};
use constants::*;

//@<transcription-link
/// A link to an external resource for a transcription asset.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
Expand All @@ -44,7 +45,9 @@ impl TranscriptionLink {
}
}
}
//>@transcription-link

//@<transcription-asset
/// An asset used for the transcription course generator.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
Expand Down Expand Up @@ -75,6 +78,7 @@ pub enum TranscriptionAsset {
external_link: Option<TranscriptionLink>,
},
}
//>@transcription-asset

impl TranscriptionAsset {
/// Returns the short ID of the asset, which wil be used to generate the exercise IDs.
Expand All @@ -85,6 +89,7 @@ impl TranscriptionAsset {
}
}

//@<transcription-passages
/// A collection of passages from a track that can be used for a transcription course.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
Expand All @@ -97,6 +102,7 @@ pub struct TranscriptionPassages {
/// them from a vector because reordering the passages would change the resulting exercise IDs.
pub intervals: HashMap<usize, (String, String)>,
}
//>@transcription-passages

impl TranscriptionPassages {
/// Generates the exercise assets for these passages with the given description.
Expand Down Expand Up @@ -155,15 +161,20 @@ impl TranscriptionPassages {
}
}

//@<transcription-preferences
/// Settings for generating a new transcription course that are specific to a user.
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct TranscriptionPreferences {
/// The list of instruments the user wants to practice.
/// The list of instruments the user wants to practice. Note that changing the instrument ID
/// will change the IDs of the exercises and lose your progress, so it should be chosen
/// carefully before you start practicing.
#[serde(default)]
pub instruments: Vec<Instrument>,
}
//>@transcription-preferences

//@<transcription-config
/// The configuration used to generate a transcription course.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
Expand Down Expand Up @@ -201,6 +212,7 @@ pub struct TranscriptionConfig {
#[serde(default)]
pub skip_advanced_lessons: bool,
}
//>@transcription-config

impl TranscriptionConfig {
/// Returns the ID for a given exercise given the lesson ID and the exercise index.
Expand Down

0 comments on commit a6327b4

Please sign in to comment.