Skip to content

Commit 8b14c4e

Browse files
committed
update docs/add header info
1 parent 98186ac commit 8b14c4e

File tree

261 files changed

+3566
-1163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+3566
-1163
lines changed

colrev/package_manager/doc_registry_manager.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,79 @@ def _write_docs_for_index(self) -> None:
152152
for line in new_doc:
153153
file.write(line + "\n")
154154

155+
# pylint: disable=line-too-long
156+
# flake8: noqa: E501
157+
def _get_header_info(self, package: colrev.package_manager.package.Package) -> str:
158+
159+
# To format the table (adjust row height), the following is suggested:
160+
# from bs4 import BeautifulSoup
161+
162+
# # Parse the generated HTML
163+
# with open('output.html', 'r') as f:
164+
# soup = BeautifulSoup(f, 'html.parser')
165+
166+
# # Find the table and add the ID
167+
# table = soup.find('table')
168+
# table['id'] = 'endpoint_overview_container'
169+
170+
# # Write the modified HTML back to the file
171+
# with open('output.html', 'w') as f:
172+
# f.write(str(soup))
173+
174+
header_info = f"{package.name}\n"
175+
header_info += "=" * len(package.name) + "\n\n"
176+
header_info += (
177+
f"- Maintainer: {', '.join(x['name'] for x in package.authors)}\n"
178+
)
179+
header_info += f"- License: {package.license}\n\n"
180+
header_info += ".. |EXPERIMENTAL| image:: https://img.shields.io/badge/status-experimental-blue\n"
181+
header_info += " :height: 14pt\n"
182+
header_info += " :target: https://colrev.readthedocs.io/en/latest/dev_docs/dev_status.html\n"
183+
header_info += ".. |MATURING| image:: https://img.shields.io/badge/status-maturing-yellowgreen\n"
184+
header_info += " :height: 14pt\n"
185+
header_info += " :target: https://colrev.readthedocs.io/en/latest/dev_docs/dev_status.html\n"
186+
header_info += ".. |STABLE| image:: https://img.shields.io/badge/status-stable-brightgreen\n"
187+
header_info += " :height: 14pt\n"
188+
header_info += " :target: https://colrev.readthedocs.io/en/latest/dev_docs/dev_status.html\n"
189+
header_info += ".. list-table::\n"
190+
header_info += " :header-rows: 1\n"
191+
header_info += " :widths: 20 30 80\n\n"
192+
193+
header_info += " * - Endpoint\n"
194+
header_info += " - Status\n"
195+
header_info += " - Add\n"
196+
197+
for endpoint_type in EndpointType:
198+
if package.has_endpoint(endpoint_type):
199+
header_info += f" * - {endpoint_type.value}\n"
200+
header_info += f" - |{package.status.upper()}|\n"
201+
if endpoint_type == EndpointType.review_type:
202+
header_info += f" - .. code-block:: \n\n\n colrev init --type {package.name}\n\n"
203+
elif endpoint_type == EndpointType.search_source:
204+
header_info += f" - .. code-block:: \n\n\n colrev search --add {package.name}\n\n"
205+
elif endpoint_type == EndpointType.prep:
206+
header_info += f" - .. code-block:: \n\n\n colrev prep --add {package.name}\n\n"
207+
elif endpoint_type == EndpointType.prep_man:
208+
header_info += f" - .. code-block:: \n\n\n colrev prep-man --add {package.name}\n\n"
209+
elif endpoint_type == EndpointType.dedupe:
210+
header_info += f" - .. code-block:: \n\n\n colrev dedupe --add {package.name}\n\n"
211+
elif endpoint_type == EndpointType.prescreen:
212+
header_info += f" - .. code-block:: \n\n\n colrev prescreen --add {package.name}\n\n"
213+
elif endpoint_type == EndpointType.pdf_get:
214+
header_info += f" - .. code-block:: \n\n\n colrev pdf-get --add {package.name}\n\n"
215+
elif endpoint_type == EndpointType.pdf_get_man:
216+
header_info += f" - .. code-block:: \n\n\n colrev pdf-get-man --add {package.name}\n\n"
217+
elif endpoint_type == EndpointType.pdf_prep:
218+
header_info += f" - .. code-block:: \n\n\n colrev pdf-prep --add {package.name}\n\n"
219+
elif endpoint_type == EndpointType.pdf_prep_man:
220+
header_info += f" - .. code-block:: \n\n\n colrev pdf-prep-man --add {package.name}\n\n"
221+
elif endpoint_type == EndpointType.screen:
222+
header_info += f" - .. code-block:: \n\n\n colrev screen --add {package.name}\n\n"
223+
elif endpoint_type == EndpointType.data:
224+
header_info += f" - .. code-block:: \n\n\n colrev data --add {package.name}\n\n"
225+
226+
return header_info
227+
155228
def _import_package_docs(
156229
self, package: colrev.package_manager.package.Package
157230
) -> str:
@@ -164,11 +237,14 @@ def _import_package_docs(
164237

165238
output = parse_from_file(docs_link)
166239

240+
header_info = self._get_header_info(package)
241+
167242
file_path = Path(f"{package.name}.rst")
168243
target = packages_index_path / file_path
169244
with open(target, "w", encoding="utf-8") as file:
170245
# NOTE: at this point, we may add metadata
171246
# (such as package status, authors, url etc.)
247+
file.write(header_info)
172248
file.write(output)
173249

174250
return str(file_path)

colrev/package_manager/package.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def __init__(self, package_dir: Path) -> None:
3636
self.version = self.config["project"]["version"]
3737
self.status = self.config["tool"]["colrev"]["dev_status"]
3838
self.colrev_doc_link = self.config["project"]["colrev_doc_link"]
39+
self.authors = self.config["project"]["authors"]
40+
self.license = self.config["project"]["license"]
3941

4042
def _load_config(self) -> dict:
4143
config_path = self.package_dir / "pyproject.toml"

colrev/packages/abi_inform_proquest/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# ABI/INFORM ProQuest
1+
## Summary
22

33
## search
44

55
### DB search
66

7-
```
8-
colrev search --add abi_inform_proquest
9-
```
10-
117
[ABI/INFORM ProQuest](https://about.proquest.com/en/products-services/abi_inform_complete/)
128

139
## Links

colrev/packages/abi_inform_proquest/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "colrev.abi_inform_proquest"
33
description = "CoLRev package for abi_inform_proquest"
44
version = "0.1.0"
5+
license = "MIT"
56
authors = [
67
{ name = "Gerit Wagner", email = "gerit.wagner@uni-bamberg.de" }
78
]
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
# ACM Digital Library
1+
## Summary
22

33
## search
44

55
### DB search
66

77
```
8-
colrev search --add abi_inform_proquest
8+
colrev search --add colrev.acm_digital_library
99
```
1010

11-
### API search
12-
13-
TODO
14-
1511
## Links
1612

1713
- [ACM Digital Library](https://dl.acm.org/)

colrev/packages/acm_digital_library/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "colrev.acm_digital_library"
33
description = "CoLRev package for acm_digital_library"
44
version = "0.1.0"
5+
license = "MIT"
56
authors = [
67
{ name = "Gerit Wagner", email = "gerit.wagner@uni-bamberg.de" }
78
]

colrev/packages/add_journal_ranking/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
# Add journal rankings
1+
## Summary
22

33
## prep
44

55
**Prerequisite** Initial ranking data is extracted from ranking.csv into SQLite Database sqlite_index.db with 'colrev env -i'.
66

7-
**Add the endpoint**
8-
9-
```
10-
colrev prep -a colrev.add_journal_ranking
11-
```
12-
137
**Description**
148

159
The add_journal_ranking package allows the user to add a ranking to the records metadata for additional automated prescreen options. While iterating through the records, this class calls the get_journal_rankings method to access the sqlite_index.db to compare if a journal_name is in one or more of the saved rankings. These rankings are being saved in the records metadata.
1610

1711
Example:
1812

13+
```
1914
journal_ranking = {Senior Scholars' List of Premier Journals}, or
2015
journal_ranking = {not included in a ranking},
16+
```
2117

2218
Should the journal be in the Beall's Predatory Journal list, then the record will be marked as "Predatory Journal: Do not include!" and be predestined to be excluded in the scope_prescreen process.
2319

2420
Example:
2521

22+
```
2623
journal_ranking = {Predatory Journal: Do not include!},
24+
```
2725

2826
The journal ranking will also be used in the colrev prescreen method and allows the user to decide if the record should be marked as 'rev_prescreen_excluded' or 'rev_prescreen_included'.
2927

colrev/packages/add_journal_ranking/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
name = "colrev.add_journal_ranking"
33
description = "CoLRev package for add_journal_ranking"
44
version = "0.1.0"
5+
license = "MIT"
56
authors = [
6-
{ name = "Gerit Wagner", email = "gerit.wagner@uni-bamberg.de" }
7+
{ name = "Gerit Wagner", email = "gerit.wagner@uni-bamberg.de" },
8+
{ name = "Alexa Steinheimer"},
9+
{ name = "Robert Ahr"},
10+
{ name = "Thomas Fleischmann"},
11+
{ name = "Anton Liam Frisch"}
712
]
813
documentation = "README.md"
914
colrev_doc_link = "README.md"

colrev/packages/ais_library/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AIS electronic Library
1+
## Summary
22

33
## search
44

colrev/packages/ais_library/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "colrev.ais_library"
33
description = "CoLRev package for aisel"
44
version = "0.1.0"
5+
license = "MIT"
56
authors = [
67
{ name = "Gerit Wagner", email = "gerit.wagner@uni-bamberg.de" }
78
]

0 commit comments

Comments
 (0)