Skip to content

Commit 5f88ed5

Browse files
committed
Infra: Build JSON from dict, with PEP number as key, instead of list
1 parent 089826a commit 5f88ed5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pep_sphinx_extensions/pep_zero_generator/pep_index_generator.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232

3333

3434
def create_pep_json(peps: list[parser.PEP]) -> str:
35-
pep_list = [
36-
{
37-
"number": pep.number,
35+
pep_dict = {
36+
pep.number: {
3837
"title": pep.title,
3938
"authors": ", ".join(pep.authors.nick for pep.authors in pep.authors),
4039
"discussions_to": pep.discussions_to,
@@ -50,8 +49,8 @@ def create_pep_json(peps: list[parser.PEP]) -> str:
5049
"url": f"https://peps.python.org/pep-{pep.number:0>4}/",
5150
}
5251
for pep in sorted(peps)
53-
]
54-
return json.dumps(pep_list, indent=0)
52+
}
53+
return json.dumps(pep_dict, indent=1)
5554

5655

5756
def create_pep_zero(app: Sphinx, env: BuildEnvironment, docnames: list[str]) -> None:

0 commit comments

Comments
 (0)