Skip to content

Commit 087622d

Browse files
committed
feat: add RepositoryReference component and update DNS documentation with references
1 parent 23eec98 commit 087622d

4 files changed

Lines changed: 144 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<script setup>
2+
import { computed } from "vue";
3+
4+
const props = defineProps({
5+
path: {
6+
type: String,
7+
required: true,
8+
},
9+
});
10+
11+
const href = computed(() => {
12+
return `https://github.com/AlixANNERAUD/Infrastructure/tree/main/${props.path}`;
13+
});
14+
const label = computed(() => `<code>${props.path}</code>`);
15+
</script>
16+
17+
<template>
18+
<a :href="href" class="external-reference-link">
19+
<slot><span v-html="label"></span></slot>
20+
</a>
21+
</template>
22+
23+
<style scoped>
24+
.external-reference-link {
25+
color: var(--vp-c-brand-1);
26+
text-decoration: none;
27+
}
28+
29+
.external-reference-link:hover {
30+
color: var(--vp-c-brand-2);
31+
text-decoration: underline;
32+
}
33+
</style>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import type { Theme } from "vitepress";
2+
import DefaultTheme from "vitepress/theme";
3+
import { App } from "vue";
4+
5+
function registerComponents(app: App<any>) {
6+
// Auto-register all components in the components directory
7+
const components = import.meta.glob("./components/**/*.vue", {
8+
eager: true,
9+
});
10+
11+
for (const path in components) {
12+
const component = components[path] as any;
13+
const componentName = path
14+
.split("/")
15+
.pop()
16+
?.replace(/\.\w+$/, ""); // Remove file extension
17+
18+
if (componentName) {
19+
app.component(componentName, component.default);
20+
}
21+
}
22+
}
23+
24+
export default {
25+
extends: DefaultTheme,
26+
enhanceApp({ app }) {
27+
registerComponents(app);
28+
},
29+
} satisfies Theme;
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
export enum ReferenceCrate {
2+
Abi_context = "abi_context",
3+
Abi_declarations = "abi_declarations",
4+
Abi_definitions = "abi_definitions",
5+
Authentication = "authentication",
6+
Bootsplash = "bootsplash",
7+
Device = "device",
8+
Executable = "executable",
9+
File_system = "file_system",
10+
Graphics = "graphics",
11+
Host_bindings = "host_bindings",
12+
Internationalization = "internationalization",
13+
LittleFs = "littlefs",
14+
Log = "log",
15+
Memory = "memory",
16+
Network = "network",
17+
Synchronization = "synchronization",
18+
Task = "task",
19+
Time = "time",
20+
Users = "users",
21+
VirtualFileSystem = "virtual_file_system",
22+
VirtualMachine = "virtual_machine",
23+
Xila = "xila",
24+
}
25+
26+
export enum ReferenceArchitecture {
27+
Host = "host",
28+
Wasm = "wasm",
29+
}
30+
31+
export enum ReferenceKind {
32+
Structure = "struct",
33+
Enumeration = "enum",
34+
Function = "fn",
35+
Constant = "const",
36+
Trait = "trait",
37+
Module = "mod",
38+
Macro = "macro",
39+
Type = "type",
40+
}
41+
42+
export function getReferencePath(kind: ReferenceKind, symbol: string): string {
43+
return `${kind}.${symbol}.html`;
44+
}
45+
46+
export function getReferenceDisplayName(
47+
crate: ReferenceCrate,
48+
kind?: ReferenceKind,
49+
symbol?: string,
50+
): string {
51+
if (!kind || !symbol) {
52+
return `<code>${crate}</code> crate`;
53+
}
54+
55+
switch (kind) {
56+
case ReferenceKind.Function:
57+
return `<code>${crate}::${symbol}()</code>`;
58+
case ReferenceKind.Module:
59+
return `<code>${crate}::${symbol}</code>`;
60+
case ReferenceKind.Trait:
61+
return `<code>${crate}::${symbol}</code>`;
62+
case ReferenceKind.Type:
63+
return `<code>${crate}::${symbol}</code>`;
64+
case ReferenceKind.Constant:
65+
return `<code>${crate}::${symbol}</code>`;
66+
case ReferenceKind.Macro:
67+
return `<code>${crate}::${symbol}!</code>`;
68+
case ReferenceKind.Enumeration:
69+
return `<code>${crate}::${symbol}</code>`;
70+
case ReferenceKind.Structure:
71+
return `<code>${crate}::${symbol}</code>`;
72+
default:
73+
return `<code>${symbol}</code>`;
74+
}
75+
}

services/website/src/documentation/dns.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ La plupart des services utilisent des enregistrements CNAME pointant vers le ser
1111
| global.bruxelles.anneraud.fr | Accès réseau global à Bruxelles | Public | Bruxelles | Dynamique |
1212
| global.luxembourg.anneraud.fr | Accès réseau global à Luxembourg | Public | Luxembourg | Statique |
1313

14-
Voir [playbooks/cloudflare/update_dns.yml](../playbooks/cloudflare/update_dns.yml) ou les playbooks de déploiement de services pour la liste complète des enregistrements DNS et leurs configurations.
14+
Voir:
15+
16+
- <RepositoryReference path="services/cloudflare/update_dns_anneraud.yml" />
17+
- <RepositoryReference path="services/cloudflare/update_dns_guenola_sahut.yml" />
18+
- <RepositoryReference path="services/cloudflare/update_dns_mini_train_store.yml" />
19+
- <RepositoryReference path="services/cloudflare/update_dns_xila.yml" />
20+
ou les playbooks de déploiement de services pour la liste complète des enregistrements DNS et leurs configurations.

0 commit comments

Comments
 (0)