feat: Adds markdown view for hugo rendering
This commit is contained in:
parent
20f30f831e
commit
95b97a7704
3 changed files with 140 additions and 4 deletions
37
README.rst
37
README.rst
|
|
@ -1,7 +1,14 @@
|
|||
pretix-congressschedule
|
||||
=======================
|
||||
|
||||
This is a plugin for `pretix`_. It generates a `c3voc-schema`_ compatible `schedule.xml` endpoint for events.
|
||||
This is a plugin for `pretix`_. It generates a `c3voc-schema`_ compatible `schedule.xml` endpoint and hackertours-compatible markdown table for event-series.
|
||||
To access the endpoints without logging in, generate an `API token`_ first.
|
||||
|
||||
Subevent language field
|
||||
-----------------------
|
||||
|
||||
To determine a subevent's language, this plugin adds a language dropdown selector.
|
||||
Default: `deen` (multi-lingual of German and English)
|
||||
|
||||
Accessing schedule.xml
|
||||
----------------------
|
||||
|
|
@ -12,6 +19,32 @@ Accessing schedule.xml
|
|||
|
||||
3. Receive either a 200 status code with an XML document adhering to `schedule.xml.xsd`_ or a 400 error code with additional information inside `<error>`
|
||||
|
||||
|
||||
Using schedule.md
|
||||
----------------------
|
||||
|
||||
1. Create an `event-series`_ in pretix; a singular event or non-event shop will not work, as products won't have required start and end times associated with them
|
||||
|
||||
2. Visit `/api/v1/event/{organizationSlug}/{eventSlug}/schedule.md` and replace `{organizationSlug}` and `{eventSlug}` with the respective slugs
|
||||
|
||||
3. Receive either a 200 status code with a Markdown document containing a table used for hackertours.hamburg.ccc.de or a 400 error code with additional information inside `<error>`
|
||||
|
||||
4. To embed this into Hugo, use the following syntax:
|
||||
|
||||
```hugo
|
||||
{{ $url := "https://{prefixInstanceRoot}/api/v1/event/{organizationSlug}/{eventSlug}/schedule.md" }}
|
||||
{{ $opts := dict
|
||||
"headers" (dict "Authorization" "Token 6r5waszrj1qbdwqbewbmmk7h46ilocmyfh3e2gxqa9oj52vijmzo1dppk39t3hkl")
|
||||
}}
|
||||
{{ with try (resources.GetRemote $url $opts) }}
|
||||
{{ with .Err }}
|
||||
{{ errorf "%s" . }}
|
||||
{{ else with .Value }}
|
||||
{{ .Content | safeHTML }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
|
||||
Development setup
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -29,7 +62,6 @@ Development setup
|
|||
6. Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in
|
||||
the 'plugins' tab in the settings.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
|
|
@ -41,6 +73,7 @@ Released under the terms of the Apache License 2.0
|
|||
|
||||
.. _pretix: https://github.com/pretix/pretix
|
||||
.. _pretix development setup: https://docs.pretix.eu/en/latest/development/setup.html
|
||||
.. _API token: https://docs.pretix.eu/dev/api/tokenauth.html#obtaining-an-api-token
|
||||
.. _c3voc-schema: https://c3voc.de/wiki/schedule#schedule_xml
|
||||
.. _schedule.xml.xsd: https://c3voc.de/schedule/schema.xsd
|
||||
.. _event-series: https://docs.pretix.eu/guides/event-series/?h=dates#how-to-create-an-event-series
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue