22sphinx-panels
33=============
44
5- .. contents ::
6- :local:
7- :depth: 2
8-
9-
105A sphinx extension for creating panels in a grid layout or as drop-downs.
116
127- The ``panels `` directive creates panels of content in a grid layout, utilising both the bootstrap 4
@@ -15,6 +10,7 @@ A sphinx extension for creating panels in a grid layout or as drop-downs.
1510- The ``link-button `` directive creates a click-able button, linking to a URL or reference,
1611 and can also be used to make an entire panel click-able.
1712- The ``dropdown `` directive creates toggle-able content.
13+ - ``opticon `` and ``fa `` roles allow for inline icons to be added.
1814
1915.. code-block :: rst
2016
@@ -28,7 +24,7 @@ A sphinx extension for creating panels in a grid layout or as drop-downs.
2824
2925 ---
3026
31- .. dropdown:: Bottom-left panel
27+ .. dropdown:: :fa:`eye,mr-1` Bottom-left panel
3228
3329 Hidden content
3430
@@ -48,7 +44,7 @@ A sphinx extension for creating panels in a grid layout or as drop-downs.
4844
4945 ---
5046
51- .. dropdown :: Bottom-left panel
47+ .. dropdown :: :fa:`eye,mr-1` Bottom-left panel
5248
5349 Hidden content
5450
@@ -58,8 +54,8 @@ A sphinx extension for creating panels in a grid layout or as drop-downs.
5854 :text: Clickable Panel
5955 :classes: stretched-link
6056
61- .. dropdown :: See this documentation in other themes...
62- :title: bg -info text-white
57+ .. dropdown :: :fa:`eye,mr-1` See this documentation in other themes
58+ :title: text -info font-weight-bold
6359
6460 Click the links to see the documentation built with:
6561
@@ -69,11 +65,20 @@ A sphinx extension for creating panels in a grid layout or as drop-downs.
6965 - `sphinx-book-theme <https://sphinx-panels.readthedocs.io/en/sphinx-book-theme/ >`_
7066
7167
72- .. tip ::
68+ .. panels ::
69+ :column: col-lg-12 p-0
70+ :header: text-secondary font-weight-bold
71+
72+ :fa: `arrows-alt,mr-1 ` Adaptive Sizing
73+
74+ ^^^
7375
7476 Try shrinking the size of this window,
75- to see how the panels realign to compensate for small screens.
77+ to see how the panels above realign to compensate for small screens.
7678
79+ .. contents ::
80+ :local:
81+ :depth: 2
7782
7883Installation
7984============
@@ -564,6 +569,45 @@ Adding the ``animate`` option will trigger an animation when the content of the
564569
565570 Current available inputs: ``fade-in ``, ``fade-in-slide-down ``
566571
572+ Inline Icons
573+ ============
574+
575+ Inline icons can be added to your text from either the
576+ `GitHub octicon <https://octicons-git-v2.primer.now.sh/octicons/ >`_ or
577+ `FontAwesome <https://fontawesome.com/icons?d=gallery&m=free >`_ libraries.
578+
579+ ====================================================== ===============================================
580+ rST Output
581+ ====================================================== ===============================================
582+ ``:opticon:`report` `` :opticon: `report `
583+ ``:opticon:`x-circle,text-white bg-danger,size=24` `` :opticon: `x-circle,text-white bg-danger,size=24 `
584+ ``:fa:`save` `` :fa: `save `
585+ ``:fa:`spinner,text-white bg-primary fa-2x,style=fa` `` :fa: `spinner,text-white bg-primary fa-2x,style=fa `
586+ ====================================================== ===============================================
587+
588+ Note that the theme you are using does not already include the FontAwesome CSS,
589+ it should be loaded in your ``conf.py ``,
590+ with the `html_css_files <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_css_files >`_ option, e.g.:
591+
592+ .. code-block :: python
593+
594+ html_css_files = [" https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" ]
595+
596+ By default, icons will only be output in HTML formats.
597+ But if you want fontawesome icons to be output on LaTeX, using the `fontawesome package <https://ctan.org/pkg/fontawesome >`_,
598+ you can add to your ``conf.py ``:
599+
600+ .. code-block :: python
601+
602+ panels_add_fontawesome_latex = True
603+
604+ Additional classes can be added after a comma delimiter.
605+ Also the size (16px or 24px) can be set for opticons, and the style/prefix for fontawesome (version 5).
606+
607+ .. seealso ::
608+
609+ https://www.w3schools.com/icons/fontawesome_icons_intro.asp
610+
567611Div Directive
568612=============
569613
0 commit comments