Skip to content

Commit 91c8496

Browse files
author
Gerit Wagner
committed
toc-sync package
1 parent f539b15 commit 91c8496

8 files changed

Lines changed: 895 additions & 0 deletions

File tree

colrev/package_manager/packages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,8 @@
292292
},
293293
"colrev.enlit": {
294294
"dev_status": "experimental"
295+
},
296+
"colrev.toc_sync": {
297+
"dev_status": "experimental"
295298
}
296299
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.6.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
exclude: bib$|txt$|ris$|enl$|xml$
9+
- id: check-docstring-first
10+
- id: check-json
11+
- id: check-yaml
12+
- id: check-toml
13+
- id: debug-statements
14+
- id: name-tests-test
15+
- repo: https://github.com/psf/black-pre-commit-mirror
16+
rev: 24.4.2
17+
hooks:
18+
- id: black
19+
language_version: python3
20+
- repo: https://github.com/PyCQA/autoflake
21+
rev: v2.3.1
22+
hooks:
23+
- id: autoflake
24+
- repo: https://github.com/PyCQA/flake8
25+
rev: 7.1.0
26+
hooks:
27+
- id: flake8
28+
additional_dependencies: [flake8-typing-imports==1.12.0]
29+
args: ['--max-line-length=110', '--extend-ignore=E203,TYP006']
30+
- repo: https://github.com/asottile/reorder-python-imports
31+
rev: v3.13.0
32+
hooks:
33+
- id: reorder-python-imports
34+
args: [--py3-plus]
35+
- repo: https://github.com/asottile/pyupgrade
36+
rev: v3.16.0
37+
hooks:
38+
- id: pyupgrade
39+
args: [--py36-plus, --keep-runtime-typing]
40+
- repo: https://github.com/pre-commit/mirrors-mypy
41+
rev: 'v1.11.0'
42+
hooks:
43+
- id: mypy
44+
args: [--disallow-untyped-defs, --disallow-incomplete-defs, --disallow-untyped-calls]
45+
additional_dependencies: [types-toml]
46+
- repo: https://github.com/astral-sh/ruff-pre-commit
47+
rev: v0.5.4
48+
hooks:
49+
- id: ruff # runs faster than pylint
50+
args: [--fix, --exit-non-zero-on-fix]
51+
- repo: local
52+
hooks:
53+
- id: pylint
54+
name: pylint
55+
entry: pylint
56+
language: system
57+
types: [python]
58+
files: colrev
59+
args:
60+
[
61+
"-rn", # Only display messages
62+
"-sn", # Don't display the score
63+
]

colrev/packages/toc_sync/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [2025] [Gerit Wagner]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

colrev/packages/toc_sync/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# colrev.toc_sync
2+
3+
Syncs tables of contents (toc) from APIs like Crossref, updating Markdown files.
4+
5+
## Installation
6+
7+
```bash
8+
colrev install colrev.toc_sync
9+
```
10+
11+
## Usage
12+
13+
```bash
14+
toc-sync --new-toc
15+
toc-sync
16+
```
17+
18+
## TODO
19+
20+
- add pdf-link
21+
- add info on "highly cited"
22+
- "retracted"
23+
- "award" (based on LLM?)
24+
25+
## License
26+
27+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TODO : Docs
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[project]
2+
name = "colrev.toc_sync"
3+
description = "Syncs tables of contents (toc) from APIs like Crossref, updating Markdown files."
4+
version = "0.1.0"
5+
license = "MIT"
6+
authors = [
7+
{ name = "Gerit Wagner", email = "gerit.wagner@uni-bamberg.de" }
8+
]
9+
requires-python = ">=3.8, <4"
10+
11+
[project.urls]
12+
repository = "https://github.com/CoLRev-Environment/colrev/tree/main/colrev/packages/"
13+
14+
[tool.hatch.build.targets.wheel]
15+
packages = ["src"]
16+
17+
[tool.colrev]
18+
colrev_doc_description = "TODO"
19+
colrev_doc_link = "docs/README.md"
20+
search_types = []
21+
22+
23+
[project.entry-points.colrev]
24+
25+
[project.scripts]
26+
toc-sync = "colrev.packages.toc_sync.src.toc_sync:main"
27+
28+
29+
[build-system]
30+
requires = ["hatchling"]
31+
build-backend = "hatchling.build"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Package for colrev.toc_sync."""
2+
3+
__author__ = "Gerit Wagner"
4+
__email__ = "gerit.wagner@uni-bamberg.de"

0 commit comments

Comments
 (0)