-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from ferrocene/hoverbear/manually-update
Manual update from ferrocene/ferrocene
- Loading branch information
Showing
11 changed files
with
408 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# SPDX-License-Identifier: MIT OR Apache-2.0 | ||
# SPDX-FileCopyrightText: The Ferrocene Developers | ||
|
||
import sphinx_needs | ||
import json | ||
|
||
|
||
def configure_sphinx_needs(app, config): | ||
config.needs_types = [ | ||
{ | ||
"directive": "hazop-use", | ||
"title": "Use Case", | ||
"prefix": "USE_", | ||
"color": "", | ||
"style": "", | ||
}, | ||
{ | ||
"directive": "hazop-error", | ||
"title": "Potential error", | ||
"prefix": "ERR_", | ||
"color": "", | ||
"style": "", | ||
}, | ||
{ | ||
"directive": "constraint", | ||
"title": "Constraint", | ||
"prefix": "CONSTR_", | ||
"color": "", | ||
"style": "", | ||
}, | ||
{ | ||
"directive": "req", | ||
"title": "Requirement", | ||
"prefix": "REQ_", | ||
"color": "", | ||
"style": "", | ||
}, | ||
] | ||
|
||
config.needs_extra_links = [ | ||
{ | ||
"option": "caused_by", | ||
"incoming": "causes", | ||
"outgoing": "caused by", | ||
}, | ||
{ | ||
"option": "mitigates", | ||
"incoming": "mitigated by", | ||
"outgoing": "mitigates", | ||
}, | ||
{ | ||
"option": "implements", | ||
"incoming": "implemented by", | ||
"outgoing": "implements", | ||
}, | ||
] | ||
|
||
config.needs_default_layout = "ferrocene" | ||
config.needs_layouts = { | ||
# Forked from the builtin "clean" layout, but without the arrow to | ||
# collapse the meta information. That arrow generates HTML that | ||
# linkchecker doesn't like, unfortunately :( | ||
"ferrocene": { | ||
"grid": "simple", | ||
"layout": { | ||
"head": ['<<meta("type_name")>>: **<<meta("title")>>** <<meta_id()>>'], | ||
"meta": ["<<meta_all(no_links=True)>>", "<<meta_links_all()>>"], | ||
}, | ||
}, | ||
} | ||
|
||
if config.ferrocene_external_needs is not None: | ||
config.needs_external_needs = json.loads(config.ferrocene_external_needs) | ||
|
||
config.needs_title_optional = True | ||
config.needs_build_json = True | ||
config.needs_reproducible_json = True | ||
|
||
|
||
def setup(app): | ||
sphinx_needs.setup(app) | ||
|
||
app.add_config_value("ferrocene_external_needs", None, "env", str) | ||
app.connect("config-inited", configure_sphinx_needs, priority=100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.