Skip to content

Commit

Permalink
Use custom template for datacard header (#24)
Browse files Browse the repository at this point in the history
* Depend on audbcards>= 0.3.4

* Use custom template

* Depend on audbcards>=0.3.3

* Remove repository from the list as well
  • Loading branch information
hagenw authored Dec 9, 2024
1 parent 5ac7767 commit 4792db9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
31 changes: 31 additions & 0 deletions docs/_templates/datacard_header.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _{{ path }}-{{ name }}:

{{ name }}
{% for n in range(name|length) %}-{% endfor %}

{% if author is not none %}

Created by {{ author }}
{% endif %}

============= ======================
version {{ version }}
{% if license_link is not none %}
license `{{ license }} <{{ license_link }}>`__
{% else %}
license {{ license }}
{% endif %}
usage {{ usage }}
{% if languages is defined %}
languages {{ languages|join(', ') }}
{% endif %}
format {{ formats|join(', ') }}
channel {{ channels|join(', ') }}
sampling rate {{ sampling_rates|join(', ') }}
bit depth {{ bit_depths|join(', ') }}
duration {{ duration }}
files {{ files }}, duration distribution: {{ file_duration_distribution }}
{% if segments != "0" %}
segments {{ segments }}, duration distribution: {{ segment_duration_distribution }}
{% endif %}
============= ======================
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"display_version": True,
"logo_only": False,
"footer_links": False,
"wide_pages": ["datasets"],
}
html_context = {
"display_github": True,
Expand All @@ -47,3 +48,4 @@
True, # don't show audio examples
),
]
audbcards_templates = "_templates"
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
audb >=1.10.2
audbcards >= 0.3.2
audbcards >= 0.3.3
audplot
sphinx
sphinx-audeering-theme >=1.2.1

0 comments on commit 4792db9

Please sign in to comment.