rustyphoenixlecture 1.0.0

This project aims to provide a simple a powerfull lecture compilation to generate html web sites
/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/

use crate::plectureparser::{
	PReferenceUrl, pabstractcontent::{PAbstractContent, PAbstractLectureBackend},
	plabeler::PLabelId,
	pveccontent::PVecContent
};

///Work in progress object of the lecture
#[derive(Debug, Clone, PartialEq)]
pub struct PContentWorkInProgress{
	///Children of content
	content: PVecContent,
}

impl PContentWorkInProgress {
	///Constructor of a PContentWorkInProgress
	/// # Returns
	/// Initialised PContentWorkInProgress
	pub fn new() -> Self{
		PContentWorkInProgress {
			content: Default::default(),
		}
	}
	///Get the mutable content of the PContentWorkInProgress
	/// # Returns
	/// Mutable content of the PContentWorkInProgress
	pub fn get_content_mut(&mut self) -> &mut PVecContent {
		&mut self.content
	}
	
}

impl PAbstractContent for PContentWorkInProgress{
	///Say if the PContent has an embeded label
	/// # Returns
	/// True if the PContent has an embeded label, false otherwise
	fn has_embeded_label(&self) -> bool{
		false
	}
	///Get the reference url of the current PContent
	/// # Parameters
	/// - `current_file` : current output file of the PContent
	/// - `id` : id of the current PContent
	/// # Returns
	/// Corresponding PReferenceUrl
	fn get_reference_url(&self, current_file: &String, id: usize) -> PReferenceUrl{
		PReferenceUrl::from_text(current_file, id, &String::from(&format!("Work In progress {}", id)))
	}
	///Convert the current struct into html
	/// # Parameters
	/// - `backend` : backend which write a lecture in files
	/// - `id` : id of the current PContent
	fn to_html<TLectureBackend>(&self, backend: &mut TLectureBackend, id: &PLabelId)
		where TLectureBackend: PAbstractLectureBackend
	{
		backend.write(&format!("\n<table id=\"{}\" class=\"workinprogress\">\n", id.get_id()));
		backend.write(&String::from("\t<tr><td class=\"workinprogressimage\"><img  src=\"book/images/wip.png\" alt=\"wip\" /></td></tr>\n"));
		backend.write(&String::from("\t<tr><td class=\"workinprogresscontent\">"));
		self.content.to_html(backend, id);
		backend.write(&String::from("</td></tr>\n</table>\n"));
	}
}