From e8ebf0ee0d43f9bc3dfa74d044937c18c523b840 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Fri, 12 Apr 2019 15:58:00 -0700 Subject: [PATCH] Fix driver links rendering in the summary table This patch fixes driver links to render properly in the summary table. Previously, when a "link" was defined for a driver, the driver titles were not clickable and the driver link was not used. Change-Id: I08c45e4f1bd7b206cdc3896ee4dc049bbc4347a2 --- .../notes/fix-driver-links-18528dcdbcc9f007.yaml | 4 ++++ sphinx_feature_classification/support_matrix.py | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-driver-links-18528dcdbcc9f007.yaml diff --git a/releasenotes/notes/fix-driver-links-18528dcdbcc9f007.yaml b/releasenotes/notes/fix-driver-links-18528dcdbcc9f007.yaml new file mode 100644 index 0000000..355fb3f --- /dev/null +++ b/releasenotes/notes/fix-driver-links-18528dcdbcc9f007.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fixed driver links to render in the summary table. diff --git a/sphinx_feature_classification/support_matrix.py b/sphinx_feature_classification/support_matrix.py index aaab7fa..cf1fd0b 100644 --- a/sphinx_feature_classification/support_matrix.py +++ b/sphinx_feature_classification/support_matrix.py @@ -284,7 +284,15 @@ class Directive(rst.Directive): driver = matrix.drivers[key] implcol = nodes.entry() header.append(implcol) - implcol.append(nodes.strong(text=driver.title)) + if driver.link: + uri = driver.link + target_ref = nodes.reference("", refuri=uri) + target_txt = nodes.inline() + implcol.append(target_txt) + target_txt.append(target_ref) + target_ref.append(nodes.strong(text=driver.title)) + else: + implcol.append(nodes.strong(text=driver.title)) # We now produce the body of the table, one row for # each feature to report on