mkdocs-webis 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
docs/citations.md ADDED
@@ -0,0 +1,28 @@
1
+ # Citations
2
+
3
+ <p class="subtitle">Cite references from a BibTeX file by their keys.</p>
4
+
5
+ With a `bibliography` configured, cite one or more references by their BibTeX keys:
6
+
7
+ ```markdown
8
+ Axioms are formal constraints on retrieval models [@fang2004formal].
9
+ Some studies use axioms for re-ranking [@hagen2016axiomatic, @bondarenko2022axiomatic].
10
+ ```
11
+
12
+ Which renders as:
13
+
14
+ Axioms are formal constraints on retrieval models [@fang2004formal].
15
+ Some studies use axioms for re-ranking [@hagen2016axiomatic, @bondarenko2022axiomatic].
16
+
17
+ Citations are rendered as gray author–year links in brackets, like on the Webis slides.
18
+ Each links to the "References" section at the bottom of the same page, which lists all references cited on that page, sorted by first author.
19
+ A journal article looks like this: [@fang2011diagnostic].
20
+
21
+ ## Details
22
+
23
+ - Separate multiple keys by commas (semicolons work, too).
24
+ - Citations inside inline code or code blocks are not replaced, as in the example above.
25
+ - Unknown keys and invalid BibTeX files fail the build.
26
+ - LaTeX markup in the BibTeX fields (e.g., `{\"{o}}` for "ö") is converted to plain text.
27
+
28
+ We recommend copying BibTeX entries from [DBLP](https://dblp.org/).
docs/index.md ADDED
@@ -0,0 +1,42 @@
1
+ ---
2
+ hide:
3
+ - navigation
4
+ ---
5
+
6
+ # mkdocs-webis
7
+
8
+ <p class="subtitle">Webis style and BibTeX citations for MkDocs Material.</p>
9
+
10
+ This documentation is rendered with the plugin itself, so it doubles as a demo of the style.
11
+
12
+ [Get started](#installation){ .md-button .md-button--primary }
13
+ [View on GitHub](https://github.com/webis-de/mkdocs-webis){ .md-button }
14
+
15
+ This MkDocs plugin...
16
+
17
+ - ... styles your documentation like the [Webis homepage](https://webis.de/): a dark gray navigation bar with the Webis logo, the "Product Sans" and "Noto Sans" fonts, plain headings, blue links and buttons, flat tables, and a light gray footer,
18
+ - ... lets you cite references from a BibTeX file with `[@key]` or `[@key1, @key2]`, rendered as gray author–year citations like, and appends a list of the cited references (including their BibTeX) to each page.
19
+
20
+ ## Installation
21
+
22
+ Install the package from PyPI:
23
+
24
+ ```shell
25
+ pip install mkdocs-webis
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ Enable the plugin in your `mkdocs.yml` (together with the [Material](https://squidfunk.github.io/mkdocs-material/) theme):
31
+
32
+ ```yaml
33
+ theme:
34
+ name: material
35
+
36
+ plugins:
37
+ - search
38
+ - webis:
39
+ bibliography: references.bib # Optional: BibTeX file in your docs directory.
40
+ ```
41
+
42
+ See the [style elements](style.md) for how Markdown elements look with this style.
docs/references.bib ADDED
@@ -0,0 +1,61 @@
1
+ @inproceedings{fang2004formal,
2
+ author = {Hui Fang and
3
+ Tao Tao and
4
+ ChengXiang Zhai},
5
+ title = {A formal study of information retrieval heuristics},
6
+ booktitle = {{SIGIR} 2004: Proceedings of the 27th Annual International {ACM} {SIGIR}
7
+ Conference on Research and Development in Information Retrieval,
8
+ Sheffield, UK, July 25-29, 2004},
9
+ pages = {49--56},
10
+ publisher = {{ACM}},
11
+ year = {2004},
12
+ url = {https://doi.org/10.1145/1008992.1009004},
13
+ doi = {10.1145/1008992.1009004}
14
+ }
15
+
16
+ @article{fang2011diagnostic,
17
+ author = {Hui Fang and
18
+ Tao Tao and
19
+ ChengXiang Zhai},
20
+ title = {Diagnostic Evaluation of Information Retrieval Models},
21
+ journal = {{ACM} Trans. Inf. Syst.},
22
+ volume = {29},
23
+ number = {2},
24
+ pages = {7:1--7:42},
25
+ year = {2011},
26
+ url = {https://doi.org/10.1145/1961209.1961210},
27
+ doi = {10.1145/1961209.1961210}
28
+ }
29
+
30
+ @inproceedings{hagen2016axiomatic,
31
+ author = {Matthias Hagen and
32
+ Michael V{\"{o}}lske and
33
+ Steve G{\"{o}}ring and
34
+ Benno Stein},
35
+ title = {Axiomatic Result Re-Ranking},
36
+ booktitle = {Proceedings of the 25th {ACM} International Conference on Information
37
+ and Knowledge Management, {CIKM} 2016, Indianapolis, IN, USA, October
38
+ 24-28, 2016},
39
+ pages = {721--730},
40
+ publisher = {{ACM}},
41
+ year = {2016},
42
+ url = {https://doi.org/10.1145/2983323.2983704},
43
+ doi = {10.1145/2983323.2983704}
44
+ }
45
+
46
+ @inproceedings{bondarenko2022axiomatic,
47
+ author = {Alexander Bondarenko and
48
+ Maik Fr{\"{o}}be and
49
+ Jan Heinrich Reimer and
50
+ Benno Stein and
51
+ Michael V{\"{o}}lske and
52
+ Matthias Hagen},
53
+ title = {Axiomatic Retrieval Experimentation with ir{\_}axioms},
54
+ booktitle = {{SIGIR} '22: The 45th International {ACM} {SIGIR} Conference on Research
55
+ and Development in Information Retrieval, Madrid, Spain, July 11-15, 2022},
56
+ pages = {3131--3140},
57
+ publisher = {{ACM}},
58
+ year = {2022},
59
+ url = {https://doi.org/10.1145/3477495.3531743},
60
+ doi = {10.1145/3477495.3531743}
61
+ }
docs/style.md ADDED
@@ -0,0 +1,110 @@
1
+ # Style Elements
2
+
3
+ <p class="subtitle">How Markdown and Material elements look in the Webis style.</p>
4
+
5
+ Use this page to check the style locally (`mkdocs serve`) when changing the stylesheet.
6
+
7
+ ## Text
8
+
9
+ Regular text with **bold**, _italic_, `inline code`, [a link](https://webis.de/), and ==highlighted== text.
10
+ Keyboard keys look like <kbd>Ctrl</kbd> + <kbd>C</kbd>.
11
+
12
+ > A block quote, e.g., for a definition or a quotation.
13
+
14
+ ### Third-Level Heading
15
+
16
+ #### Fourth-Level Heading
17
+
18
+ Term
19
+ : A definition list entry.
20
+
21
+ ## Lists
22
+
23
+ - An unordered list item
24
+ - Another item
25
+ - A nested item
26
+ - Another nested item
27
+
28
+ And an ordered list:
29
+
30
+ 1. An ordered list item
31
+ 2. Another item
32
+
33
+ ## Tables
34
+
35
+ | Corpus | Publisher | Year | Documents |
36
+ |:--|:--|--:|--:|
37
+ | Webis-Query-Log | Webis | 2023 | 356,000,000 |
38
+ | ClueWeb22 | CMU | 2022 | 10,000,000,000 |
39
+ | MS MARCO | Microsoft | 2016 | 8,841,823 |
40
+
41
+ ## Code
42
+
43
+ ```python
44
+ from mkdocs_webis import parse_bibtex
45
+
46
+ # Parse a BibTeX file and print short citations.
47
+ entries = parse_bibtex(open("references.bib").read())
48
+ for key, entry in entries.items():
49
+ print(f"{key}: {entry.short_citation}")
50
+ ```
51
+
52
+ ## Admonitions
53
+
54
+ !!! note
55
+ A note, e.g., for additional information.
56
+
57
+ !!! tip
58
+ A tip, e.g., for best practices.
59
+
60
+ !!! warning
61
+ A warning, e.g., for common pitfalls.
62
+
63
+ !!! danger
64
+ A danger notice, e.g., for destructive operations.
65
+
66
+ !!! example
67
+ An example.
68
+
69
+ ??? quote "A collapsible quote"
70
+ Collapsed by default.
71
+
72
+ ## Tabs
73
+
74
+ === "pip"
75
+
76
+ ```shell
77
+ pip install mkdocs-webis
78
+ ```
79
+
80
+ === "uv"
81
+
82
+ ```shell
83
+ uv add mkdocs-webis
84
+ ```
85
+
86
+ ## Buttons, Badges, and Cards
87
+
88
+ [Primary button](#){ .md-button .md-button--primary }
89
+ [Default button](#){ .md-button }
90
+
91
+ <span class="badge">TFC1</span> — a small label, e.g., for names or acronyms.
92
+
93
+ <div class="grid cards" markdown>
94
+
95
+ - **Card one** — a short description.
96
+ - **Card two** — another short description.
97
+
98
+ </div>
99
+
100
+ ## Custom Classes
101
+
102
+ The stylesheet provides a few CSS classes:
103
+
104
+ ```markdown
105
+ <p class="subtitle">A gray subtitle below a page title.</p>
106
+
107
+ <span class="badge">TFC1</span> — a small label, e.g., for names or acronyms.
108
+ ```
109
+
110
+ The colors of webis.de are available as CSS variables (e.g., `var(--webis-blue)`, `var(--webis-red)`) for your own stylesheets.
@@ -0,0 +1,11 @@
1
+ from mkdocs_webis.bibliography import Bibliography, BibliographyError, Entry, parse_bibtex
2
+ from mkdocs_webis.plugin import WebisPlugin, WebisPluginConfig
3
+
4
+ __all__ = [
5
+ "Bibliography",
6
+ "BibliographyError",
7
+ "Entry",
8
+ "parse_bibtex",
9
+ "WebisPlugin",
10
+ "WebisPluginConfig",
11
+ ]
Binary file
Binary file