Skip to content

Commit

Permalink
feat: Documentation integration (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Valia Fetisov <[email protected]>
  • Loading branch information
KirillDogadin-std and valiafetisov authored Apr 14, 2023
1 parent e0701ac commit 52a1e29
Show file tree
Hide file tree
Showing 12 changed files with 14,516 additions and 19,049 deletions.
9 changes: 9 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ You can build application for production using `npm run build` and then locally
## Health endpoint

Endpoint available at `/healthz` path. Provides response if frontend is currently running.

## Documentation page

One of the frontend's features is displaying the documentation about document model.
The documentation is provided to the service externally as raw typedoc output in markdown format.

To display the documentation on the frontend the provided data has to be processed and represented in the form of a single file.

TODO: add the precise process in separate issue
4 changes: 2 additions & 2 deletions frontend/app.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<NMessageProvider>
<div class="h-screen flex flex-col">
<div class="h-screen flex flex-col w-full">
<LayoutTheHeader :user="user" :is-authorized="isAuthorized" class="flex-shrink-0 h-14 fixed top-0 z-10" />
<div class="flex-grow mt-14">
<div class="flex-grow mt-14 w-full">
<NuxtPage :user="user" />
</div>
</div>
Expand Down
38 changes: 38 additions & 0 deletions frontend/components/doc/TableOfContents.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script setup lang="ts">
const props = defineProps<{
tocLinks: Array<{
id: string;
text: string;
children: { id: string; text: string }[];
}> | null;
}>()
defineEmits<{(e: 'scrollToId', id: string): void }>()
</script>

<template>
<nav>
<ul class="!p-0">
<li
v-for="{ id, text, children } in props.tocLinks"
:id="`toc-${id}`"
:key="id"
class="text-sm list-none"
>
<template v-if="text !== 'Table of contents'">
<a :href="`#${id}`" class="!text-neutral-800" @click="$emit('scrollToId', id)">{{ text }}</a>
<ul v-if="children" class="!p-0 ml-4 mt-1 mb-2 flex flex-col gap-2">
<li
v-for="{ id: childId, text: childText } in children"
:id="`toc-${childId}`"
:key="childId"
class="text-xs list-none ml-0 hover:underline"
>
<a :href="`#${childId}`" class="!text-neutral-700" @click="$emit('scrollToId', childId)">{{ childText }}</a>
</li>
</ul>
</template>
</li>
</ul>
</nav>
</template>
2 changes: 1 addition & 1 deletion frontend/components/layout/TheMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
const links = [
{
id: '/',
id: '/documentation',
icon: DocumentText24Regular,
label: 'Documentation'
},
Expand Down
Loading

0 comments on commit 52a1e29

Please sign in to comment.