Skip to content

Commit

Permalink
Add link to source in catalog assets (#1362)
Browse files Browse the repository at this point in the history
Signed-off-by: elronbandel <elronbandel@gmail.com>
  • Loading branch information
elronbandel authored Nov 18, 2024
1 parent c7a2285 commit b6ed7db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ def make_content(artifact, label, all_labels):

# Replacement function
html_for_dict = re.sub(pattern, r"\1\2\3", html_for_dict)

source_link = f"""<a class="reference external" href="https://github.com/IBM/unitxt/blob/main/src/unitxt/catalog/{catalog_id.replace('.','/')}.json"><span class="viewcode-link"><span class="pre">[source]</span></span></a>"""
html_for_dict = f"""<div class="admonition note">
<p class="admonition-title">{catalog_id}</p>
<div class="highlight-json notranslate">
<div class="highlight"><pre>
{html_for_dict.strip()}
</pre></div></div>
</pre>{source_link}</div></div>
</div>""".replace("\n", "\n ")

result += " " + html_for_dict + "\n"
Expand Down

0 comments on commit b6ed7db

Please sign in to comment.