Skip to content

Commit

Permalink
Merge pull request #48 from SylvainCorlay/docs
Browse files Browse the repository at this point in the history
Improve documentation
  • Loading branch information
SylvainCorlay authored Sep 24, 2016
2 parents 140b994 + a312f8d commit 8ad8cff
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 17 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
QtAwesome
=========
# QtAwesome

[![Build Status](https://travis-ci.org/spyder-ide/qtawesome.svg?branch=master)](https://travis-ci.org/spyder-ide/qtawesome)
[![Documentation Status](https://readthedocs.org/projects/qtawesome/badge/?version=latest)](http://qtawesome.readthedocs.org/en/latest/?badge=latest)

## Description

Expand Down
4 changes: 4 additions & 0 deletions docs/source/api_documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
API Reference Documentation
---------------------------

.. automodule:: qtawesome
20 changes: 6 additions & 14 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
qtawesome
=========

Contents:
================================
qtawesome: Iconic Fonts for PyQt
================================

.. toctree::
:maxdepth: 2

qtawesome

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

introduction
usage
api_documentation
9 changes: 9 additions & 0 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Introduction
------------

QtAwesome enables iconic fonts such as Font Awesome and Elusive Icons in PyQt
and PySide applications.

It started as a Python port of the QtAwesome_ C++ library by Rick Blommers.

.. _QtAwesome: https://github.com/gamecreature/QtAwesome
1 change: 0 additions & 1 deletion docs/source/qtawesome.rst

This file was deleted.

58 changes: 58 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Usage
-----

.. code:: python
import qtawesome as qta
Use Font Awesome and Elusive Icons.

.. code:: python
# Get icons by name.
fa_icon = qta.icon('fa.flag')
fa_button = QtGui.QPushButton(fa_icon, 'Font Awesome!')
asl_icon = qta.icon('ei.asl')
elusive_button = QtGui.QPushButton(asl_icon, 'Elusive Icons!')
Apply some styling

.. code:: python
# Styling icons
styling_icon = qta.icon('fa.music',
active='fa.legal',
color='blue',
color_active='orange')
music_button = QtGui.QPushButton(styling_icon, 'Styling')
Stack multiple icons

.. code:: python
# Stacking icons
camera_ban = qta.icon('fa.camera', 'fa.ban',
options=[{
'scale_factor': 0.5,
'active': 'fa.legal'
}, {
'color': 'red'
}])
stack_button = QtGui.QPushButton(camera_ban, 'Stack')
stack_button.setIconSize(QtCore.QSize(32, 32))
Animations

.. code:: python
# Spining icons
spin_button = QtGui.QPushButton(' Spinning icon')
spin_icon = qta.icon('fa.spinner', color='red',
animation=qta.Spin(spin_button))
spin_button.setIcon(spin_icon)
Screenshot

.. image:: ../../qtawesome-screenshot.gif

0 comments on commit 8ad8cff

Please sign in to comment.