Skip to content

Commit

Permalink
Merge pull request #662 from alan-turing-institute/648-new-documentat…
Browse files Browse the repository at this point in the history
…ion-docusaurus

648 new documentation docusaurus
  • Loading branch information
RichGriff authored Dec 9, 2024
2 parents 93e38a0 + 7301a76 commit 7a2268b
Show file tree
Hide file tree
Showing 93 changed files with 24,883 additions and 3 deletions.
7 changes: 7 additions & 0 deletions next_frontend/.env.local
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
NEXT_PUBLIC_STORAGESASTOKEN=TBA
NEXT_PUBLIC_STORAGESOURCENAME=TBA

GITHUB_APP_CLIENT_ID=5ced01de4e93b6f1451a
GITHUB_APP_CLIENT_SECRET=20032b08819df04cc9f2766807450ad9a5ccbf45
NEXTAUTH_SECRET=LFlWi1xmyhAaZzZ83q1nczQwqnyUVgc7vTXTjEy9kAA=
NEXT_PUBLIC_API_URL=https://eap-backend.azurewebsites.net/
API_URL=https://eap-backend.azurewebsites.net/
NEXTAUTH_URL=http://localhost:3000
4 changes: 4 additions & 0 deletions next_frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# documentation

/public/documentation
3 changes: 3 additions & 0 deletions next_frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ COPY --link . .
COPY --link .env.local .env.production
# COPY --link .env.production .env.production

# Build documentation
RUN cd tea-docs && npm ci && npm run build

RUN yarn build

# 3. Production image, copy all the files and run next
Expand Down
Binary file modified next_frontend/app/favicon.ico
Binary file not shown.
7 changes: 5 additions & 2 deletions next_frontend/components/demo/landing/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { useSession } from 'next-auth/react'
// import { useLoginToken } from '@/hooks/useAuth'

const navigation = [
{ name: 'Documentation', href: 'https://alan-turing-institute.github.io/AssurancePlatform/' },
// { name: 'Showcase', href: 'documentation' },
{ name: 'Documentation', href: 'documentation' },
// { name: 'Documentation', href: 'https://alan-turing-institute.github.io/AssurancePlatform/' },
{ name: 'GitHub', href: 'https://github.com/alan-turing-institute/AssurancePlatform' },
]

Expand Down Expand Up @@ -51,7 +53,7 @@ export default function Hero() {
</div>
<div className="hidden lg:flex lg:gap-x-12">
{navigation.map((item) => (
<a key={item.name} href={item.href} className="text-sm font-semibold leading-6 text-gray-900">
<a key={item.name} href={item.href} target='_blank' className="text-sm font-semibold leading-6 text-gray-900">
{item.name}
</a>
))}
Expand Down Expand Up @@ -96,6 +98,7 @@ export default function Hero() {
<a
key={item.name}
href={item.href}
target='_blank'
className="-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50"
>
{item.name}
Expand Down
2 changes: 1 addition & 1 deletion next_frontend/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const navigation = [
{ name: 'My Assurance Cases', href: '/dashboard', icon: FolderIcon, current: false , externalLink: false},
{ name: 'Shared With Me', href: '/dashboard/shared', icon: UsersIcon, current: false , externalLink: false},
// { name: 'Users', href: '/users', icon: UserGroupIcon, current: false, externalLink: false },
{ name: 'Documentation', href: 'https://alan-turing-institute.github.io/AssurancePlatform/', icon: DocumentDuplicateIcon, current: false, externalLink: true },
{ name: 'Documentation', href: '/documentation', icon: DocumentDuplicateIcon, current: false, externalLink: true },
]

export const teams = [
Expand Down
3 changes: 3 additions & 0 deletions next_frontend/docker/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
ENV API_URL=${API_URL}
ENV NEXTAUTH_URL=${NEXTAUTH_URL}

# Build documentation
RUN cd tea-docs && npm ci && npm run build

RUN yarn build

RUN echo "Build-time ENV variables:" && \
Expand Down
3 changes: 3 additions & 0 deletions next_frontend/docker/staging/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
ENV API_URL=${API_URL}
ENV NEXTAUTH_URL=${NEXTAUTH_URL}

# Build documentation
RUN cd tea-docs && npm ci && npm run build

RUN yarn build

RUN echo "Build-time ENV variables:" && \
Expand Down
8 changes: 8 additions & 0 deletions next_frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ const nextConfig = {
},
],
},
async rewrites() {
return [
{
source: "/documentation",
destination: "/documentation/index.html",
},
];
},
};

export default nextConfig;
20 changes: 20 additions & 0 deletions next_frontend/tea-docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions next_frontend/tea-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
12 changes: 12 additions & 0 deletions next_frontend/tea-docs/blog/2019-05-28-first-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
slug: first-blog-post
title: First Blog Post
authors: [slorber, yangshun]
tags: [hola, docusaurus]
---

Lorem ipsum dolor sit amet...

<!-- truncate -->

...consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
44 changes: 44 additions & 0 deletions next_frontend/tea-docs/blog/2019-05-29-long-blog-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
slug: long-blog-post
title: Long Blog Post
authors: yangshun
tags: [hello, docusaurus]
---

This is the summary of a very long blog post,

Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.

<!-- truncate -->

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
24 changes: 24 additions & 0 deletions next_frontend/tea-docs/blog/2021-08-01-mdx-blog-post.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
slug: mdx-blog-post
title: MDX Blog Post
authors: [slorber]
tags: [docusaurus]
---

Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).

:::tip

Use the power of React to create interactive blog posts.

:::

{/* truncate */}

For example, use JSX to create an interactive button:

```js
<button onClick={() => alert('button clicked!')}>Click me!</button>
```

<button onClick={() => alert('button clicked!')}>Click me!</button>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions next_frontend/tea-docs/blog/2021-08-26-welcome/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
slug: welcome
title: Welcome
authors: [slorber, yangshun]
tags: [facebook, hello, docusaurus]
---

[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).

Here are a few tips you might find useful.

<!-- truncate -->

Simply add Markdown files (or folders) to the `blog` directory.

Regular blog authors can be added to `authors.yml`.

The blog post date can be extracted from filenames, such as:

- `2019-05-30-welcome.md`
- `2019-05-30-welcome/index.md`

A blog post folder can be convenient to co-locate blog post images:

![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)

The blog supports tags as well!

**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
23 changes: 23 additions & 0 deletions next_frontend/tea-docs/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
yangshun:
name: Yangshun Tay
title: Front End Engineer @ Facebook
url: https://github.com/yangshun
image_url: https://github.com/yangshun.png
page: true
socials:
x: yangshunz
github: yangshun

slorber:
name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
page:
# customize the url of the author page at /blog/authors/<permalink>
permalink: "/all-sebastien-lorber-articles"
socials:
x: sebastienlorber
linkedin: sebastienlorber
github: slorber
newsletter: https://thisweekinreact.com
19 changes: 19 additions & 0 deletions next_frontend/tea-docs/blog/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
facebook:
label: Facebook
permalink: /facebook
description: Facebook tag description

hello:
label: Hello
permalink: /hello
description: Hello tag description

docusaurus:
label: Docusaurus
permalink: /docusaurus
description: Docusaurus tag description

hola:
label: Hola
permalink: /hola
description: Hola tag description
14 changes: 14 additions & 0 deletions next_frontend/tea-docs/components/custom-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { MoveRightIcon } from "lucide-react";

export const CustomButton = ({ children, url }) => {
return (
<a
href={url}
target="_blank"
className="inline-flex my-3 bg-indigo-600 text-white py-2 px-4 rounded-md hover:text-white hover:bg-indigo-700 hover:cursor-pointer hover:no-underline justify-center items-center gap-2"
>
{children}
<MoveRightIcon className="size-4" />
</a>
);
};
9 changes: 9 additions & 0 deletions next_frontend/tea-docs/docs/api/endpoints/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "Endpoints",
"position": 2,
"collapsed": false,
"link": {
"type": "generated-index",
"description": "Available endpoints in the TEA api"
}
}
Loading

0 comments on commit 7a2268b

Please sign in to comment.