diff --git a/src/bibliography/bib_types/mod.rs b/src/bibliography/bib_types/mod.rs index 6cb70ad..a08a06a 100644 --- a/src/bibliography/bib_types/mod.rs +++ b/src/bibliography/bib_types/mod.rs @@ -5,6 +5,7 @@ use crate::bibliography::bib_types::in_book::InBook; use crate::bibliography::bib_types::in_collection::InCollection; use crate::bibliography::bib_types::manual::Manual; use crate::bibliography::bib_types::misc::Misc; +use crate::bibliography::bib_types::repository::Repository; use crate::bibliography::bib_types::tech_report::TechReport; use crate::bibliography::bib_types::thesis::Thesis; use crate::bibliography::bib_types::unpublished::Unpublished; @@ -18,6 +19,7 @@ pub mod in_book; pub mod in_collection; pub mod manual; pub mod misc; +pub mod repository; pub mod tech_report; pub mod thesis; pub mod unpublished; @@ -39,5 +41,5 @@ pub enum BibliographyType { Unpublished(Unpublished), Misc(Misc), Website(Website), - Repository, + Repository(Repository), } diff --git a/src/bibliography/bib_types/repository.rs b/src/bibliography/bib_types/repository.rs new file mode 100644 index 0000000..f6662a3 --- /dev/null +++ b/src/bibliography/bib_types/repository.rs @@ -0,0 +1,27 @@ +use crate::bibliography::bib_types::LocalDate; + +/// A repository source that represents any git repository or similar +/// structures +#[derive(Clone, Debug)] +pub struct Repository { + pub author: String, + pub title: String, + pub url: Option, + pub license: Option, + pub cms: Option, + pub accessed_at: Option, +} + +impl Repository { + /// Creates a new repository source with only the mandatory fiels filled + pub fn new(author: String, title: String) -> Self { + Self { + author, + title, + url: None, + license: None, + cms: None, + accessed_at: None, + } + } +}