Giter Site home page Giter Site logo

greyclab / gmic-sphinx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from myselfhimself/gmic-sphinx

0.0 0.0 0.0 31.21 MB

A Sphinx extension for displaying G'MIC commands as images using the gmic-py Python binding

Home Page: https://pypi.org/project/gmic-sphinx/

License: Other

Python 100.00%

gmic-sphinx's Introduction

gmic-sphinx

PyPI version

A Sphinx extension for displaying G'MIC command results as images using the gmic-py Python binding.

Usage

This Sphinx extension adds a new directive name gmicpic that takes any gmic expression as input and outputs an image and the gmic command below as caption (other could come later). It has been tested with Sphinx's html builder only for now.

It works only with the reStructuredText (aka ReST) documentation format, not Markdown or others.

In any of your .rst file, add the following:

.. gmicpic:: your gmic command

For example:

.. gmicpic:: sp earth blur 4 output earthy.png

will yield a picture file-named earthy.png followed by the command as caption:

Image of gmic-library-blurred earth

sp earth blur 4 output earthy.png

G'MIC command pre-processing

  1. that the output parameter is optional.
  2. In order to prevent proxy-blocking issues at docs build-time, G'MIC's samples are stored in this extension:
.. gmicpic:: sp leno blur 4

will yield a picture file-named with a unique id cce2fce2-e6fc-11ea-9e0e-8cec4b8c0881.png followed by the command as caption:

Image of gmic-library-blurred leno

sp leno blur 4

...implies that leno.png exists in the gmic_samples directory (we have done it for you for <=2020 image samples already). The resulting implicit output image will be pre-stored in gmic-images/ with a unique-id generated .png filename.

Installing & set-up

Install this Python module from pypi.org (in the same virtual environment as Sphinx):

pip install gmic-sphinx

Edit your Sphinx documentation project's conf.py file and ensure you have line like:

extensions = ['gmic-sphinx']

You might need to add gmic-sphinx to your Python path.

Projects using this

This extension is used in the following projects:

Tests

Automated pytest test cases are run in the Github Actions tab. You can run them yourself as well in a Python >= 3.7 environment.

Install the test requirements:

pip install dev-requirements.txt

Install the package locally:

pip install .

Run the pytest test suite:

py.test tests/

Releasing

If you are maintainer and would like to trigger a new release for this project, you do not need any credential since they are stored as Github Secret for this project. You just have:

  1. Change the version number in gmic_sphinx/gmicpic.py's setup() function and gmic_sphinx/gmicpic.py's setup() function.
  2. to Git-push a new tag, as described in this Github Action Worfklow file.

License

This project is under the CeCILL License.

gmic-sphinx's People

Contributors

myselfhimself avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.