Add Misc source type

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

@ -0,0 +1,22 @@
use crate::bibliography::bib_types::LocalDate;
/// A source that does not fit any of the other types
#[derive(Clone, Debug)]
pub struct Misc {
pub author: Option<String>,
pub title: Option<String>,
pub how_published: Option<String>,
pub date: Option<LocalDate>,
}
impl Misc {
/// Creates an empty Misc
pub fn new() -> Self {
Self {
author: None,
title: None,
how_published: None,
date: None,
}
}
}

@ -4,6 +4,7 @@ use crate::bibliography::bib_types::booklet::Booklet;
use crate::bibliography::bib_types::in_book::InBook; use crate::bibliography::bib_types::in_book::InBook;
use crate::bibliography::bib_types::in_collection::InCollection; use crate::bibliography::bib_types::in_collection::InCollection;
use crate::bibliography::bib_types::manual::Manual; use crate::bibliography::bib_types::manual::Manual;
use crate::bibliography::bib_types::misc::Misc;
use crate::bibliography::bib_types::tech_report::TechReport; use crate::bibliography::bib_types::tech_report::TechReport;
use crate::bibliography::bib_types::thesis::Thesis; use crate::bibliography::bib_types::thesis::Thesis;
use crate::bibliography::bib_types::unpublished::Unpublished; use crate::bibliography::bib_types::unpublished::Unpublished;
@ -15,6 +16,7 @@ pub mod booklet;
pub mod in_book; pub mod in_book;
pub mod in_collection; pub mod in_collection;
pub mod manual; pub mod manual;
pub mod misc;
pub mod tech_report; pub mod tech_report;
pub mod thesis; pub mod thesis;
pub mod unpublished; pub mod unpublished;
@ -33,7 +35,7 @@ pub enum BibliographyType {
Thesis(Thesis), Thesis(Thesis),
TechReport(TechReport), TechReport(TechReport),
Unpublished(Unpublished), Unpublished(Unpublished),
Misc, Misc(Misc),
Url, Url,
Repository, Repository,
} }

@ -1,3 +1,4 @@
use crate::bibliography::bib_types::misc::Misc;
use crate::bibliography::bib_types::BibliographyType; use crate::bibliography::bib_types::BibliographyType;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -17,7 +18,7 @@ impl BibliographyEntry {
Self { Self {
key, key,
note: None, note: None,
bib_type: BibliographyType::Misc, bib_type: BibliographyType::Misc(Misc::new()),
} }
} }

Loading…
Cancel
Save