Edit
Typography
The module ludic.catalog.typography
contains the following components:
Link
#This text contains a link.
1 from ludic.catalog.typography import Link 2 3 Link("link", to="https://getludic.dev") # appends target="_blank" 4 Link("link", to="/") # does not append target="_blank"
Paragraph
#Here is some text wrapped in a paragraph.
1 from ludic.catalog.typography import Paragraph 2 3 Paragraph("Here is some text wrapped in a paragraph.")
Code
#This text contains code: let mut x = 0;
1 from ludic.catalog.typography import Code 2 3 Code("let mut x = 0;")
Code Block
#The following block contains a Rust code with syntax highlighting generated by Pygments:
1 fn main() { 2 println!("Hello, world!"); 3 }
1 from ludic.catalog.typography import CodeBlock 2 3 CodeBlock( 4 """ 5 fn main() { 6 println!("Hello, world!"); 7 } 8 """, 9 language="rust" 10 )
Pairs
#1 from ludic.catalog.items import Pair, Key, Value 2 3 Pairs( 4 Key("First Name:"), 5 Value("John"), 6 Key("Last Name:"), 7 Value("Doe"), 8 )
- First Name:
- John
- Last Name:
- Doe
List
#1 from ludic.catalog.lists import List, Item 2 3 List( 4 Item("A"), 5 Item("B"), 6 Item("C"), 7 )
- A
- B
- C
Numbered List
#1 from ludic.catalog.lists import NumberedList, Item 2 3 NumberedList( 4 Item("One"), 5 Item("Two"), 6 Item("Three"), 7 )
- One
- Two
- Three
Headers
#The module ludic.catalog.headers
contains components rendering as HTML headers (h1-h4).
H1
H2
H3
H4
1 from ludic.catalog.headers import H1, H2, H3, H4 2 3 H1("H1") 4 H2("H2") 5 H3("H3") 6 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
#1 from ludic.catalog.headers import Anchor, H4 2 3 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
#1 from ludic.catalog.headers import H3 2 3 H3("H3 With Anchor", anchor=True)