{ "info": { "author": "thclark", "author_email": "withheld.find@me.at.github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Wagtail References [![Build Status](https://travis-ci.com/thclark/wagtail_references.svg?branch=master)](https://travis-ci.com/thclark/wagtail_references)\n\nBibTeX based bibliography entries, as wagtail snippets\n\n\n## Templates\n\n**\"But, where are the templates?!\"** is a natural question. Answer: There aren't any templates or tags so far...\nI run all my wagtail installations in headless mode with a react front end, so can only justify putting in place the\ntemplates for managing the references on wagtail (for now). But see below for how to do it yourself.\n\nIf you'd like to make a PR with tmplates, I'm very open to collaboration :)\n\nI'm gradually improving wagtail admin templates, I'll do an ever-better job as the library gets more traction and users.\n**Bottom line: Star this repo on Github if you use or like it, so I know it's getting traction!** \n\n\n## Displaying references on the front end\n\n### Write your own templates/html\n\nI use [citation.js](https://citation.js.org/api/tutorial-getting_started.html) for parsing and displaying the bibtex \nin the wagtail admin, it's usable in-browser (in a template) like this:\n\n```html\n\n\n\n\n

Slug (citation key): {{ reference.slug }}

\n

Type: {{ reference.bibtype }}

\n
\n\n```\n\n### Using react (wagtail in headless mode)\n\nOn the frontend, I use react (see aforementioned nanorant about using wagtail in a headless mode). I'm presently using \n[react-citeproc](https://github.com/robindemourat/react-citeproc) along with\n [biblatex-csl-converter](https://github.com/fiduswriter/biblatex-csl-converter) in a project and it works out pretty\n well. Your component will look like this-ish:\n \n```javascript\nimport React from 'react'\nimport { Bibliography } from 'react-citeproc'\nimport raw from 'raw.macro'\n\nimport { BibLatexParser, CSLExporter } from 'biblatex-csl-converter'\n\nconst style = raw('assets/csl/apa-style.csl')\nconst locale = raw('assets/csl/xml-locale.xml')\n\nclass Reference extends React.Component {\n constructor(props) {\n super(props)\n this.state = {\n bibtex: undefined,\n csl: undefined,\n }\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.bibtex !== prevState.bibtex) {\n const parser = new BibLatexParser(nextProps.detail.bibtex, { processUnexpected: false, processUnknown: false })\n const csl = new CSLExporter(parser.output).parse()\n return {\n bibtex: nextProps.detail.bibtex,\n csl,\n }\n }\n return null\n }\n\n render() {\n return (\n
\n \n
\n )\n }\n}\n\nexport default Reference\n```\n\n\n\n## Roadmap\n\nI'd like to include:\n- A better snippet editor, possibly using a json editor component and allowing the user to switch between tex and json\n- A `ListSerializer` for serializing out multiple references as a bibjson collection\n- An HTML renderer and viewset \n\n\n## Requirements\n\nWagtail References is tested on Django 2.1 or later and Wagtail 2.3 or later.\n\n\n## Supported Versions\n\nPython: 3.6\n\nDjango: 2.1\n\nWagtail: 2.3\n\n\n## Getting started\n\nInstalling from pip:\n\n```\npip install wagtail_references\n```\n\nAdding to `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n ...\n 'wagtail_references',\n ...\n]\n```\n\nRunning the migrations:\n\n```\npython manage.py migrate wagtail_references\n```\n\n\n## Reference Model\n\nThere's only one database model ``Reference``, which is registered as a snippet in Wagtail, making it searchable and\nselectable. \n\n### Slugs \n\nThe model has a (required, unique) ``slug`` field which is automatically set from bibtex contents when a reference\nis added.\n\nFor example, if you have the following bibtex entry:\n```\n@article{Clark2017a,\nauthor = {Clark, Thomas H. E. and Lueck, Rolf G. and Hay, Alex E. and Davey, Thomas and Stern, Peter and Horwitz, Rachel},\njournal = {Proc. of the 12th European Wave and Tidal Energy Conference},\npages = {7},\ntitle = {{InSTREAM : Measurement , Characterisation and Simulation of Turbulence from Test Tank to Ocean .}},\nyear = {2017}\n}\n``` \nthe slug will automatically be set to ``clark-lueck-hay-davey-stern-horwitz-2017``, with an appended ``-2``, ``-3`` etc\nto maintain uniqueness.\n\nThe citation key for the bibtex entry will be updated to correspond:\n```\n@article{clark-lueck-hay-davey-stern-horwitz-2017,\nauthor = ... etc etc ...\n}\n``` \n\nUniqueness is enforced at form validation and database level. Slugs may be edited manually after creation of a reference.\n\n### bibtex and bibjson\n\nThe reference model comprises both a `bibtex` field (containing the bibtex string, raw) and a `bibjson` field. \n*Yes, I know this is duplication of data. But I'd rather do that than incur the cost of re-parsing the data every time I\nwant to serialize it out in a different form. I could've chosen to cache it, but then I don't know how much memory you \nfolks have, and don't want to screw your cache if you're managing a lot of references). It was a judgement call. \nUse-case and an alternative solution? File an issue.*\n\nThe `bibjson` is stored natively as JSON if you have POSTGRES, otherwise as a string (thanks to [`django-jsonfield`](https://github.com/adamchainz/django-jsonfield)).\n\n\n## Django Settings\n\nThe following settings can be defined in your `SETTINGS.py`:\n\n- **WAGTAILREFERENCES_CONVERT_BIBTEX** (default: `False`) Before saving new records, the record will be homogenized to\nstrict latex. This forces a conversion to unicode and, for example, adds braces to force capitalization.\n- **WAGTAILREFERENCES_ENABLE_UNICODE** (default: `True`) If enabled, items such as `\"C{\\\"o}ze\"` will be converted to\ntheir unicode equivalents. If you're using entries in a LaTeX rendering engine, this isn't necessary. If you're\nusing them to rendering HTML (which you probably are, this is a web CMS after all), you probably want this.\n- **WAGTAILREFERENCES_COLLECTION_NAME** (default: `None`) Applies a default collection name to records rendered in bibjson form. \n\n\n## Examples\n\nFor your and our testing purposes, it's useful to have some examples to hand, so I've prepared some in the ``examples.py`` file, which simply contains a series of different bibtex references.\n\nIf you encounter awkward references or ones which won't validate, please post them into a github issue so I can help diagnose and add them for test.\n\n\n## Thanks\n\nThanks are due to [**internaut**](https://github.com/internaut/bibtex2bibjson) for providing the bibtex-json converter. Their code isn't licensed so I don't know how to credit it other than saying thanks!", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thclark/wagtail_references", "keywords": "wagtail,django,references", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "wagtail-references", "package_url": "https://pypi.org/project/wagtail-references/", "platform": "", "project_url": "https://pypi.org/project/wagtail-references/", "project_urls": { "Homepage": "https://github.com/thclark/wagtail_references" }, "release_url": "https://pypi.org/project/wagtail-references/0.2.6/", "requires_dist": null, "requires_python": "", "summary": "BibTeX references for Wagtail", "version": "0.2.6" }, "last_serial": 5785105, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "dda88c74c4340eee0af8df593f4865a4", "sha256": "2b50058a756b5989b1259c46c9afe24ad1bd8238eb1dd0b7a632ec3332da0b01" }, "downloads": -1, "filename": "wagtail_references-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "dda88c74c4340eee0af8df593f4865a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17199, "upload_time": "2019-04-02T09:57:01", "url": "https://files.pythonhosted.org/packages/94/88/d7ba49b1fadd6b76c73e9d9cdc2051534f509c395698dcc82d757a9eec6a/wagtail_references-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "abc57bc528b7e97c546cecdcb96337fa", "sha256": "0fad0ab303ee3ffb356b55bd4cb4621e8ff14151077c41d14a96b9b29b129224" }, "downloads": -1, "filename": "wagtail_references-0.0.1.tar.gz", "has_sig": false, "md5_digest": "abc57bc528b7e97c546cecdcb96337fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11871, "upload_time": "2019-04-02T09:57:04", "url": "https://files.pythonhosted.org/packages/16/28/284afd7ed79660081809943f28e5f60cb49e87bfbe08fd7c90db1096ccbc/wagtail_references-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "63d5168b2116ccb4cacc1c0af695618f", "sha256": "df63eaff004379adaeb6a0f8d2f41b6c7ae0168a9245448263bc575648fcf916" }, "downloads": -1, "filename": "wagtail_references-0.0.2.tar.gz", "has_sig": false, "md5_digest": "63d5168b2116ccb4cacc1c0af695618f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11410, "upload_time": "2019-04-02T10:22:07", "url": "https://files.pythonhosted.org/packages/02/74/ab8e2f6efda9b77d9a08e87628e549fe3ce84b2124993f80f43b18f63702/wagtail_references-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a5a7791dc1c0807c6e54b5a4b705079a", "sha256": "a9c7ebf3e0e893c3b6a313466ee3efbf2ea87882bef0e3fe7c3e8dfee9358cd7" }, "downloads": -1, "filename": "wagtail_references-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a5a7791dc1c0807c6e54b5a4b705079a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11509, "upload_time": "2019-04-03T15:09:03", "url": "https://files.pythonhosted.org/packages/31/d3/152aa65becfb1981cd67afed3dc7fc9bc02b840517be56c29d6fe29382ca/wagtail_references-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7b49e261fb1344573744458849b77293", "sha256": "2d8effdead87d6ab5a1685625752ee257d9252a5b994056bf38cf2f67a15f2c9" }, "downloads": -1, "filename": "wagtail_references-0.0.4.tar.gz", "has_sig": false, "md5_digest": "7b49e261fb1344573744458849b77293", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11509, "upload_time": "2019-04-03T17:12:30", "url": "https://files.pythonhosted.org/packages/32/76/8678b74305f388d120850d520e98484a778169c5d4804897dd9c4e707635/wagtail_references-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "3f813aabd615f0200693deaa6c9476ad", "sha256": "aeacaacc346b4f89569d4de54319b5037cd096612c173b43e77841b52480d9a7" }, "downloads": -1, "filename": "wagtail_references-0.0.5.tar.gz", "has_sig": false, "md5_digest": "3f813aabd615f0200693deaa6c9476ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16293, "upload_time": "2019-04-03T18:16:08", "url": "https://files.pythonhosted.org/packages/af/6a/82174617ed87665af6917d9460907c0c0ba8766c7837ec78429a19afee7a/wagtail_references-0.0.5.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9635fa49b9769a55c99236d964606eb1", "sha256": "1c142b2647ca253b35f9aaa7130022c4118d6dc68188e0fc289419f050cfdd88" }, "downloads": -1, "filename": "wagtail_references-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9635fa49b9769a55c99236d964606eb1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23492, "upload_time": "2019-04-16T14:26:43", "url": "https://files.pythonhosted.org/packages/c8/db/d1db71b8134ffbefb1b56e4891b87da54e00cb1f867eb66e153f6434ce10/wagtail_references-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "47254c74b3d35b55e2f90716ed9552e5", "sha256": "b902b3dd445b8674ea4854336bcc2667078efb10514d8879fae3a623edb818a6" }, "downloads": -1, "filename": "wagtail_references-0.1.1.tar.gz", "has_sig": false, "md5_digest": "47254c74b3d35b55e2f90716ed9552e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23503, "upload_time": "2019-04-16T14:35:31", "url": "https://files.pythonhosted.org/packages/bb/84/4519eb4975d047f6d7a42ac186c72056268640b4f6339f829908456d3e34/wagtail_references-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "ec97b284f52cc4109884f3196ad611e0", "sha256": "6b9057eec1a3f5342df8297f2e20da8fabdb9807f7973243592dfd0530d9ce24" }, "downloads": -1, "filename": "wagtail_references-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ec97b284f52cc4109884f3196ad611e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23477, "upload_time": "2019-04-16T17:08:33", "url": "https://files.pythonhosted.org/packages/b8/16/70844329e139543aea6ca642ebdb3ba87cc34298dd057416c29138a4e6fd/wagtail_references-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "bf723ebab15563be9f2d41f6d6b75fe5", "sha256": "df0ce90cbac4365b97b221df35ed79edde3ab379d841bc177e8c067831f2ace0" }, "downloads": -1, "filename": "wagtail_references-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bf723ebab15563be9f2d41f6d6b75fe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23563, "upload_time": "2019-04-18T07:12:01", "url": "https://files.pythonhosted.org/packages/19/32/17aa52251b7e47e36e410013cd1db20c55e2c99f8e7cadd6f8660300a780/wagtail_references-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "dc38309258ad0283ac7d71a2a69938be", "sha256": "4d2ac1aaf7a09a57cc4581b2a62d41ebc95b636952b81c5826eb492bae138bd0" }, "downloads": -1, "filename": "wagtail_references-0.2.1.tar.gz", "has_sig": false, "md5_digest": "dc38309258ad0283ac7d71a2a69938be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24670, "upload_time": "2019-05-17T18:49:58", "url": "https://files.pythonhosted.org/packages/ae/a1/e78df89ec4e51dca094a89171d4520e684d87cef9f2acbf6d61db287724f/wagtail_references-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "1f3dd65bb7fe544b3a0b700fdad49f10", "sha256": "88488955c54c0f3dd94fd6988889d51d2a54bbfa2cb2b74e1513217fc28e52e2" }, "downloads": -1, "filename": "wagtail_references-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1f3dd65bb7fe544b3a0b700fdad49f10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24893, "upload_time": "2019-05-17T19:07:54", "url": "https://files.pythonhosted.org/packages/15/11/721c16fa4921094496443ebbc1433827a9bfd0cc69e9f333dcc1c5ecd76c/wagtail_references-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "6841cb4155c745067d49d84468e22386", "sha256": "376fea4405735b58698b0b0bd3b56e9b0665baeb70e284bd1eb0a2e606574325" }, "downloads": -1, "filename": "wagtail_references-0.2.3.tar.gz", "has_sig": false, "md5_digest": "6841cb4155c745067d49d84468e22386", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27023, "upload_time": "2019-05-20T11:44:14", "url": "https://files.pythonhosted.org/packages/83/98/6dad4036e04d8fe02f0a79491d0bcf9991032df1d43fc47519d6aa01ced7/wagtail_references-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "620afb350cf462264987506435afbaf5", "sha256": "bfca1673ff3f8413e26ed5f19ed805756707e0efba7d5f6d3c0a428503b25a10" }, "downloads": -1, "filename": "wagtail_references-0.2.4.tar.gz", "has_sig": false, "md5_digest": "620afb350cf462264987506435afbaf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27024, "upload_time": "2019-05-20T12:25:43", "url": "https://files.pythonhosted.org/packages/59/52/c732034cf6bf9e303a3f1bea185c369fdc17592818585cfde61bf7efbd33/wagtail_references-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "146ccc0b6f6d78ff12df4b33c379f16e", "sha256": "cbd4814c4106e4c6aab7e4c85a1c5f1134b98f658572d68ea9a864fd5cd23241" }, "downloads": -1, "filename": "wagtail_references-0.2.5.tar.gz", "has_sig": false, "md5_digest": "146ccc0b6f6d78ff12df4b33c379f16e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26909, "upload_time": "2019-08-09T13:33:08", "url": "https://files.pythonhosted.org/packages/6c/ef/a386ad146ac037d2b657d96584898ad245cc355c8badc926196d157e2cf5/wagtail_references-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "59958e05c9e7f48a77cd0dc44e54ba0d", "sha256": "ccd13b82769ac4b1a67fb89bacae5439f6ce61de37fbd291be179d3bba080820" }, "downloads": -1, "filename": "wagtail_references-0.2.6.tar.gz", "has_sig": false, "md5_digest": "59958e05c9e7f48a77cd0dc44e54ba0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26904, "upload_time": "2019-09-05T07:31:11", "url": "https://files.pythonhosted.org/packages/06/00/316a46ff519bc6df9f84b8f556ec234892247906add2f1c93d9028c4c58c/wagtail_references-0.2.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "59958e05c9e7f48a77cd0dc44e54ba0d", "sha256": "ccd13b82769ac4b1a67fb89bacae5439f6ce61de37fbd291be179d3bba080820" }, "downloads": -1, "filename": "wagtail_references-0.2.6.tar.gz", "has_sig": false, "md5_digest": "59958e05c9e7f48a77cd0dc44e54ba0d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26904, "upload_time": "2019-09-05T07:31:11", "url": "https://files.pythonhosted.org/packages/06/00/316a46ff519bc6df9f84b8f556ec234892247906add2f1c93d9028c4c58c/wagtail_references-0.2.6.tar.gz" } ] }