markyp
, markyp-html
and markyp-bootstrap4
from markyp_html.text import h3
from markyp_bootstrap4.alerts import alert
from markyp_bootstrap4.badges import span_badge
alert.primary(h3("Alert with", span_badge.primary("primary"), "context."))
from markyp_html.text import h3
from markyp_bootstrap4.alerts import dismissable
from markyp_bootstrap4.badges import span_badge
dismissable.danger(h3("Dismissable alert with", span_badge.danger("danger"), "context."))
from markyp_bootstrap4.breadcrumbs import breadcrumb
from markyp_html.inline import a, em, strong
breadcrumb(
a(strong("Home"), href="#"),
a("Topic", href="#"),
a("Subtopic", href="#"),
em("Current page")
)
<a></a>
, <button></button>
, <label></label>
, and <input>
elements<a></a>
, <button></button>
, <label></label>
, and <input>
elements<a></a>
, <button></button>
, <label></label>
, and <input>
elements<a></a>
, <button></button>
, <label></label>
, and <input>
elementsHungary is a country in Central Europe, spanning 93,030 square kilometres in the Carpathian Basin. With about 10 million inhabitants, Hungary is a medium-sized member state of the European Union. The official language is Hungarian, which is the most widely spoken Uralic language in the world...
The foundations of the Hungarian state were established in the late ninth century CE by the Hungarian grand prince Árpád following the conquest of the Carpathian Basin. His great-grandson Stephen I ascended the throne in 1000, converting his realm to a Christian kingdom. By the 12th century, Hungary became a regional power, reaching its cultural and political height in the 15th century...
The history of Budapest began when an early Celtic settlement transformed into the Roman town of Aquincum, the capital of Lower Pannonia. The Hungarians arrived in the territory in the late 9th century. The area was pillaged by the Mongols in 1241. Buda, the settlements on the west bank of the river, became one of the centres of Renaissance humanist culture by the 15th century...
from markyp_bootstrap4 import collapses
from markyp_bootstrap4.buttons import b_button
from markyp_bootstrap4.layout import row_break
from markyp_html.block import div
collapse_id = "collapse-1"
div(
b_button.primary("Toggle collapse", class_="mb-2", **collapses.button_args_for(collapse_id)),
row_break(),
collapses.collapse(
"Collapse content, closed by default.",
identifier=collapse_id
)
)
First and last name:
Email address:
@markyp-bootstrap4.org
from markyp_html.text import h1, p
from markyp_bootstrap4.jumbotrons import jumbotron
jumbotron(
h1("Jumbotron"),
p("With a lengthy description...")
)
from markyp_bootstrap4 import navbars
from markyp_bootstrap4 import navs
from markyp_html.block import div
collapse_id = "main-navbar-collapse"
navbars.navbar(
navbars.brand("markyp-bootstrap4"),
navbars.navbar_toggler(collapse_id=collapse_id),
navbars.collapse(
navs.nav_link("GitHub", href="https://github.com/volfpeter/markyp-bootstrap4", target="_blank", is_nav_item=True),
navs.nav_link("PyPI", href="https://pypi.org/project/markyp-bootstrap4", target="_blank", is_nav_item=True),
navs.nav_link("Bootstrap 4", href="https://getbootstrap.com/", target="_blank", is_nav_item=True),
id=collapse_id,
nav_factory=div,
),
expand_point=navbars.ExpandPoint.LG,
theme=navbars.Theme.DARK
)
from markyp_bootstrap4 import pagination
pagination.pagination(
*(pagination.page_item(item, active=index==3, href="#page-ref")
for index, item in enumerate(("Previous", "1", "2", "3", "Next"))),
aria_label="Pagination example",
position=pagination.PaginationPosition.CENTER,
size=pagination.PaginationSize.SMALL
)
from markyp_bootstrap4 import popovers
from markyp_bootstrap4.buttons import a_button, b_button
# Don't forget to add popovers.enable_popovers to the page.
b_button.primary("Popover - top", **popovers.popover("Content"))
b_button.primary("Popover - right", **popovers.popover("Content", placement=popovers.Placement.RIGHT))
# For auto-dismissed popovers to work, also add popovers.enable_auto_dismiss to the page.
a_button.info("Auto-dismissed - bottom", **popovers.popover("Content", auto_dismissed=True, placement=popovers.Placement.BOTTOM))
a_button.info("Auto-dismissed - left", **popovers.popover("Content", auto_dismissed=True, title="Title", placement=popovers.Placement.LEFT))
from markyp_bootstrap4 import progress
from markyp_bootstrap4.colors import bg
progress.progress("33%", value=33, bar_class=bg.primary, style="height: 2rem;"),
progress.progress("50%", value=50, bar_class=bg.secondary, striped=True, style="height: 1.5rem;"),
progress.progress(value=75, bar_class=bg.info, striped=True, animated=True),
progress.progress_base(
progress.progressbar(value=30, class_=bg.danger),
progress.progressbar(value=30, class_=bg.warning),
progress.progressbar(value=30, class_=bg.success),
style="height: 0.5rem;"
)
from markyp_bootstrap4 import tooltips
from markyp_bootstrap4.buttons import a_button
a_button.success(
"Tooltip button - top",
**tooltips.tooltip("Tooltip", placement=tooltips.Placement.TOP)
),
a_button.success(
"Tooltip button - bottom",
**tooltips.tooltip("Tooltip", placement=tooltips.Placement.BOTTOM)
),
a_button.success(
"Tooltip button - left",
**tooltips.tooltip("Tooltip", placement=tooltips.Placement.LEFT)
),
a_button.success(
"Tooltip button - right",
**tooltips.tooltip("Tooltip", placement=tooltips.Placement.RIGHT)
)