arches-templating


Namearches-templating JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttp://archesproject.org/
SummaryArches templating provides an extensible templating engine for various file types
upload_time2023-10-12 19:48:37
maintainer
docs_urlNone
authorFarallon Geographics, Inc
requires_python
licenseGNU AGPL3
keywords django arches cultural heritage
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # arches-templating

An application to add templating/reporting capabilities to Arches.  

## Installation

Install via pip, arches-templating (forthcoming).  Or install a development version by pulling down the repository and running `pip install` from the local repo directory.

Add the arches_templating module to the project's list of INSTALLED_APPLICATIONS.

Run migrations from your project to install database.

`python manage.py migrate arches_templating`

Add urls to your project's urls.py if you wish to use the built-in view to submit your templates.  

`path("your-base-url-here/", include("arches_templating.urls"))`

Alternatively, you can call the template engine directory and provide your data container and template ID.  

## The Data Container

The data container is a json-based object that is provided to the template engine along with the template ID.  It is referenced by the template designer when creating the template - the paths in the template should match the ones being provided by the data container.

## Adding Templates

Currently, the only way to add templates is via the django admin interface.  Visit the /admin url of your site and upload your templates there.

## Creating Templates

We currently support five base tags.  

* value
* context
* if
* image
* end

Each of these tags requires a "path" attribute and is prefixed by "arches:".  For example:

`<arches:value path="path/in/data/container">`

An `end` tag is required for the `context` and `if` tags.

The `context` tag will change the "context" of its child tags to whatever its path matches within the data container provided to the template engine.  

Functionally, this means that

`<arches:value path="foo/bar">`

and 

```
<arches:context path="foo">
<arches:value path="bar">
<arches:end>
```

are functionally equivalent and referencing the same data within the data container.  

If the context is pointing to an array, this is currently the method being used to render table rows.  

Elements can be optionally rendered by an `if` tag.

```
<arches:if path="foo">
Some optionally rendered content, depending on value at the "foo" path of your data container.
<arches:end>
```

An `image` tag can render an image from a URL or (optionally) a base64 encoded image from the backend.
`<arches:image path=“path_to_image_or_path_to_url”>`


The `if` tag can be inverted by providing an "inverse" attribute set to true.

`<arches:if inverse="true" path="foo">`

Currently powerpoint, word, and spreadsheet templates are supported.  We welcome the addition of more implementations and improvements/bug fixes on the ones that currently exist.




            

Raw data

            {
    "_id": null,
    "home_page": "http://archesproject.org/",
    "name": "arches-templating",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django arches cultural heritage",
    "author": "Farallon Geographics, Inc",
    "author_email": "dev@fargeo.com",
    "download_url": "https://files.pythonhosted.org/packages/19/11/f8a1d9ba44bc2bca72eb1bad7676c281af6bf2b256ad79bf4df60abcbd80/arches-templating-0.1.2.tar.gz",
    "platform": null,
    "description": "# arches-templating\n\nAn application to add templating/reporting capabilities to Arches.  \n\n## Installation\n\nInstall via pip, arches-templating (forthcoming).  Or install a development version by pulling down the repository and running `pip install` from the local repo directory.\n\nAdd the arches_templating module to the project's list of INSTALLED_APPLICATIONS.\n\nRun migrations from your project to install database.\n\n`python manage.py migrate arches_templating`\n\nAdd urls to your project's urls.py if you wish to use the built-in view to submit your templates.  \n\n`path(\"your-base-url-here/\", include(\"arches_templating.urls\"))`\n\nAlternatively, you can call the template engine directory and provide your data container and template ID.  \n\n## The Data Container\n\nThe data container is a json-based object that is provided to the template engine along with the template ID.  It is referenced by the template designer when creating the template - the paths in the template should match the ones being provided by the data container.\n\n## Adding Templates\n\nCurrently, the only way to add templates is via the django admin interface.  Visit the /admin url of your site and upload your templates there.\n\n## Creating Templates\n\nWe currently support five base tags.  \n\n* value\n* context\n* if\n* image\n* end\n\nEach of these tags requires a \"path\" attribute and is prefixed by \"arches:\".  For example:\n\n`<arches:value path=\"path/in/data/container\">`\n\nAn `end` tag is required for the `context` and `if` tags.\n\nThe `context` tag will change the \"context\" of its child tags to whatever its path matches within the data container provided to the template engine.  \n\nFunctionally, this means that\n\n`<arches:value path=\"foo/bar\">`\n\nand \n\n```\n<arches:context path=\"foo\">\n<arches:value path=\"bar\">\n<arches:end>\n```\n\nare functionally equivalent and referencing the same data within the data container.  \n\nIf the context is pointing to an array, this is currently the method being used to render table rows.  \n\nElements can be optionally rendered by an `if` tag.\n\n```\n<arches:if path=\"foo\">\nSome optionally rendered content, depending on value at the \"foo\" path of your data container.\n<arches:end>\n```\n\nAn `image` tag can render an image from a URL or (optionally) a base64 encoded image from the backend.\n`<arches:image path=\u201cpath_to_image_or_path_to_url\u201d>`\n\n\nThe `if` tag can be inverted by providing an \"inverse\" attribute set to true.\n\n`<arches:if inverse=\"true\" path=\"foo\">`\n\nCurrently powerpoint, word, and spreadsheet templates are supported.  We welcome the addition of more implementations and improvements/bug fixes on the ones that currently exist.\n\n\n\n",
    "bugtrack_url": null,
    "license": "GNU AGPL3",
    "summary": "Arches templating provides an extensible templating engine for various file types",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "http://archesproject.org/"
    },
    "split_keywords": [
        "django",
        "arches",
        "cultural",
        "heritage"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49802c5e1a6e0f3ecded18d7af81e0ab39ad76da19cb2ed4e78919883f1ea577",
                "md5": "33bee3cd983583bbffaf9c77af5d07c7",
                "sha256": "1710b358f285974827c0a11438dbf37337ef3c45520f536926b183d3109838a6"
            },
            "downloads": -1,
            "filename": "arches_templating-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33bee3cd983583bbffaf9c77af5d07c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21336,
            "upload_time": "2023-10-12T19:48:36",
            "upload_time_iso_8601": "2023-10-12T19:48:36.333497Z",
            "url": "https://files.pythonhosted.org/packages/49/80/2c5e1a6e0f3ecded18d7af81e0ab39ad76da19cb2ed4e78919883f1ea577/arches_templating-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1911f8a1d9ba44bc2bca72eb1bad7676c281af6bf2b256ad79bf4df60abcbd80",
                "md5": "7f7eec139658d9e745272d8c9ebe1eed",
                "sha256": "c5f0fab434b16197d296aff5c1c4ed81ee744b95a8e59b72219ea7a3332d978a"
            },
            "downloads": -1,
            "filename": "arches-templating-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7f7eec139658d9e745272d8c9ebe1eed",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16723,
            "upload_time": "2023-10-12T19:48:37",
            "upload_time_iso_8601": "2023-10-12T19:48:37.767652Z",
            "url": "https://files.pythonhosted.org/packages/19/11/f8a1d9ba44bc2bca72eb1bad7676c281af6bf2b256ad79bf4df60abcbd80/arches-templating-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-12 19:48:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "arches-templating"
}
        
Elapsed time: 0.12256s