Package: markyp-bootstrap4
markyp-bootstrap4Create Bootstrap 4 web pages using purely Python.The project is built onmarkypandmarkyp-html.InstallationThe project is listed on the Python Package Index, it can be installed simply by executingpip install markyp-bootstrap4.Getting startedIf you are not familiar with the basic concepts ofmarkyp, please start by having a look at its documentationhere.For a demo of the capabilities ofmarkyp-bootstrap4, head over to the project'sGitHub Pages. The source code of that page was generated by thedemo.pyscript that you can find at the root of this repository.The following example shows how to create a login form usingmarkyp-bootstrap4.frommarkyp_htmlimportwebpagefrommarkyp_html.formsimportformfrommarkyp_bootstrap4importreqfrommarkyp_bootstrap4.layoutimportcontainer,one,col,margin,offsetfrommarkyp_bootstrap4.buttonsimportb_buttonfrommarkyp_bootstrap4.formsimportform_group,form_check,form_check_label,input_,textdeflogin():returnform(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 withfrom markyp_bootstrap4 import req, and the required CSS and JavaScript imports should be added to thehead_elementsof the webpage.Thelayoutmodule contains the components you can use to define the layout of the webpage.markyp_bootstrap4components are grouped the same way as components in Bootstrap 4's documentation. The only difference is here every module name is in plural form.Related projectsmarkyp-html: Create custom or non-Bootstrap 4 components for you webpage.markyp-fontawesome: Add Font Awesome 5 icons to your webpage.markyp-highlightjs: Add syntax-highlighted code to your webpage.Community guidelinesIn 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 guidelinesEvery 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, includingPEP 484type annotations.mypyis used to type-check the codebase, submitted code should not produce typing errors. Seethis pagefor more information onmypy.Smallfixes can be submitted simply by creating a pull request.Non-trivial changes should have an associatedissuein the issue tracker that commits must reference (typically by adding#refs <issue-id>to the end of commit messages).Please writetestsfor the changes you make (if applicable).If you have any questions about contributing to the project, please contact the project owner.As mentioned in thecontribution guidelines, the project is type-checked usingmypy, so first of all, the project must passmypy's static code analysis.The project is tested usingpytest. The chosen test layout is that tests are outside the application code, seethis pagefor details on what it means in practice.Ifpytestis installed, the test set can be executed using thepytest testcommand from within the project directory.Ifpytest-covis also installed, a test coverage report can be generated by executingpytest test --cov markyp_bootstrap4from the root directory of the project.License - MITThe library is open-sourced under the conditions of the MITlicense.