Add repository source type

Signed-off-by: trivernis <trivernis@protonmail.com>
main
trivernis 4 years ago
parent e7c2253ff5
commit 7c8e62911b
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -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),
}

@ -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<String>,
pub license: Option<String>,
pub cms: Option<String>,
pub accessed_at: Option<LocalDate>,
}
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,
}
}
}
Loading…
Cancel
Save