Ludic Logo
Edit

Typography

The module ludic.catalog.typography contains the following components:

#

This text contains a link.

from ludic.catalog.typography import Link

Link("link", to="https://getludic.dev")  # appends target="_blank"
Link("link", to="/")                     # does not append target="_blank"

Paragraph

#

Here is some text wrapped in a paragraph.

from ludic.catalog.typography import Paragraph

Paragraph("Here is some text wrapped in a paragraph.")

Code

#

This text contains code: let mut x = 0;

from ludic.catalog.typography import Code

Code("let mut x = 0;")

Code Block

#

The following block contains a Rust code with syntax highlighting generated by Pygments:

fn main() {
    println!("Hello, world!");
}
from ludic.catalog.typography import CodeBlock

CodeBlock(
    """
    fn main() {
        println!("Hello, world!");
    }
    """,
    language="rust"
)

Pairs

#
from ludic.catalog.items import Pair, Key, Value

Pairs(
    Key("First Name:"),
    Value("John"),
    Key("Last Name:"),
    Value("Doe"),
)
First Name:
John
Last Name:
Doe

List

#
from ludic.catalog.lists import List, Item

List(
    Item("A"),
    Item("B"),
    Item("C"),
)
  • A
  • B
  • C

Numbered List

#
from ludic.catalog.lists import NumberedList, Item

NumberedList(
    Item("One"),
    Item("Two"),
    Item("Three"),
)
  1. One
  2. Two
  3. Three

Headers

#

The module ludic.catalog.headers contains components rendering as HTML headers (h1-h4).

H1

H2

H3

H4

from ludic.catalog.headers import H1, H2, H3, H4

H1("H1")
H2("H2")
H3("H3")
H4("H4")

The module also contains the Anchor component, which can be used to create an anchor link next to the header.

H4 With Anchor

#
from ludic.catalog.headers import Anchor, H4

H4("H4 With Anchor", anchor=Anchor("#", target="h4-with-anchor"))

It is possible to generate the anchor automatically using the anchor=True attribute:

H3 With Anchor

#
from ludic.catalog.headers import H3

H3("H3 With Anchor", anchor=True)
Made with Ludic and HTMX and 🐍 • DiscordGitHub