.. _writing_rich_text: Writing Rich Text Entries ========================= LabArchives rich-text entries use HTML for formatting. The examples below show common markup patterns you can pass to :class:`~labapi.entry.entries.text.TextEntry`. Create a Rich Text Entry ------------------------ The examples below assume you already have a ``page`` object: .. code-block:: python from labapi import TextEntry page.entries.create(TextEntry, "

This is a rich text entry.

") For a broader HTML reference, see the `MDN HTML elements reference `_. Common HTML Patterns -------------------- Paragraphs ~~~~~~~~~~ Use ``

`` tags for basic paragraphs: .. code-block:: html

This is a paragraph.

This is another paragraph.

Text Formatting ~~~~~~~~~~~~~~~ Use standard HTML tags for common inline formatting: - Bold: ``bold text`` - Italic: ``italic text`` - Underline: ``underlined text`` - Strikethrough: ``strikethrough text`` Example: .. code-block:: html

This paragraph contains bold, italic, underlined, and strikethrough text.

Text Color ~~~~~~~~~~ Use the ``style`` attribute with the ``color`` property: .. code-block:: html

This text is red.

This text is blue.

Tables ~~~~~~ Create tables with ````, ````, ``
``, and ````: .. code-block:: html
Header 1 Header 2
Row 1, Cell 1 Row 1, Cell 2
Row 2, Cell 1 Row 2, Cell 2
Lists ~~~~~ Use ``
    `` or ``
      `` with ``
    1. `` items: .. code-block:: html
      • Item 1
      • Item 2
      • Item 3
      .. code-block:: html
      1. First item
      2. Second item
      3. Third item
      Related Pages ------------- - :ref:`entries` for entry type behavior and update semantics. - :doc:`/examples/csv_table` for a complete CSV-to-HTML workflow. - :ref:`creating_pages` for the surrounding page-and-entry creation pattern.