class documentation

A class to represent a note of a document. Attributes: document (str): The name of the document being reviewed. note_title (str): The name of the note_title. pictures (list[str]): A list of paths to pictures related to the note. text (str): The text content of the note. Methods: from_text(cls, raw: str) -> 'Note': Creates a Note instance from a string containing YAML metadata and text content. from_json(cls, raw: str) -> 'Note': Creates a Note instance from a JSON string. json(self) -> dict: Returns the note data as a JSON string. text(self) -> str: Returns the note data as a string containing YAML metadata and text content.

Class Method from_json Creates a Note instance from a JSON string.
Class Method from_text Creates a Note instance from a string containing YAML metadata and text content.
Method __init__ Initializes a new instance of the Note class.
Instance Variable content Undocumented
Instance Variable document Undocumented
Instance Variable metadatas Undocumented
Instance Variable note_title Undocumented
Property dict Returns the note data as a JSON string.
Property text Returns the note data as a string containing YAML metadata and text content.
@classmethod
def from_json(cls, raw_content: str) -> Note:

Creates a Note instance from a JSON string. Args: raw (str): A JSON string containing note data. Returns: Note: A new instance of the Note class. Raises: Exception: If the JSON string is invalid.

@classmethod
def from_text(cls, post_title: str, note_title: str, raw_content: str) -> Note:

Creates a Note instance from a string containing YAML metadata and text content. Args: raw (str): A string containing YAML metadata and text content. Returns: Note: A new instance of the Note class. Raises: Exception: If an unexpected error occurs.

def __init__(self, post_title: str, note_title: str, content: str, metadatas: dict[str, str] = None):

Initializes a new instance of the Note class. Args: document (str): The name of the document being reviewed. note_title (str): The name of the note_title. pictures (list[str]): A list of paths to pictures related to the note. content (str): The content content of the note.

content =

Undocumented

document =

Undocumented

metadatas =

Undocumented

note_title =

Undocumented

@property
dict: dict =

Returns the note data as a JSON string. Returns: dict: A dictionary containing the note data.

@property
text: str =

Returns the note data as a string containing YAML metadata and text content. Returns: str: A string containing YAML metadata and text content.