Skip to content

Commit

Permalink
feat: add markdown supported documentation pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal authored and ArneD committed Oct 20, 2022
1 parent b9c668c commit 3dcc8cb
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 1 deletion.
25 changes: 25 additions & 0 deletions site/src/modules/documentation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Root from "./views/Root.vue";
import Documentation from "./views/Documentation.vue";
import EditEndPointsGrar from "./views/EditEndPointsGrar.vue";

export const DocumentationRoutes = [
{
path: "/documentatie",
component: Root,
meta: {},
children: [
{
path: "",
component: Documentation,
name: "documentation"
},
{
path: "editendpointsgrar",
component: EditEndPointsGrar,
name: "editendpointsgrar"
},
],
},
];

export default DocumentationRoutes;
64 changes: 64 additions & 0 deletions site/src/modules/documentation/views/Documentation.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<vl-page>
<vl-main>
<vl-region>
<vl-layout>
<vl-grid mod-stacked>
<vl-column width="9" width-s="12">
<vl-link :to="$l('backButtons.home.url')" mod-bold v-l="`backButtons.home.text`" />
<header>
<y-markdown v-if="$data.markdownLoaded" :src="$data.header" />
</header>
</vl-column>

<vl-column>
<vl-grid mod-stacked>
<vl-column :width="`${$data.sidebar.urls > 0 ? 8 : 12}`" width-s="12">
<vl-grid mod-stacked>
<vl-column>
<vl-typography>
<y-markdown v-if="$data.markdownLoaded" :src="$data.content" />
</vl-typography>
</vl-column>
<vl-column v-for="item in $data.doormatItems" :key="item.url" width="6" width-s="12">
<vl-doormat :title="item.title" :href="item.url" mod-alt />
</vl-column>
</vl-grid>
</vl-column>
<vl-column v-if="$data.sidebar.urls > 0" width="3" push="1" push-m="reset" width-s="12">
<aside v-vl-sticky="{ top: '120px', left: '0' }">
<vl-side-navigation :title="$l(`${$options.localeName}.sidebar.title`)">
<vl-side-navigation-list>
<template v-for="item in $data.sidebar.urls">
<vl-side-navigation-item :key="item.url" :href="item.url" :text="item.title" />
</template>
</vl-side-navigation-list>
</vl-side-navigation>
</aside>
</vl-column>
</vl-grid>
</vl-column>
</vl-grid>
</vl-layout>
</vl-region>
</vl-main>
</vl-page>
</template>


<script lang="ts">
import Vue from "vue";
export default Vue.extend({
localeName: "documentation",
hasMarkdown: true
});
</script>

<style lang="scss">
div.functional-documentation {
h2, h3, h4, h5, h6, a, p {
scroll-margin: 80px;
}
}
</style>
64 changes: 64 additions & 0 deletions site/src/modules/documentation/views/EditEndPointsGrar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<vl-page class="edit-endpoints-grar">
<vl-main>
<vl-region>
<vl-layout>
<vl-grid mod-stacked>
<vl-column width="9" width-s="12">
<vl-link :to="$l('backButtons.documentation.url')" mod-bold v-l="`backButtons.documentation.text`" />
<header>
<y-markdown v-if="$data.markdownLoaded" :src="$data.header" />
</header>
</vl-column>

<vl-column>
<vl-grid mod-stacked>
<vl-column :width="`${$data.sidebar.urls > 0 ? 8 : 12}`" width-s="12">
<vl-grid mod-stacked>
<vl-column>
<vl-typography>
<y-markdown v-if="$data.markdownLoaded" :src="$data.content" />
</vl-typography>
</vl-column>
<vl-column v-for="item in $data.doormatItems" :key="item.url" width="6" width-s="12">
<vl-doormat :title="item.title" :href="item.url" mod-alt />
</vl-column>
</vl-grid>
</vl-column>
<vl-column v-if="$data.sidebar.urls > 0" width="3" push="1" push-m="reset" width-s="12">
<aside v-vl-sticky="{ top: '120px', left: '0' }">
<vl-side-navigation :title="$l(`${$options.localeName}.sidebar.title`)">
<vl-side-navigation-list>
<template v-for="item in $data.sidebar.urls">
<vl-side-navigation-item :key="item.url" :href="item.url" :text="item.title" />
</template>
</vl-side-navigation-list>
</vl-side-navigation>
</aside>
</vl-column>
</vl-grid>
</vl-column>
</vl-grid>
</vl-layout>
</vl-region>
</vl-main>
</vl-page>
</template>


<script lang="ts">
import Vue from "vue";
export default Vue.extend({
localeName: "editendpointsgrar",
hasMarkdown: true,
});
</script>

<style lang="scss">
div.edit-endpoints-grar {
h2, h3, h4, h5, h6, a, p {
scroll-margin: 80px;
}
}
</style>
8 changes: 8 additions & 0 deletions site/src/modules/documentation/views/Root.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<div>
<router-view
@pageLoaded="(args) => $emit('pageLoaded', args)"
@updateStatus="(args) => $emit('updateStatus', args)"
/>
</div>
</template>
4 changes: 3 additions & 1 deletion site/src/router.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vue from "vue";
import Router, { RawLocation, Route, RouteConfig } from "vue-router";
import { HomeRoutes } from "./modules/home/";
import { DocumentationRoutes } from "./modules/documentation/";
import { ImplementationModelRoutes } from "./modules/implementation-model/";
import { InformationRoutes } from "./modules/information/";
import { GeneralRoutes } from "./modules/general/";
Expand All @@ -18,6 +19,7 @@ Vue.use(Router);

const routes: RouteConfig[] = [
...HomeRoutes,
...DocumentationRoutes,
...ImplementationModelRoutes,
...InformationRoutes,
...GeneralRoutes,
Expand Down Expand Up @@ -47,4 +49,4 @@ export const router = new Router({
routes,
});

export default router;
export default router;

0 comments on commit 3dcc8cb

Please sign in to comment.