Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Build Status Downloads Downloads Downloads

markyp-bootstrap4

Create Bootstrap 4 web pages using purely Python.

The project is built on markyp and markyp-html.

Installation

The project is listed on the Python Package Index, it can be installed simply by executing pip install markyp-bootstrap4.

Getting started

If you are not familiar with the basic concepts of markyp, please start by having a look at its documentation here.

For a demo of the capabilities of markyp-bootstrap4, head over to the project's GitHub Pages. The source code of that page was generated by the demo.py script that you can find at the root of this repository.

The following example shows how to create a login form using markyp-bootstrap4.

from markyp_html import webpage
from markyp_html.forms import form

from markyp_bootstrap4 import req
from markyp_bootstrap4.layout import container, one, col, margin, offset
from markyp_bootstrap4.buttons import b_button
from markyp_bootstrap4.forms import form_group, form_check, form_check_label, input_, text

def login():
    return form(
        form_group(
            text.h5("Email"),
            input_.email(placeholder="Enter your email address")
        ),
        form_group(
            text.h5("Password"),
            input_.password(placeholder="Enter your password")
        ),
        form_check(
            input_.checkbox(),
            form_check_label("Remember Me"),
            class_=margin(bottom=2)
        ),
        b_button.primary("Sign In", type="submit")
    )

page = webpage(
    container(
        one(
            login(),
            md=6,
            class_=offset(md=3)
        )
    ),
    page_title="markyp-bootstrap4 example",
    head_elements=[
        req.bootstrap_css,
        *req.all_js
    ]
)

print(page)

Here is a list of things to notice in the example:

  • Bootstrap 4's requirements can be import with from markyp_bootstrap4 import req, and the required CSS and JavaScript imports should be added to the head_elements of the webpage.
  • The layout module contains the components you can use to define the layout of the webpage.
  • markyp_bootstrap4 components are grouped the same way as components in Bootstrap 4's documentation. The only difference is here every module name is in plural form.

Community guidelines

In general, please treat each other with respect and follow the below guidelines to interact with the project:

  • Questions, feedback: Open an issue with a [Question] <issue-title> title.
  • Bug reports: Open an issue with a [Bug] <issue-title> title, an adequate description of the bug, and a code snippet that reproduces the issue if possible.
  • Feature requests and ideas: Open an issue with an [Enhancement] <issue-title> title and a clear description of the enhancement proposal.

Contribution guidelines

Every form of contribution is welcome, including documentation improvements, tests, bug fixes, and feature implementations.

Please follow these guidelines to contribute to the project:

  • Make sure your changes match the documentation and coding style of the project, including PEP 484 type annotations.
  • mypy is used to type-check the codebase, submitted code should not produce typing errors. See this page for more information on mypy.
  • Small fixes can be submitted simply by creating a pull request.
  • Non-trivial changes should have an associated issue in the issue tracker that commits must reference (typically by adding #refs <issue-id> to the end of commit messages).
  • Please write tests for the changes you make (if applicable).

If you have any questions about contributing to the project, please contact the project owner.

As mentioned in the contribution guidelines, the project is type-checked using mypy, so first of all, the project must pass mypy's static code analysis.

The project is tested using pytest. The chosen test layout is that tests are outside the application code, see this page for details on what it means in practice.

If pytest is installed, the test set can be executed using the pytest test command from within the project directory.

If pytest-cov is also installed, a test coverage report can be generated by executing pytest test --cov markyp_bootstrap4 from the root directory of the project.

License - MIT

The library is open-sourced under the conditions of the MIT license.

Metadata

Release files for markyp-bootstrap4 0.2210.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markyp-bootstrap4 0.2210.1
File Size Uploaded Provenance Actions
markyp-bootstrap4-0.2210.1.tar.gz 47.2 kB Without provenance Details for markyp-bootstrap4-0.2210.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for markyp-bootstrap4 0.2210.1
File Interpreter ABI Platform Actions
markyp_bootstrap4-0.2210.1-py3-none-any.whl Python 3 none any Details for markyp_bootstrap4-0.2210.1-py3-none-any.whl

Total release size: 86.4 kB

Release files / markyp-bootstrap4-0.2210.1.tar.gz

Download URL markyp-bootstrap4-0.2210.1.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c19c13c1b5076def4ed7965a016a9add4ac0d461a614c5b53cc0f20cd897c4f4
BLAKE2b-256 checksum
How to use checksums
e85963685742283955691c601ab88332348b0cd8908055757b6e07d9509487f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / markyp_bootstrap4-0.2210.1-py3-none-any.whl

Download URL markyp_bootstrap4-0.2210.1-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f875c877e23be9cb90766c12cea523b56d37329e7407071e42ea56fea40aa458
BLAKE2b-256 checksum
How to use checksums
4bdb78bd986cb60a54d30be60e4b10812398c69ac4749b1700c6b5d8be2e50cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Security for markyp-bootstrap4 0.2210.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page