Font Awesome icons for markyp-html webpages.
Project description
markyp-fontawesome
Font Awesome 5 icons for web pages built with markyp-html.
Installation
The project is listed on the Python Package Index, it can be installed simply by executing pip install markyp-fontawesome
.
Getting started
Font Awesome setup
First of all, you should acquire a Font Awesome kit code here.
Creating icons for markyp-html
webpages
If you are not familiar with the basic concepts of markyp
, please start by having a look at its documentation here.
The following example code shows the creation of a webpage that displays a large, spinning Python logo over a solid square.
# markyp-html webpage element
from markyp_html import webpage
# Font Awesome imports
from markyp_fontawesome import kit_import, brand, solid, stack, IconStyle as IS
# Your Font Awesome kit code.
fa_kit_code = "a076d05399"
page = webpage(
# 3x-sized Font Awesome icon stack
stack.x3(
# Solid square icon for the background
solid("square", class_=IS.stacked_size_2x),
# Inverse Python brand icon for the foreground
brand("python", class_=f"{IS.stacked_size_2x} {IS.inverse} {IS.spin}"),
),
page_title="markyp-fontawesome demo",
# Font Awesome kit import with kit code
javascript=[kit_import(fa_kit_code)],
)
print(page)
Things to note from the example:
- You need to pass the Font Awesome import element to the
javascript
keyword argument ofwebpage()
to be able to display Font Awesome icons on the page. stack()
and its factory methods likex3()
let you create Font Awesome icon stacks.brand
andsolid
(and their factory methods) let you create Font Awesome icons of Brands and Solid styles. (Pro styles are also supported.)- The
IconStyle
enumeration class lets you customize icons by passing its properties to the icons'class_
argument.
For more details on how this package works, please see markyp and markyp-html.
For more details on how to use Font Awesome 5, see this page.
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 onmypy
.- 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_fontawesome
from the root directory of the project.
License - MIT
The library is open-sourced under the conditions of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file markyp-fontawesome-0.1910.0.tar.gz
.
File metadata
- Download URL: markyp-fontawesome-0.1910.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e6c30cabf5c3a4240970af64b3eb6ff1d2a3e048c5f19bc9a998b8a3c0da98 |
|
MD5 | a4f1e9e1a4e64c86750deccbdcd6d906 |
|
BLAKE2b-256 | da44011c657ae0f2ef1302bdc609dd8fe827a089b5b1ebd3b03b05219cb9806e |
File details
Details for the file markyp_fontawesome-0.1910.0-py3-none-any.whl
.
File metadata
- Download URL: markyp_fontawesome-0.1910.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4d7b9100ee8cb39a8bdd227c84d85922a27e6c7d84a401bccbbd623b25171c8 |
|
MD5 | 5067624bad16a3d287bbc1574e227457 |
|
BLAKE2b-256 | 6a7ca130891120837fa7a19fbb9f3789444a6b482ecf1f1e29f8dee9644574de |