diff options
author | Ross Barnowski <rossbar@berkeley.edu> | 2022-02-02 10:26:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 15:26:16 -0300 |
commit | 45fb3a28100d509b695f432cf100f36f0e4c2f9f (patch) | |
tree | 3b2116560d92d7afc485194f56fc0fc51f2360e9 | |
parent | f5afe6be2ee98e5c6970a8a904eba7386c2325c1 (diff) | |
download | numpy-45fb3a28100d509b695f432cf100f36f0e4c2f9f.tar.gz |
DOC: Improve NEP page layout with nested toctrees (#20956)
-rw-r--r-- | doc/neps/.gitignore | 8 | ||||
-rw-r--r-- | doc/neps/accepted.rst.tmpl | 9 | ||||
-rw-r--r-- | doc/neps/deferred.rst.tmpl | 9 | ||||
-rw-r--r-- | doc/neps/finished.rst.tmpl | 9 | ||||
-rw-r--r-- | doc/neps/index.rst | 32 | ||||
-rw-r--r-- | doc/neps/index.rst.tmpl | 100 | ||||
-rw-r--r-- | doc/neps/meta.rst.tmpl | 11 | ||||
-rw-r--r-- | doc/neps/open.rst.tmpl | 9 | ||||
-rw-r--r-- | doc/neps/provisional.rst.tmpl | 9 | ||||
-rw-r--r-- | doc/neps/rejected.rst.tmpl | 9 | ||||
-rw-r--r-- | doc/neps/tools/build_index.py | 23 |
11 files changed, 117 insertions, 111 deletions
diff --git a/doc/neps/.gitignore b/doc/neps/.gitignore index 04163f707..e5d89d1b2 100644 --- a/doc/neps/.gitignore +++ b/doc/neps/.gitignore @@ -1 +1,7 @@ -index.rst +accepted.rst +deferred.rst +finished.rst +meta.rst +open.rst +provisional.rst +rejected.rst diff --git a/doc/neps/accepted.rst.tmpl b/doc/neps/accepted.rst.tmpl new file mode 100644 index 000000000..8e1ce333a --- /dev/null +++ b/doc/neps/accepted.rst.tmpl @@ -0,0 +1,9 @@ +Accepted NEPs (implementation in progress) +------------------------------------------ + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Accepted' %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/deferred.rst.tmpl b/doc/neps/deferred.rst.tmpl new file mode 100644 index 000000000..55074bf07 --- /dev/null +++ b/doc/neps/deferred.rst.tmpl @@ -0,0 +1,9 @@ +Deferred and Superseded NEPs +---------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] in ('Deferred', 'Superseded') %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/finished.rst.tmpl b/doc/neps/finished.rst.tmpl new file mode 100644 index 000000000..0b9ba8a4a --- /dev/null +++ b/doc/neps/finished.rst.tmpl @@ -0,0 +1,9 @@ +Finished NEPs +------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Final' %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/index.rst b/doc/neps/index.rst new file mode 100644 index 000000000..053030852 --- /dev/null +++ b/doc/neps/index.rst @@ -0,0 +1,32 @@ +===================================== +Roadmap & NumPy Enhancement Proposals +===================================== + +This page provides an overview of development priorities for NumPy. +Specifically, it contains a roadmap with a higher-level overview, as +well as NumPy Enhancement Proposals (NEPs)—suggested changes +to the library—in various stages of discussion or completion (see `NEP +0 <nep-0000>`__). + +Roadmap +------- +.. toctree:: + :maxdepth: 1 + + The Scope of NumPy <scope> + Current roadmap <roadmap> + Wish list <https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22> + +NumPy Enhancement Proposals (NEPs) +---------------------------------- + +.. toctree:: + :maxdepth: 2 + + meta + provisional + accepted + open + finished + deferred + rejected diff --git a/doc/neps/index.rst.tmpl b/doc/neps/index.rst.tmpl deleted file mode 100644 index 0299f8671..000000000 --- a/doc/neps/index.rst.tmpl +++ /dev/null @@ -1,100 +0,0 @@ -===================================== -Roadmap & NumPy Enhancement Proposals -===================================== - -This page provides an overview of development priorities for NumPy. -Specifically, it contains a roadmap with a higher-level overview, as -well as NumPy Enhancement Proposals (NEPs)—suggested changes -to the library—in various stages of discussion or completion (see `NEP -0 <nep-0000>`__). - -Roadmap -------- -.. toctree:: - :maxdepth: 1 - - The Scope of NumPy <scope> - Current roadmap <roadmap> - Wish list <https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22> - -Meta-NEPs (NEPs about NEPs or Processes) ----------------------------------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] == 'Active' %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - - nep-template - - -{% if has_provisional %} - -Provisional NEPs (provisionally accepted; interface may change) ---------------------------------------------------------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] == 'Provisional' %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - -{% endif %} - - -Accepted NEPs (implementation in progress) ------------------------------------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] == 'Accepted' %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - - -Open NEPs (under consideration) -------------------------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] == 'Draft' %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - - - -Finished NEPs ----------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] == 'Final' %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - -Deferred and Superseded NEPs ----------------------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] in ('Deferred', 'Superseded') %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - -Rejected and Withdrawn NEPs ---------------------------- - -.. toctree:: - :maxdepth: 1 - -{% for nep, tags in neps.items() if tags['Status'] in ('Rejected', 'Withdrawn') %} - {{ tags['Title'] }} <{{ tags['Filename'] }}> -{% endfor %} - diff --git a/doc/neps/meta.rst.tmpl b/doc/neps/meta.rst.tmpl new file mode 100644 index 000000000..a74311e43 --- /dev/null +++ b/doc/neps/meta.rst.tmpl @@ -0,0 +1,11 @@ +Meta-NEPs (NEPs about NEPs or Processes) +---------------------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Active' %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} + + nep-template diff --git a/doc/neps/open.rst.tmpl b/doc/neps/open.rst.tmpl new file mode 100644 index 000000000..78cdafb82 --- /dev/null +++ b/doc/neps/open.rst.tmpl @@ -0,0 +1,9 @@ +Open NEPs (under consideration) +------------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Draft' %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/provisional.rst.tmpl b/doc/neps/provisional.rst.tmpl new file mode 100644 index 000000000..4c289db98 --- /dev/null +++ b/doc/neps/provisional.rst.tmpl @@ -0,0 +1,9 @@ +Provisional NEPs (provisionally accepted; interface may change) +--------------------------------------------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] == 'Provisional' %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/rejected.rst.tmpl b/doc/neps/rejected.rst.tmpl new file mode 100644 index 000000000..5898a8cff --- /dev/null +++ b/doc/neps/rejected.rst.tmpl @@ -0,0 +1,9 @@ +Rejected and Withdrawn NEPs +--------------------------- + +.. toctree:: + :maxdepth: 1 + +{% for nep, tags in neps.items() if tags['Status'] in ('Rejected', 'Withdrawn') %} + {{ tags['Title'] }} <{{ tags['Filename'] }}> +{% endfor %} diff --git a/doc/neps/tools/build_index.py b/doc/neps/tools/build_index.py index 51227a6f1..704da5a18 100644 --- a/doc/neps/tools/build_index.py +++ b/doc/neps/tools/build_index.py @@ -1,6 +1,7 @@ """ Scan the directory of nep files and extract their metadata. The -metadata is passed to Jinja for filling out `index.rst.tmpl`. +metadata is passed to Jinja for filling out the toctrees for various NEP +categories. """ import os @@ -100,14 +101,16 @@ def nep_metadata(): return {'neps': neps, 'has_provisional': has_provisional} - -infile = 'index.rst.tmpl' -outfile = 'index.rst' - meta = nep_metadata() -print(f'Compiling {infile} -> {outfile}') -index = render(infile, meta) - -with open(outfile, 'w') as f: - f.write(index) +for nepcat in ( + "provisional", "accepted", "deferred", "finished", "meta", + "open", "rejected", +): + infile = f"{nepcat}.rst.tmpl" + outfile =f"{nepcat}.rst" + + print(f'Compiling {infile} -> {outfile}') + genf = render(infile, meta) + with open(outfile, 'w') as f: + f.write(genf) |