class Note:
Constructors: Note.from_json(raw_content), Note.from_text(post_title, note_title, raw_content), Note(post_title, note_title, content, metadatas)
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 |
Creates a Note instance from a JSON string. |
| Class Method | from |
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 |
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. |
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.
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.
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.