Skip to content

Commit

Permalink
doc: extensions: api_overview: do not hardcode github URL
Browse files Browse the repository at this point in the history
Add a new extension config value so that repo URL is not hardcoded in
the extension code.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and kartben committed Jan 8, 2025
1 parent 29257f6 commit 17806f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/_extensions/zephyr/api_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def generate_table(self, toplevel, groups):

def visit_group(self, group, all_groups, rows, indent=0):
version = since = ""
github_uri = "https://github.com/zephyrproject-rtos/zephyr/releases/tag/"
github_uri = self.config.api_overview_base_url + "/releases/tag/"
cdef = group.get_compounddef()[0]

ssects = [
Expand Down Expand Up @@ -150,6 +150,7 @@ def visit_group(self, group, all_groups, rows, indent=0):

def setup(app) -> dict[str, Any]:
app.add_config_value("api_overview_doxygen_out_dir", "", "env")
app.add_config_value("api_overview_base_url", "", "env")

app.add_directive("api-overview-table", ApiOverview)

Expand Down
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@
# -- Options for zephyr.api_overview --------------------------------------

api_overview_doxygen_out_dir = str(doxyrunner_projects["zephyr"]["outdir"])
api_overview_base_url = "https://github.com/zephyrproject-rtos/zephyr"

def setup(app):
# theme customizations
Expand Down

0 comments on commit 17806f2

Please sign in to comment.