Spaces:
Sleeping
Sleeping
Mohammed AL Sarraj commited on
Commit ·
8806ae7
1
Parent(s): e30e13c
fix: broken API URLs and navigation links in doc forge
Browse files
app/tools/doc_forge/templates/doc_forge/docs.html
CHANGED
|
@@ -84,7 +84,7 @@
|
|
| 84 |
<span class="material-symbols-outlined text-base">open_in_new</span>
|
| 85 |
View on GitHub
|
| 86 |
</a>
|
| 87 |
-
<a href="/" class="flex items-center gap-2 text-on-surface-variant hover:text-primary text-xs py-2 px-2 transition-colors rounded-lg">
|
| 88 |
<span class="material-symbols-outlined text-base">add</span>
|
| 89 |
New Repository
|
| 90 |
</a>
|
|
@@ -97,7 +97,7 @@
|
|
| 97 |
|
| 98 |
{# Breadcrumb #}
|
| 99 |
<nav class="flex items-center gap-2 text-xs font-mono text-on-surface-variant mb-4">
|
| 100 |
-
<a href="/" class="hover:text-primary transition-colors">docforge</a>
|
| 101 |
<span class="material-symbols-outlined text-[12px]">chevron_right</span>
|
| 102 |
<span>{{ owner }}</span>
|
| 103 |
<span class="material-symbols-outlined text-[12px]">chevron_right</span>
|
|
@@ -347,7 +347,7 @@
|
|
| 347 |
{% endif %}
|
| 348 |
|
| 349 |
<div class="mt-12 pt-8 flex justify-between items-center text-sm text-on-surface-variant">
|
| 350 |
-
<a href="/" class="flex items-center gap-2 hover:text-primary transition-colors">
|
| 351 |
<span class="material-symbols-outlined text-base">arrow_back</span>
|
| 352 |
Back to DocForge
|
| 353 |
</a>
|
|
@@ -411,7 +411,7 @@ function copyCurrentTab() {
|
|
| 411 |
}
|
| 412 |
|
| 413 |
function downloadCurrentTab() {
|
| 414 |
-
window.location.href = '/api/download/{{ owner }}/{{ repo }}/' + _currentTab;
|
| 415 |
}
|
| 416 |
</script>
|
| 417 |
{% endblock %}
|
|
|
|
| 84 |
<span class="material-symbols-outlined text-base">open_in_new</span>
|
| 85 |
View on GitHub
|
| 86 |
</a>
|
| 87 |
+
<a href="/doc-forge/" class="flex items-center gap-2 text-on-surface-variant hover:text-primary text-xs py-2 px-2 transition-colors rounded-lg">
|
| 88 |
<span class="material-symbols-outlined text-base">add</span>
|
| 89 |
New Repository
|
| 90 |
</a>
|
|
|
|
| 97 |
|
| 98 |
{# Breadcrumb #}
|
| 99 |
<nav class="flex items-center gap-2 text-xs font-mono text-on-surface-variant mb-4">
|
| 100 |
+
<a href="/doc-forge/" class="hover:text-primary transition-colors">docforge</a>
|
| 101 |
<span class="material-symbols-outlined text-[12px]">chevron_right</span>
|
| 102 |
<span>{{ owner }}</span>
|
| 103 |
<span class="material-symbols-outlined text-[12px]">chevron_right</span>
|
|
|
|
| 347 |
{% endif %}
|
| 348 |
|
| 349 |
<div class="mt-12 pt-8 flex justify-between items-center text-sm text-on-surface-variant">
|
| 350 |
+
<a href="/doc-forge/" class="flex items-center gap-2 hover:text-primary transition-colors">
|
| 351 |
<span class="material-symbols-outlined text-base">arrow_back</span>
|
| 352 |
Back to DocForge
|
| 353 |
</a>
|
|
|
|
| 411 |
}
|
| 412 |
|
| 413 |
function downloadCurrentTab() {
|
| 414 |
+
window.location.href = '/doc-forge/api/download/{{ owner }}/{{ repo }}/' + _currentTab;
|
| 415 |
}
|
| 416 |
</script>
|
| 417 |
{% endblock %}
|
app/tools/doc_forge/templates/doc_forge/index.html
CHANGED
|
@@ -258,7 +258,7 @@
|
|
| 258 |
<h2 class="text-2xl font-bold tracking-tight text-on-surface mb-8">Recent Repositories</h2>
|
| 259 |
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
| 260 |
{% for r in recent %}
|
| 261 |
-
<a href="
|
| 262 |
class="group block bg-surface-container-lowest p-6 rounded-xl hover:bg-surface-container transition-colors">
|
| 263 |
<div class="flex items-start justify-between mb-3">
|
| 264 |
<div>
|
|
@@ -405,14 +405,14 @@ async function generateDocs() {
|
|
| 405 |
}, 1800);
|
| 406 |
|
| 407 |
try {
|
| 408 |
-
const res = await _post('
|
| 409 |
const data = await res.json();
|
| 410 |
clearInterval(ticker);
|
| 411 |
if (!res.ok) throw new Error(data.error || 'Generation failed');
|
| 412 |
|
| 413 |
setProgress(100, 'Complete! Redirecting…');
|
| 414 |
setTimeout(() => {
|
| 415 |
-
window.location.href = `
|
| 416 |
}, 600);
|
| 417 |
} catch (err) {
|
| 418 |
clearInterval(ticker);
|
|
|
|
| 258 |
<h2 class="text-2xl font-bold tracking-tight text-on-surface mb-8">Recent Repositories</h2>
|
| 259 |
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
| 260 |
{% for r in recent %}
|
| 261 |
+
<a href="docs/{{ r.owner }}/{{ r.repo }}"
|
| 262 |
class="group block bg-surface-container-lowest p-6 rounded-xl hover:bg-surface-container transition-colors">
|
| 263 |
<div class="flex items-start justify-between mb-3">
|
| 264 |
<div>
|
|
|
|
| 405 |
}, 1800);
|
| 406 |
|
| 407 |
try {
|
| 408 |
+
const res = await _post('api/generate', {url, types});
|
| 409 |
const data = await res.json();
|
| 410 |
clearInterval(ticker);
|
| 411 |
if (!res.ok) throw new Error(data.error || 'Generation failed');
|
| 412 |
|
| 413 |
setProgress(100, 'Complete! Redirecting…');
|
| 414 |
setTimeout(() => {
|
| 415 |
+
window.location.href = `docs/${data.owner}/${data.repo}`;
|
| 416 |
}, 600);
|
| 417 |
} catch (err) {
|
| 418 |
clearInterval(ticker);
|