Skip to content

Commit

Permalink
add remove empty href from links in report (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
pplonski committed Apr 9, 2021
1 parent 798df49 commit 034e40b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions supervised/base_automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,14 @@ def from_json(self, json_data):
padding-bottom: 5px;
margin-bottom: 0px;
}
a {
font-weight: bold;
}
a:hover {
cursor: pointer;
}
"""

Expand Down Expand Up @@ -2067,17 +2075,16 @@ def _md_to_html(self, md_fname, page_type, dir_path, me=None):

# change links
if page_type == "main":
hrefs = []
for f in os.listdir(dir_path):
if os.path.exists(os.path.join(dir_path, f, "README.md")):
old = f'href="{f}/README.html"'
new = f"onclick=\"toggleShow('{f}');toggleShow('main')\" href=\"javascript:void(0);\""
new = f"onclick=\"toggleShow('{f}');toggleShow('main')\" "
content_html = content_html.replace(old, new)

# other links
if me is not None:
old = 'href="../README.html"'
new = f"onclick=\"toggleShow('{me}');toggleShow('main')\" href=\"javascript:void(0);\""
new = f"onclick=\"toggleShow('{me}');toggleShow('main')\" "
content_html = content_html.replace(old, new)

beginning = ""
Expand All @@ -2086,7 +2093,7 @@ def _md_to_html(self, md_fname, page_type, dir_path, me=None):
beginning += """<img src="https://raw.githubusercontent.com/mljar/visual-identity/main/media/mljar_AutomatedML.png" style="height:128px; margin-left: auto;
margin-right: auto;display: block;"/>\n\n"""
if os.path.exists(os.path.join(self._results_path, "EDA")):
beginning += "<a onclick=\"toggleShow('EDA');toggleShow('main')\" href=\"javascript:void(0);\">Automatic Exploratory Data Analysis Report</a>"
beginning += "<a onclick=\"toggleShow('EDA');toggleShow('main')\" >Automatic Exploratory Data Analysis Report</a>"

content_html = beginning + content_html

Expand Down

0 comments on commit 034e40b

Please sign in to comment.