-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ NEW: Add NeedsPerPageBuilder
#962
base: master
Are you sure you want to change the base?
Changes from all commits
da212be
41b240c
7292694
b175483
364bcae
59e1b57
fffd402
9054ef7
8277dce
406f02f
296cbbd
7d322c6
240c0ab
d336da8
d1f2c1b
65e60a7
4fc8171
bfb355c
5f6bc5d
8d978fa
b66b99c
725d98f
95ea444
0a17349
25c28c1
b5b7a3d
76b7442
bbc58df
9b514f1
e63e52a
1c192e0
56c027b
8332508
41026f4
6201bfd
5770983
370b026
95653f4
4a67fae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,3 +163,233 @@ or | |
.. hint:: | ||
|
||
As an alternative, you can set the config option :ref:`needs_build_needumls` to export the needumls files during each build. | ||
|
||
.. _needs_per_page_builder: | ||
|
||
needs_per_page | ||
-------------- | ||
.. versionadded:: 1.4.0 | ||
|
||
The **needs_per_page** builder exports all found needs with same ``docname`` into separate ``json`` file. | ||
If docname has slash like ``directives/list2need``, the file will be located in folder called :ref:`needs_per_page_build_path`. | ||
e.g. `needs_per_page/directives/list2need.json` . | ||
|
||
Usage | ||
+++++ | ||
|
||
|
||
.. code-block:: bash | ||
|
||
sphinx-build -b needs_per_page source_dir build_dir | ||
|
||
|
||
Format | ||
++++++ | ||
.. code-block:: python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you move this to a json file and present it here via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just remove this and use the testing snapshots. |
||
|
||
{ | ||
"needs": [ | ||
{ | ||
"xyz_123": { | ||
"docname": "configuration", | ||
"doctype": ".rst", | ||
"lineno": 203, | ||
"target_id": "xyz_123", | ||
"external_url": null, | ||
"content_id": "xyz_123", | ||
"type": "req", | ||
"type_name": "Requirement", | ||
"type_prefix": "R_", | ||
"type_color": "#BFD8D2", | ||
"type_style": "node", | ||
"status": "open", | ||
"tags": [], | ||
"constraints": [], | ||
"constraints_passed": null, | ||
"constraints_results": {}, | ||
"id": "xyz_123", | ||
"title": "My requirement with custom options", | ||
"full_title": "My requirement with custom options", | ||
"content": "Some content", | ||
"collapse": null, | ||
"arch": {}, | ||
"style": null, | ||
"layout": "", | ||
"template": null, | ||
"pre_template": null, | ||
"post_template": null, | ||
"hide": false, | ||
"delete": null, | ||
"jinja_content": null, | ||
"parts": {}, | ||
"is_part": false, | ||
"is_need": true, | ||
"is_external": false, | ||
"external_css": "external_link", | ||
"is_modified": false, | ||
"modifications": 0, | ||
"my_extra_option": "A new option", | ||
"another_option": "filter_me", | ||
"author": "", | ||
"comment": "", | ||
"amount": "", | ||
"hours": "", | ||
"image": "", | ||
"config": "", | ||
"github": "", | ||
"value": "", | ||
"unit": "", | ||
"query": "", | ||
"specific": "", | ||
"max_amount": "", | ||
"max_content_lines": "", | ||
"id_prefix": "", | ||
"user": "", | ||
"created_at": "", | ||
"updated_at": "", | ||
"closed_at": "", | ||
"service": "", | ||
"url": "", | ||
"avatar": "", | ||
"params": "", | ||
"prefix": "", | ||
"url_postfix": "", | ||
"hidden": "", | ||
"duration": "", | ||
"completion": "", | ||
"has_dead_links": "", | ||
"has_forbidden_dead_links": "", | ||
"links": [], | ||
"links_back": [], | ||
"parent_needs": [], | ||
"parent_needs_back": [], | ||
"blocks": [], | ||
"blocks_back": [], | ||
"tests": [], | ||
"tests_back": [], | ||
"checks": [], | ||
"checks_back": [], | ||
"triggers": [], | ||
"triggers_back": [], | ||
"starts_with": [], | ||
"starts_with_back": [], | ||
"starts_after": [], | ||
"starts_after_back": [], | ||
"ends_with": [], | ||
"ends_with_back": [], | ||
"sections": [ | ||
"needs_extra_options", | ||
"Options", | ||
"Configuration" | ||
], | ||
"section_name": "needs_extra_options", | ||
"signature": "", | ||
"parent_need": "", | ||
"id_parent": "xyz_123", | ||
"id_complete": "xyz_123" | ||
} | ||
}, | ||
{ | ||
"EXTRA_REQ_001": { | ||
"docname": "configuration", | ||
"doctype": ".rst", | ||
"lineno": 371, | ||
"target_id": "EXTRA_REQ_001", | ||
"external_url": null, | ||
"content_id": "EXTRA_REQ_001", | ||
"type": "req", | ||
"type_name": "Requirement", | ||
"type_prefix": "R_", | ||
"type_color": "#BFD8D2", | ||
"type_style": "node", | ||
"status": null, | ||
"tags": [], | ||
"constraints": [], | ||
"constraints_passed": null, | ||
"constraints_results": {}, | ||
"id": "EXTRA_REQ_001", | ||
"title": "My requirement", | ||
"full_title": "My requirement", | ||
"content": "", | ||
"collapse": null, | ||
"arch": {}, | ||
"style": null, | ||
"layout": "", | ||
"template": null, | ||
"pre_template": null, | ||
"post_template": null, | ||
"hide": false, | ||
"delete": null, | ||
"jinja_content": null, | ||
"parts": {}, | ||
"is_part": false, | ||
"is_need": true, | ||
"is_external": false, | ||
"external_css": "external_link", | ||
"is_modified": false, | ||
"modifications": 0, | ||
"my_extra_option": "", | ||
"another_option": "", | ||
"author": "", | ||
"comment": "", | ||
"amount": "", | ||
"hours": "", | ||
"image": "", | ||
"config": "", | ||
"github": "", | ||
"value": "", | ||
"unit": "", | ||
"query": "", | ||
"specific": "", | ||
"max_amount": "", | ||
"max_content_lines": "", | ||
"id_prefix": "", | ||
"user": "", | ||
"created_at": "", | ||
"updated_at": "", | ||
"closed_at": "", | ||
"service": "", | ||
"url": "", | ||
"avatar": "", | ||
"params": "", | ||
"prefix": "", | ||
"url_postfix": "", | ||
"hidden": "", | ||
"duration": "", | ||
"completion": "", | ||
"has_dead_links": "", | ||
"has_forbidden_dead_links": "", | ||
"links": [], | ||
"links_back": [], | ||
"parent_needs": [], | ||
"parent_needs_back": [], | ||
"blocks": [], | ||
"blocks_back": [], | ||
"tests": [], | ||
"tests_back": [], | ||
"checks": [], | ||
"checks_back": [ | ||
"EXTRA_TEST_001" | ||
], | ||
"triggers": [], | ||
"triggers_back": [], | ||
"starts_with": [], | ||
"starts_with_back": [], | ||
"starts_after": [], | ||
"starts_after_back": [], | ||
"ends_with": [], | ||
"ends_with_back": [], | ||
"sections": [ | ||
"needs_extra_links", | ||
"Options", | ||
"Configuration" | ||
], | ||
"section_name": "needs_extra_links", | ||
"signature": "", | ||
"parent_need": "", | ||
"id_parent": "EXTRA_REQ_001", | ||
"id_complete": "EXTRA_REQ_001" | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -361,6 +361,9 @@ def custom_defined_func(): | |
# build needs.json to make permalinks work | ||
needs_build_json = True | ||
|
||
# build json file include needs with the same docs_name | ||
needs_per_page = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option name should be consistent with the other builders ( Thinking holistically, with there now being numerous data writers, and more on the way, maybe it makes sense to have some form of unified configuration option. For example: needs_data_writers = ["json", "json_per_id", "json_per_page"] |
||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2289,3 +2289,34 @@ If true, need options like status, tags or links are collapsed and shown only af | |
Default value: True | ||
|
||
Can be overwritten for each single need by setting :ref:`need_collapse`. | ||
|
||
|
||
.. _needs_per_page: | ||
|
||
needs_per_page | ||
~~~~~~~~~~~~~~ | ||
|
||
.. versionadded:: 1.4.0 | ||
|
||
Build list of ``json`` files that contain all found needs with the same ``docname``. The name of each file should match the ``docname``. | ||
|
||
This option works like :ref:`needs_build_json`. | ||
|
||
Default: False | ||
|
||
|
||
.. _needs_per_page_build_path: | ||
|
||
needs_per_page_build_path | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. versionadded:: 1.4.0 | ||
|
||
This option sets the location of list of ``json`` files that contain all found needs with the same ``docname``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a folder or a file name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is name of folder |
||
|
||
Default value: need_per_page | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please highlight path information like |
||
|
||
|
||
.. hint:: | ||
|
||
The created ``need_per_page`` folder gets stored in the ``outdir`` of the current builder folder. This is e.g `_build/needs_per_page/directives/list2need.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this syntax do?
Please build the docs and check for errors before submitting.
A
make docs-html
is now enough, as I fixed the doc-build and made it much easier.