Skip to content

Commit

Permalink
[DOCS-3222] Update index for C# driver
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Aug 15, 2024
1 parent db7a831 commit 31ef1ea
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn
off this behavior by setting the `githubPages` option to false.
142 changes: 135 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,135 @@
<section style="margin: 20px">
<header>Current Version</header>
<li><a href='https://fauna.github.io/fauna-dotnet/0.2.0-beta'>0.2.0-beta</a></li>
</section>
<section style="margin: 20px">
<header>All Versions</header>
</section>
<!doctype html>
<html class="default" lang="en">

<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>Fauna v10 .NET/C# driver - API reference</title>
<meta name="description" content="API reference documentation for the Fauna v10 .NET/C# driver" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}

h1 {
color: #2c3e50;
border-bottom: 2px solid #3498db;
padding-bottom: 10px;
}

a {
color: #3498db;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}

th,
td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}

th {
background-color: #f2f2f2;
font-weight: bold;
}

tr:hover {
background-color: #f5f5f5;
}

p {
margin-bottom: 20px;
}
</style>
</head>

<body>
<h1>Fauna v10 .NET/C# driver - API reference</h1>
<p>This site contains API reference documentation for the
<a href="https://github.com/fauna/fauna-dotnet">Fauna v10 .NET/C# driver</a>.<br>
The documentation is generated using Doxygen.
</p>
<p>
For examples and tutorials, see the
<a href="https://github.com/fauna/fauna-dotnet">driver README</a> and
the
<a href="https://docs.fauna.com/fauna/current/build/drivers/csharp-client/">Fauna docs</a>.
</p>
<script>
(async () => {
const branch = 'gh-pages';
const response = await fetch(`https://api.github.com/repos/fauna/fauna-dotnet/contents?ref=${branch}`);
const data = await response.json();
let tableRows = [];
let latestTarget = '';

for (let item of data) {
if (item.name === 'latest' && item.type === 'symlink') {
const symlinkResponse = await fetch(item.url);
const symlinkData = await symlinkResponse.json();
latestTarget = symlinkData.target.replace('https://github.com/fauna/fauna-dotnet/tree/gh-pages/', '');
}
}

for (let item of data) {
if (item.type === 'dir') {
const url = item.html_url.replace('https://github.com/fauna/fauna-dotnet/tree/gh-pages/', 'https://fauna.github.io/fauna-dotnet/');

let displayName = item.name;

if (item.name === latestTarget) {
displayName += ' (latest)';
}

tableRows.push({
name: displayName,
url: url,
});
}
}

tableRows.sort((a, b) => {
if (a.name.includes('(Latest)')) return -1;
if (b.name.includes('(Latest)')) return 1;
return b.name.localeCompare(a.name, undefined, { numeric: true, sensitivity: 'base' });
});

let htmlString = `
<table>
<tr>
<th>Version</th>
</tr>
`;

for (let row of tableRows) {
htmlString += `
<tr>
<td><a href="${row.url}">${row.name}</a></td>
</tr>
`;
}

htmlString += '</table>';
document.body.insertAdjacentHTML('beforeend', htmlString);
})()
</script>
</body>

</html>
1 change: 1 addition & 0 deletions latest

0 comments on commit 31ef1ea

Please sign in to comment.