Skip to content

Commit

Permalink
Switching README back to RST for build process
Browse files Browse the repository at this point in the history
  • Loading branch information
spilth committed Oct 31, 2024
1 parent 7a45224 commit 1308ad8
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Invenio-Previewer-Geospatial
============================

|ci-badge| |license|

Provides previewers for geospatial file formats

Installation
------------

To add this package to your Invenio RDM instance:

Add Package
~~~~~~~~~~~

.. code:: bash
$ cd your-invenio-rdm
$ pipenv install git+https://github.com/nyudlts/invenio-previewer-geospatial.git
Add Previews to Invenio Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In ``invenio.cfg`` edit (or add) ``PREVIEWER_PREVIEWERS_ORDER`` and
``PREVIEWER_PREFERENCE`` to include the previewers provided by this
package:

::

PREVIEWER_PREVIEWERS_ORDER = [
"invenio_previewer.extensions.gpx",
"invenio_previewer.extensions.csv_papaparsejs",
"invenio_previewer.extensions.json_prismjs",
"invenio_previewer.extensions.simple_image",
"invenio_previewer.extensions.xml_prismjs",
"invenio_previewer.extensions.mistune",
"invenio_previewer.extensions.pdfjs",
"invenio_previewer.extensions.zip",
"invenio_previewer.extensions.ipynb",
"invenio_previewer.extensions.audio_videojs",
"invenio_previewer.extensions.video_videojs",
"invenio_previewer.extensions.txt_previewer",
"invenio_previewer.extensions.default",
]

PREVIEWER_PREFERENCE = [
"gpx",
"csv_papaparsejs",
"json_prismjs",
"simple_image",
"xml_prismjs",
"mistune",
"pdfjs",
"zip",
"ipynb",
"audio_videojs",
"video_videojs",
"txt",
]

Allow Images from Open Street Map
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In ``invenio.cfg`` edit ``APP_DEFAULT_SECURE_HEADERS`` to allow images
from OpenStreetMap:

::

APP_DEFAULT_SECURE_HEADERS = {
'content_security_policy': {
'default-src': [
"'self'",
'data:',
"'unsafe-inline'",
"blob:",
],
'img-src': [
"'self'",
"https://*.openstreetmap.org",
'data:',
]
},
...
}

Development
-----------

To check out the project, install dependencies and run the test suite,
do the following:

.. code:: bash
$ git clone [email protected]:nyudlts/invenio-previewer-geospatial.git
$ cd invenio-previewer-geospatial
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install --upgrade pip
$ pip install ".[all,tests]"
$ ./run-tests.sh
.. |ci-badge| image:: https://github.com/nyudlts/invenio-previewer-geospatial/workflows/CI/badge.svg
:target: https://github.com/nyudlts/invenio-previewer-geospatial/actions?query=workflow%3ACI
.. |license| image:: https://img.shields.io/github/license/nyudlts/invenio-previewer-geospatial.svg
:target: https://github.com/nyudlts/invenio-previewer-geospatial/blob/master/LICENSE

0 comments on commit 1308ad8

Please sign in to comment.