Skip to content

Commit 7c8cf19

Browse files
author
The TensorFlow Datasets Authors
committed
Fix hyperlinks in collection markdown builder.
PiperOrigin-RevId: 478759720
1 parent e9bd6af commit 7c8cf19

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tensorflow_datasets/scripts/documentation/collection_markdown_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _list_datasets(self,
160160
datasets = collection_loader.collection.get_collection()
161161
for name, reference in datasets.items():
162162
ds_link = self._get_dataset_catalog_link(reference)
163-
yield f' * `{name}`: `[{reference.tfds_name()}]({ds_link})`'
163+
yield f' * `{name}`: [`{reference.tfds_name()}`]({ds_link})'
164164

165165
def content(self, loader: tfds.core.DatasetCollectionLoader):
166166
return dmb.IntentedBlock('\n'.join(self._list_datasets(loader)))

tensorflow_datasets/scripts/documentation/collection_markdown_builder_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def test_collection_datasets_section(
7272
dummy_dc_loader: tfds.core.DatasetCollectionLoader): # pylint: disable=redefined-outer-name
7373
datasets_section = collection_markdown_builder.CollectionDatasetsSection()
7474
expected_lines = [
75-
' * `a`: `[a/c:1.3.5](https://www.tensorflow.org/datasets/catalog/a#c)`',
76-
' * `b`: `[b/d:2.4.8](https://www.tensorflow.org/datasets/catalog/b#d)`',
77-
' * `c`: `[c/e:3.5.7](https://www.tensorflow.org/datasets/catalog/c#e)`',
75+
' * `a`: [`a/c:1.3.5`](https://www.tensorflow.org/datasets/catalog/a#c)',
76+
' * `b`: [`b/d:2.4.8`](https://www.tensorflow.org/datasets/catalog/b#d)',
77+
' * `c`: [`c/e:3.5.7`](https://www.tensorflow.org/datasets/catalog/c#e)',
7878
]
7979
assert datasets_section.content(
8080
loader=dummy_dc_loader) == '\n'.join(expected_lines)
@@ -88,5 +88,5 @@ def test_get_collection_markdown_string(
8888
assert 'dummy_dataset_collection' in doc # Collection heading.
8989
assert 'my description' in doc # Collection description.
9090
assert '@misc{citekey' in doc # Collection citation.
91-
assert ('`[c/e:3.5.7](https://www.tensorflow.org/datasets/catalog/c#e)`'
91+
assert ('[`c/e:3.5.7`](https://www.tensorflow.org/datasets/catalog/c#e)'
9292
in doc) # Collection dataset.

0 commit comments

Comments
 (0)