From 646cb4ea48ca618eb2b9a44313000ea0892f8204 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Jan 2025 17:04:19 -0500 Subject: [PATCH] docs: add iconify docs --- docs/utilities/iconify.md | 36 ++++++++++++++++++++++++++++++++++++ docs/utilities/index.md | 6 ++++++ mkdocs.yml | 4 ++-- pyproject.toml | 10 +++++----- 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 docs/utilities/iconify.md diff --git a/docs/utilities/iconify.md b/docs/utilities/iconify.md new file mode 100644 index 00000000..cf0de558 --- /dev/null +++ b/docs/utilities/iconify.md @@ -0,0 +1,36 @@ +# QIconifyIcon + +[Iconify](https://iconify.design/) is an icon library that includes 150,000+ +icons from most major icon sets including Bootstrap, FontAwesome, Material +Design, and many more; each available as individual SVGs. Unlike the +[`superqt.fonticon` module](./fonticon.md), `superqt.QIconifyIcon` does not require any additional +dependencies or font files to be installed. Icons are downloaded (and cached) +on-demand from the Iconify API, using [pyconify](https://github.com/pyapp-kit/pyconify) + +Search availble icons at +Once you find one you like, use the key in the format `"prefix:name"` to create an +icon: `QIconifyIcon("bi:bell")`. + +## Basic Example + +```python +from qtpy.QtCore import QSize +from qtpy.QtWidgets import QApplication, QPushButton + +from superqt import QIconifyIcon + +app = QApplication([]) + +btn = QPushButton() +btn.setIcon(QIconifyIcon("fluent-emoji-flat:alarm-clock")) +btn.setIconSize(QSize(60, 60)) +btn.show() + +app.exec() +``` + +{{ show_widget(225) }} + +::: superqt.QIconifyIcon + options: + heading_level: 3 diff --git a/docs/utilities/index.md b/docs/utilities/index.md index 4ff6ecc5..743ae8ec 100644 --- a/docs/utilities/index.md +++ b/docs/utilities/index.md @@ -12,6 +12,12 @@ | [`IconOpts`](./fonticon.md#superqt.fonticon.IconOpts) | Options for rendering an icon | | [`Animation`](./fonticon.md#superqt.fonticon.Animation) | Base class for adding animations to a font-icon. | +## SVG Icons + +| Object | Description | +| ----------- | --------------------- | +| [`QIconifyIcon`](./iconify.md) | QIcons backed by the [Iconify](https://iconify.design/) icon library. | + ## Threading tools | Object | Description | diff --git a/mkdocs.yml b/mkdocs.yml index b53619d0..6d841e53 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,8 +32,8 @@ markdown_extensions: - attr_list - md_in_html - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - toc: permalink: "#" diff --git a/pyproject.toml b/pyproject.toml index 26a14876..213dc834 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,11 +67,11 @@ dev = [ "types-Pygments", ] docs = [ - "mkdocs-macros-plugin", - "mkdocs-material", - "mkdocstrings[python]", - "pint", - "cmap", + "mkdocs-macros-plugin ==1.3.7", + "mkdocs-material ==9.5.49", + "mkdocstrings ==0.27.0", + "mkdocstrings-python ==1.13.0", + "superqt[font-fa5, cmap, quantity]", ] quantity = ["pint"] cmap = ["cmap >=0.1.1"]