Metadata-Version: 2.4
Name: external-resources
Version: 0.3.0
Summary: Fetch and deploy external resources (CSS, JS, Fonts) for web services
Keywords: js,JavaScript,CSS,fonts,vendoring,web application,resources,web,installation
Author: Detlef Lannert
Author-email: Detlef Lannert <detlef@lannert.de>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Typing :: Typed
Requires-Dist: cyclopts
Requires-Dist: httpx
Requires-Dist: msgspec
Requires-Dist: pyyaml
Requires-Dist: packaging
Requires-Dist: pyproject-parser
Requires-Dist: rich
Requires-Dist: tomli-w
Requires-Dist: xdg-base-dirs>=6.0.2
Requires-Dist: uuid7>=0.1.0
Requires-Dist: niquests>=3.15.2
Maintainer: Detlef Lannert
Maintainer-email: Detlef Lannert <detlef@lannert.de>
Requires-Python: >=3.10
Project-URL: Changelog, https://github.com/detlefla/external_resources/blob/master/CHANGELOG.md
Project-URL: Homepage, https://github.com/detlefla/external_resources
Project-URL: Issues, https://github.com/detlefla/external_resources/issues
Project-URL: Repository, https://github.com/detlefla/external_resources.git
Description-Content-Type: text/x-rst

Fetch and deploy external resource files
========================================

Sorry, this file is outdated – will be updated soon. Don't read on. Thank you.

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

#. Install this package (as editable or from the repository) into your virtual environment.

#. Install ``invoke``,
   create a ``tasks.py`` file in the root directory of your project and insert these lines::

      from external_resources.tasks import (
              get_resources, 
              check_resource,
              deploy_resources,
              )

#. Create a file ``external_resources.yaml`` containing information about the external
   resources that you will be needing. An example is supplied with this package.

#. Create (or edit) the file ``invoke.yaml`` (in the same directory as ``tasks.py``);
   it should specify the path of your ``external_resources.yaml`` registry and
   a list of resource names and optional version specifiers (like in a requirements file).
   
   Example::
   
      external_resources:
         required:
            -  bootstrap5
            -  bootstrap5_js
            -  htmx ~= 1.7
            -  lineawesome13 ~= 1.3
         config_file: external_resources.yaml
         dir_name: static_external

   The path to the ``config_file`` can either be an absolute path or relative to the
   directory of ``invoke.yaml``.
   
   The ``dir_name`` option should point to a directory where the external resources
   will be installed (on your local host); depending on the kind of the resource they
   will go into subdirectories ``css``, ``js``, or ``fonts``.

#. The invoke command ::
   
      inv get-resources
   
   will try to download the resources specified as ``required`` into the ``dir_name``
   target directory.
   
   If the integrity check code for a resource is not known, the command ::
   
      inv check-resource NAME
   
   will calculate and display this code which then can be pasted into the registry
   to make sure the correct file was retrieved on a later download.
   
   With ::
   
      inv deploy-resources
   
   the resources from the local ``dir_name`` directory (and its subdirectories) will
   be rsync'ed to the target host specified by the ``target`` option in ``invoke.yaml``.
