Add article source

main
trivernis 4 years ago
parent 3efe9df1c4
commit dec84de7ce

@ -7,3 +7,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
chrono = "0.4.15"

@ -0,0 +1,28 @@
use chrono::{Local, Date};
/// An article source
#[derive(Clone, Debug)]
pub struct Article {
pub author: String,
pub title: String,
pub journal: String,
pub date: Date<Local>,
pub volume: Option<String>,
pub number: Option<String>,
pub pages: Option<String>,
}
impl Article {
/// Creates a new article with the mandatory fields filled
pub fn new(author: String, title: String, journal: String, date: Date<Local>) -> Self {
Self {
author,
title,
journal,
date,
volume: None,
number: None,
pages: None,
}
}
}

@ -1,7 +1,11 @@
use crate::bibliography::bib_types::article::Article;
pub mod article;
/// A type of bibliography entry
#[derive(Clone, Debug)]
pub enum BibliographyType {
Article,
Article(Article),
Book,
Booklet,
InBook,

@ -5,8 +5,8 @@ use crate::bibliography::bib_types::BibliographyType;
#[derive(Clone, Debug)]
pub struct BibliographyEntry {
key: String,
note: Option<String>,
bib_type: BibliographyType,
pub note: Option<String>,
pub bib_type: BibliographyType,
}
pub type BibliographyEntryReference = Arc<Mutex<BibliographyEntry>>;

Loading…
Cancel
Save