Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgilley committed Mar 25, 2024
1 parent e69684b commit a86e5bc
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 48 deletions.
26 changes: 17 additions & 9 deletions GitHub/docs_dashboard-h.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,25 @@ def write_html(notebooks):
row = f'<tr><td>{status}</td><td><a href="{gh_link}/{notebook}">{file}</a></td></tr>\n'
rows_by_extension[extension].append(row)

# read the top part of the html file from top.html
script_dir = os.path.dirname(os.path.realpath(__file__)) # Get the directory that the script is in
with open(os.path.join(script_dir,'top.html'), 'r') as top_file:
top_contents = top_file.read()
with open(os.path.join(script_dir,'jumps.html'), 'r') as jumps:
jumps = jumps.read()
with open(html_file, 'w') as file:
file.write('<html>\n<head>\n<title>Code snippets dashboard</title>\n<link rel="stylesheet" type="text/css" href="styles.css">\n</head>\n<body>\n')
file.write('<div class="banner">\n<a href="index.html">Home</a> <span class="dot"></span>\n<a href="dashboard.html">Dashboard</a>\n</div>')
file.write('Jump to:\n<ul><a href=#.ipynb>notebooks</a></ul>\n<ul><a href=#.json>.json</a></ul>\n<ul><a href=#.py>.py</a></ul>\n<ul><a href=#.sh>.sh</a></ul>\n<ul><a href=#.yaml>.yaml</a></ul>\n<ul><a href=#.yml>.yml</a></ul>\n')
file.write('<html>\n<head>\n<title>Code snippets dashboard</title>\n')
file.write(top_contents)
file.write('<h1>Code snippets dashboard</h1>\n')
file.write(jumps)
for extension in sorted(rows_by_extension.keys()):
rows = rows_by_extension[extension]
file.write(f'<a name={extension}></a><h2>{extension}</h2>\n')
file.write('<table>\n')
for row in rows:
file.write(row)
file.write('</table>\n')
rows = rows_by_extension[extension]
if extension != '':
file.write(f'<a name={extension}></a><h2>{extension}</h2>\n')
file.write('<table>\n')
for row in rows:
file.write(row)
file.write('</table>\n')
file.write('</body>\n</html>')

# This is the main function
Expand Down
9 changes: 9 additions & 0 deletions GitHub/jumps.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="mini-banner">
Jump to:
<ul><a class="fa fa-arrow-circle-o-right" href=#.ipynb>.ipynb (notebooks)</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.json>.json</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.py>.py</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.sh>.sh</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.yaml>.yaml</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.yml>.yml</a></ul>
</div>
6 changes: 6 additions & 0 deletions GitHub/top.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>
<div class="banner">
<a href="index.html"><i class="fa fa-home"></i>Home</a> &nbsp; <i class="fa fa-check-circle-o" style="color:white"></i> <a href="dashboard.html">Dashboard</a>
</div>
30 changes: 15 additions & 15 deletions docs/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<html>
<head>
<title>Code snippets dashboard</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="banner">
<a href="index.html">Home</a> <span class="dot"></span>
<a href="dashboard.html">Dashboard</a>
</div>Jump to:
<ul><a href=#.ipynb>notebooks</a></ul>
<ul><a href=#.json>.json</a></ul>
<ul><a href=#.py>.py</a></ul>
<ul><a href=#.sh>.sh</a></ul>
<ul><a href=#.yaml>.yaml</a></ul>
<ul><a href=#.yml>.yml</a></ul>

<a name=.ipynb ></a><h2>.ipynb </h2>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>
<div class="banner">
<a href="index.html"><i class="fa fa-home"></i>Home</a> &nbsp; <i class="fa fa-check-circle-o" style="color:white"></i> <a href="dashboard.html">Dashboard</a>
</div><h1>Code snippets dashboard</h1>
<div class="mini-banner">
Jump to:
<ul><a class="fa fa-arrow-circle-o-right" href=#.ipynb>.ipynb (notebooks)</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.json>.json</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.py>.py</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.sh>.sh</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.yaml>.yaml</a></ul>
<ul><a class="fa fa-arrow-circle-o-right" href=#.yml>.yml</a></ul>
</div><a name=.ipynb ></a><h2>.ipynb </h2>
<table>
<tr><td><a href="https://github.com/Azure/azureml-examples/actions/workflows/sdk-assets-environment-environment.yml"><img src="https://github.com/Azure/azureml-examples/actions/workflows/sdk-assets-environment-environment.yml/badge.svg?branch=main" alt="environment&#46;ipynb "></a></td><td><a href="https://github.com/Azure/azureml-examples/blob/main//sdk/python/assets/environment/environment.ipynb ">environment.ipynb </a></td></tr>
<tr><td><a href="https://github.com/Azure/azureml-examples/actions/workflows/sdk-assets-model-model.yml"><img src="https://github.com/Azure/azureml-examples/actions/workflows/sdk-assets-model-model.yml/badge.svg?branch=main" alt="model&#46;ipynb "></a></td><td><a href="https://github.com/Azure/azureml-examples/blob/main//sdk/python/assets/model/model.ipynb ">model.ipynb </a></td></tr>
Expand Down
12 changes: 5 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html>
<head>
<title>Azure Machine Learning code snippets</title>
<!-- Contents of top.html -->
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="shortcut icon" type="image/png"
href="{{ "/media/favicon.png" | absolute_url }}">
</head>
<body>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>
<div class="banner">
<a href="index.html">Home</a> <span class="dot"></span> <a href="dashboard.html">Dashboard</a>
<a href="index.html"><i class="fa fa-home"></i>Home</a> &nbsp; <i class="fa fa-check-circle-o" style="color:white"></i> <a href="dashboard.html">Dashboard</a>
</div>
<!-- end of top.html -->
<h1>Azure Machine Learning code snippets</h1>
<h2>Find the workflow and file for a code snippet</h2>
Enter your code snippet here (including ~/azureml-) to find the workflow and file in the AzureML examples repository.
Expand All @@ -20,8 +20,6 @@ <h2>Find the workflow and file for a code snippet</h2>
<p id="workflow_link"></p>
<p id="file_link"></p>

<h2>Dashboard</h2>
View the <a href="DASHBOARD.html">dashboard</a> to see the status of all code snippets.

<script>
document.getElementById('form').addEventListener('submit', function(event) {
Expand Down
29 changes: 12 additions & 17 deletions docs/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,18 @@ table, th, td {
text-align: left;
}

th {
background-color: #4CAF50;
color: white;
}

tr:nth-child(even) {
background-color: #f2f2f2;
}

a {
color: #4CAF50;
color: #0078D4;
text-decoration: none;
}

a:hover {
color: #39833c;
color: #00AAFF;
}
input[type=submit] {
background-color: #4CAF50; /* Green */
background-color: #0078D4; /* blue */
border-radius: 10px;
border-color: #39833c;
border: none;
color: white;
padding: 5px 10px;
text-align: center;
Expand All @@ -53,7 +44,7 @@ input[type=submit] {
}

input[type=submit]:hover {
background-color: #45a049;
background-color: #00AAFF;
}

input[type="text"] {
Expand All @@ -63,19 +54,23 @@ input[type="text"] {
.banner {
width: 100%;
height: 25px;
border: solid;
background-color: #333333;
border: none;
border-radius: 10px;
background-color:#0078D4;
margin: auto;
text-align: center;
padding: 10px;
}
.mini-banner ul {
display: inline-block;
}

.banner a {
display: inline-block;
color: #ffffff;
text-decoration: none;
font-weight: bold;
font-size: 18px;
font-size: 16px;
}

.banner a:hover {
Expand Down

0 comments on commit a86e5bc

Please sign in to comment.