-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Fanchengyan/dev
update to v0.2.1
- Loading branch information
Showing
26 changed files
with
424 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
============= | ||
Release notes | ||
============= | ||
|
||
This is the list of changes to MyST Sphinx Gallery between each release. For full details, see the `commit logs <https://github.com/Fanchengyan/myst-sphinx-gallery/commits/main/>`_. For install and usage instructions, see :ref:`quick_start`. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
v0.2.1 | ||
v0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
================================== | ||
What’s new in 0.2.0 (Aug 17, 2024) | ||
================================== | ||
|
||
|
||
Setup by extension | ||
------------------ | ||
|
||
Now you can add the ``myst_sphinx_gallery`` extension to the ``extensions`` | ||
list and specify the ``myst_sphinx_gallery_config`` variable in the | ||
``conf.py`` file to configure the gallery. | ||
|
||
.. code-block:: python | ||
:caption: conf.py | ||
:emphasize-lines: 1, 9 | ||
extensions = [ | ||
..., # other extensions | ||
"myst_sphinx_gallery", | ||
] | ||
from pathlib import Path | ||
from myst_sphinx_gallery import GalleryConfig | ||
myst_sphinx_gallery_config = GalleryConfig( | ||
examples_dirs="../../examples", | ||
gallery_dirs="auto_examples", | ||
root_dir=Path(__file__).parent, | ||
notebook_thumbnail_strategy="code", | ||
thumbnail_strategy="last", | ||
) | ||
The parameters in the ``myst_sphinx_gallery_config`` variable will be used to | ||
configure the gallery. Available parameters can be found in the | ||
:class:`~myst_sphinx_gallery.GalleryConfig` class. | ||
|
||
.. tip:: | ||
|
||
- The ``myst_sphinx_gallery_config`` variable can either be a instance of :class:`~myst_sphinx_gallery.GalleryConfig` class or a dictionary with the same keys as the :class:`~myst_sphinx_gallery.GalleryConfig` class. | ||
- The :class:`~myst_sphinx_gallery.GalleryConfig` is recommended as it | ||
provides type hints, which can be helpful for IDEs and linters. | ||
|
||
More details can be found in the :ref:`configuration` section. | ||
|
||
Enhancements for customizing | ||
---------------------------- | ||
|
||
Thumbnail Configuration | ||
^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Added a new class :class:`~myst_sphinx_gallery.ThumbnailConfig` to configure | ||
the thumbnail settings. The class supports custom thumbnail sizes, operations, | ||
operation arguments, quality, and more. | ||
|
||
.. code-block:: python | ||
:caption: conf.py | ||
:emphasize-lines: 1, 9 | ||
from myst_sphinx_gallery import generate_gallery, GalleryConfig, ThumbnailConfig | ||
generate_gallery( | ||
GalleryConfig( | ||
examples_dirs="../../examples3", | ||
gallery_dirs="auto_examples3", | ||
root_dir=Path(__file__).parent, | ||
thumbnail_config=ThumbnailConfig( | ||
ref_size=(320, 320), | ||
operation="pad", | ||
operation_kwargs={"color": "orange"}, | ||
), | ||
..., # other configurations | ||
) | ||
) | ||
Customizing layout | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
In this release, we added the ability to customize the layout of the gallery | ||
using the :class:`~myst_sphinx_gallery.Grid` and | ||
:class:`~myst_sphinx_gallery.GridItemCard` classes. | ||
|
||
Following code is an example of customizing the layout of the gallery: | ||
|
||
.. code-block:: python | ||
:caption: conf.py | ||
from myst_sphinx_gallery import generate_gallery, GalleryConfig, Grid, GridItemCard | ||
generate_gallery( | ||
GalleryConfig( | ||
examples_dirs="../../examples3", | ||
gallery_dirs="auto_examples3", | ||
root_dir=Path(__file__).parent, | ||
grid=Grid( | ||
grid_option=(1, 2, 2, 2), | ||
margin=3, | ||
padding=2, | ||
), | ||
grid_item_card=GridItemCard(columns=5, margin=3, padding=3), | ||
..., # other configurations | ||
) | ||
) | ||
You can also using CSS to customize the layout of the gallery. More details | ||
can be found in the :ref:`custom` section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
================================== | ||
What’s new in 0.2.1 (Aug 17, 2024) | ||
================================== | ||
|
||
Enhancements | ||
------------ | ||
|
||
Thumbnails | ||
^^^^^^^^^^ | ||
|
||
:class:`~myst_sphinx_gallery.ThumbnailConfig` now supports two new options: | ||
``quality_static`` and ``quality_animated``, to control the quality of those | ||
two types of thumbnails separately. | ||
|
||
|
||
Cross-referencing | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
- :class:`~myst_sphinx_gallery.GalleryConfig` now supports a new option: | ||
``target_prefix`` to customize the prefix of the target for the | ||
cross-referencing. | ||
- ``GALLERY_HEADER.rst`` now will be added a target automatically based on the | ||
folder name. | ||
|
||
Changes | ||
------- | ||
|
||
Code linter and formatter now change to `ruff <https://docs.astral.sh/ruff/>`_ | ||
from `black <https://black.readthedocs.io/en/stable/>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ Highlight Features | |
examples | ||
api/index | ||
contributing/index | ||
changelog/index | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.