ola13 commited on
Commit
d41febc
β€’
1 Parent(s): b5a5e67

fix docid formatting

Browse files
Files changed (1) hide show
  1. app.py +22 -14
app.py CHANGED
@@ -20,22 +20,30 @@ def get_docid_html(docid):
20
  data_org, dataset, docid = docid.split("/")
21
  metadata = roots_datasets[dataset]
22
  if metadata.private:
23
- docid_html = (
24
- f"<a "
25
- f'class="underline-on-hover"'
26
- f'title="This dataset is private. See the introductory text for more information"'
27
- f'style="color:#AA4A44;"'
28
- f'href="https://huggingface.co/datasets/bigscience-data/{dataset}"'
29
- f'target="_blank"><b>πŸ”’{dataset}</b></a><span style="color: #7978FF;">/{docid}</span>'
 
 
 
 
30
  )
31
  else:
32
- docid_html = (
33
- f"<a "
34
- f'class="underline-on-hover"'
35
- f'title="This dataset is licensed {metadata.tags[0].split(":")[-1]}"'
36
- f'style="color:#2D31FA;"'
37
- f'href="https://huggingface.co/datasets/bigscience-data/{dataset}"'
38
- f'target="_blank"><b>{dataset}</b></a><span style="color: #7978FF;">/{docid}</span>'
 
 
 
 
39
  )
40
  return docid_html
41
 
 
20
  data_org, dataset, docid = docid.split("/")
21
  metadata = roots_datasets[dataset]
22
  if metadata.private:
23
+ docid_html = """
24
+ <a title="This dataset is private. See the introductory text for more information"
25
+ style="color:#AA4A44; font-weight: bold; text-decoration:none"
26
+ onmouseover="style='color:#AA4A44; font-weight: bold; text-decoration:underline'"
27
+ onmouseout="style='color:#AA4A44; font-weight: bold; text-decoration:none'"
28
+ href="https://huggingface.co/datasets/bigscience-data/{dataset}"
29
+ target="_blank">
30
+ πŸ”’{dataset}
31
+ </a>
32
+ <span style="color:#7978FF; ">/{docid}</span>""".format(
33
+ dataset=dataset, docid=docid
34
  )
35
  else:
36
+ docid_html = """
37
+ <a title="This dataset is licensed {metadata}"
38
+ style="color:#7978FF; font-weight: bold; text-decoration:none"
39
+ onmouseover="style='color:#7978FF; font-weight: bold; text-decoration:underline'"
40
+ onmouseout="style='color:#7978FF; font-weight: bold; text-decoration:none'"
41
+ href="https://huggingface.co/datasets/bigscience-data/{dataset}"
42
+ target="_blank">
43
+ {dataset}
44
+ </a>
45
+ <span style="color:#7978FF; ">/{docid}</span>""".format(
46
+ metadata=metadata.tags[0].split(":")[-1], dataset=dataset, docid=docid
47
  )
48
  return docid_html
49