Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation integration #42

Merged
merged 34 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d246620
documentation-integration
KirillDogadin-std Apr 5, 2023
1bce594
add generation script
KirillDogadin-std Apr 6, 2023
d307d40
lint
KirillDogadin-std Apr 6, 2023
d7e1cc8
add command for doc gen
KirillDogadin-std Apr 6, 2023
b311227
embed the docs into the frontend
KirillDogadin-std Apr 6, 2023
a11ec38
lint
KirillDogadin-std Apr 6, 2023
8b93c67
extend frontend readme
KirillDogadin-std Apr 6, 2023
1ed85a1
better style
KirillDogadin-std Apr 6, 2023
cbb3d59
improve doc generations
KirillDogadin-std Apr 6, 2023
1dced10
basic stable
KirillDogadin-std Apr 6, 2023
d4beb5e
dont gen toc
KirillDogadin-std Apr 6, 2023
d4f70f4
bonk, toc has style and swag
KirillDogadin-std Apr 6, 2023
04dbe16
a bit nicer
KirillDogadin-std Apr 7, 2023
9fbfdb5
move logic to docs from component
KirillDogadin-std Apr 7, 2023
ffdbb6d
responsivier
KirillDogadin-std Apr 11, 2023
f6cea25
Merge branch 'main' into doc-integration
KirillDogadin-std Apr 11, 2023
49f8052
rm files
KirillDogadin-std Apr 12, 2023
6298d38
micro polish
KirillDogadin-std Apr 12, 2023
f3cebb2
simplier readme
KirillDogadin-std Apr 12, 2023
7f43b06
as above
KirillDogadin-std Apr 12, 2023
1206c7d
rename npm command
KirillDogadin-std Apr 12, 2023
c2ed5d6
rm mkdirp dep
KirillDogadin-std Apr 12, 2023
9d0958f
rm vueuse dep
KirillDogadin-std Apr 12, 2023
b4e5b97
lint
KirillDogadin-std Apr 12, 2023
25350a9
Merge branch 'main' into doc-integration
KirillDogadin-std Apr 13, 2023
bfc2249
update kube
KirillDogadin-std Apr 13, 2023
e5b78d1
Merge branch 'main' into doc-integration
KirillDogadin-std Apr 13, 2023
e1a5a9f
regen package lock
KirillDogadin-std Apr 13, 2023
809fc9a
fix @huntersofbook/naive-ui-nuxt to 0.5.1
valiafetisov Apr 13, 2023
da5e2dc
fix default api endpoint
KirillDogadin-std Apr 13, 2023
2744dd2
cleanup styles and logic
valiafetisov Apr 14, 2023
4f7110a
Merge branch 'doc-integration' of github.com:makerdao-ses/switchboard…
valiafetisov Apr 14, 2023
75e868a
fix
valiafetisov Apr 14, 2023
d48cae2
fix width
valiafetisov Apr 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 4 additions & 0 deletions frontend/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ const { isAuthorized, user } = useAuth()
html, body {
@apply bg-neutral-50;
}

.Body {
@apply h-[calc(100vh-88px)];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a terrible hack (to hardcode height of the header in css). I suggest to remove it (here and in the other place) and instead use combination of flex-grow and h-full. Overall, you can maybe wait for the #38 merged cause it also fixes some of the related issues (eg fixed header)

</style>
42 changes: 42 additions & 0 deletions frontend/components/doc/TableOfContents.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script setup lang="ts">
const props = defineProps<{
tocLinks: Array<{
id: string;
text: string;
children: { id: string; text: string }[];
valiafetisov marked this conversation as resolved.
Show resolved Hide resolved
}> | null;
}>();

const emit = defineEmits<{ (e: "click", id: string): void }>();

const onClick = (id: string) => {
emit("click", id);
};
</script>

<template>
<nav>
<ul class="ml-0 pl-4">
<li
v-for="{ id, text, children } in props.tocLinks"
:id="`toc-${id}`"
:key="id"
class="cursor-pointer text-sm list-none ml-0 mb-2 last:mb-0 hover:bg-gray-100"
@click="onClick(id)"
>
{{ text }}
<ul v-if="children" class="ml-3 my-2">
<li
v-for="{ id: childId, text: childText } in children"
:id="`toc-${childId}`"
:key="childId"
class="cursor-pointer text-xs list-none ml-0 pt-2 last:mb-0 hover:underline"
@click.stop="onClick(childId)"
>
{{ childText }}
</li>
</ul>
</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: '/docs',
icon: DocumentText24Regular,
label: 'Documentation'
},
Expand Down
Loading