mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 09:45:37 -04:00
fix: Move content into to frontend directory
Doing this BEFORE the merge prevents a lot of merge conflicts. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4e18ce38f3
commit
762a0a850e
1051 changed files with 0 additions and 35 deletions
54
frontend/src/pages/api/private/notes/features/index.ts
Normal file
54
frontend/src/pages/api/private/notes/features/index.ts
Normal file
File diff suppressed because one or more lines are too long
213
frontend/src/pages/api/private/notes/features/revisions/0.ts
Normal file
213
frontend/src/pages/api/private/notes/features/revisions/0.ts
Normal file
|
@ -0,0 +1,213 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../../../handler-utils/respond-to-matching-request'
|
||||
import type { RevisionDetails } from '../../../../../../api/revisions/types'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<RevisionDetails>(HttpMethod.GET, req, res, {
|
||||
id: 0,
|
||||
createdAt: '2021-12-21T16:59:42.000Z',
|
||||
patch: `Index:
|
||||
===================================================================
|
||||
---
|
||||
+++
|
||||
@@ -0,0 +1,92 @@
|
||||
+---
|
||||
+title: Features
|
||||
+description: Many features, such wow!
|
||||
+robots: noindex
|
||||
+tags: hedgedoc, demo, react
|
||||
+opengraph:
|
||||
+ title: Features
|
||||
+---
|
||||
+# Embedding demo
|
||||
+[TOC]
|
||||
+
|
||||
+## some plain text
|
||||
+
|
||||
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
+
|
||||
+## MathJax
|
||||
+You can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com](https://math.stackexchange.com/):
|
||||
+
|
||||
+The *Gamma function* satisfying $\\Gamma(n) = (n-1)!\\quad\\forall n\\in\\mathbb N$ is via the Euler integral
|
||||
+
|
||||
+$$
|
||||
+x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.
|
||||
+$$
|
||||
+
|
||||
+$$
|
||||
+\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.
|
||||
+$$
|
||||
+
|
||||
+> More information about **LaTeX** mathematical expressions [here](https://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).
|
||||
+
|
||||
+## Blockquote
|
||||
+> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
+> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
+> [color=red] [name=John Doe] [time=2020-06-21 22:50]
|
||||
+
|
||||
+## Slideshare
|
||||
+{%slideshare mazlan1/internet-of-things-the-tip-of-an-iceberg %}
|
||||
+
|
||||
+## Gist
|
||||
+https://gist.github.com/schacon/1
|
||||
+
|
||||
+## YouTube
|
||||
+https://www.youtube.com/watch?v=KgMpKsp23yY
|
||||
+
|
||||
+## Vimeo
|
||||
+https://vimeo.com/23237102
|
||||
+
|
||||
+## Asciinema
|
||||
+https://asciinema.org/a/117928
|
||||
+
|
||||
+## PDF
|
||||
+{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}
|
||||
+
|
||||
+## Code highlighting
|
||||
+\`\`\`javascript=
|
||||
+
|
||||
+let a = 1
|
||||
+\`\`\`
|
||||
+
|
||||
+## PlantUML
|
||||
+\`\`\`plantuml
|
||||
+@startuml
|
||||
+participant Alice
|
||||
+participant "The **Famous** Bob" as Bob
|
||||
+
|
||||
+Alice -> Bob : hello --there--
|
||||
+... Some ~~long delay~~ ...
|
||||
+Bob -> Alice : ok
|
||||
+note left
|
||||
+ This is **bold**
|
||||
+ This is //italics//
|
||||
+ This is ""monospaced""
|
||||
+ This is --stroked--
|
||||
+ This is __underlined__
|
||||
+ This is ~~waved~~
|
||||
+end note
|
||||
+
|
||||
+Alice -> Bob : A //well formatted// message
|
||||
+note right of Alice
|
||||
+ This is <back:cadetblue><size:18>displayed</size></back>
|
||||
+ __left of__ Alice.
|
||||
+end note
|
||||
+note left of Bob
|
||||
+ <u:red>This</u> is <color #118888>displayed</color>
|
||||
+ **<color purple>left of</color> <s:red>Alice</strike> Bob**.
|
||||
+end note
|
||||
+note over Alice, Bob
|
||||
+ <w:#FF33FF>This is hosted</w> by <img sourceforge.jpg>
|
||||
+end note
|
||||
+@enduml
|
||||
+\`\`\`
|
||||
+
|
||||
`,
|
||||
edits: [],
|
||||
length: 2782,
|
||||
authorUsernames: [],
|
||||
anonymousAuthorCount: 2,
|
||||
content: `---
|
||||
title: Features
|
||||
description: Many features, such wow!
|
||||
robots: noindex
|
||||
tags: hedgedoc, demo, react
|
||||
opengraph:
|
||||
title: Features
|
||||
---
|
||||
# Embedding demo
|
||||
[TOC]
|
||||
|
||||
## some plain text
|
||||
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
|
||||
## MathJax
|
||||
You can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com](https://math.stackexchange.com/):
|
||||
|
||||
The *Gamma function* satisfying $\\Gamma(n) = (n-1)!\\quad\\forall n\\in\\mathbb N$ is via the Euler integral
|
||||
|
||||
$$
|
||||
x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.
|
||||
$$
|
||||
|
||||
$$
|
||||
\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.
|
||||
$$
|
||||
|
||||
> More information about **LaTeX** mathematical expressions [here](https://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).
|
||||
|
||||
## Blockquote
|
||||
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
> [color=red] [name=John Doe] [time=2020-06-21 22:50]
|
||||
|
||||
## Slideshare
|
||||
{%slideshare mazlan1/internet-of-things-the-tip-of-an-iceberg %}
|
||||
|
||||
## Gist
|
||||
https://gist.github.com/schacon/1
|
||||
|
||||
## YouTube
|
||||
https://www.youtube.com/watch?v=KgMpKsp23yY
|
||||
|
||||
## Vimeo
|
||||
https://vimeo.com/23237102
|
||||
|
||||
## Asciinema
|
||||
https://asciinema.org/a/117928
|
||||
|
||||
## PDF
|
||||
{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}
|
||||
|
||||
## Code highlighting
|
||||
\`\`\`javascript=
|
||||
|
||||
let a = 1
|
||||
\`\`\`
|
||||
|
||||
## PlantUML
|
||||
\`\`\`plantuml
|
||||
@startuml
|
||||
participant Alice
|
||||
participant "The **Famous** Bob" as Bob
|
||||
|
||||
Alice -> Bob : hello --there--
|
||||
... Some ~~long delay~~ ...
|
||||
Bob -> Alice : ok
|
||||
note left
|
||||
This is **bold**
|
||||
This is //italics//
|
||||
This is ""monospaced""
|
||||
This is --stroked--
|
||||
This is __underlined__
|
||||
This is ~~waved~~
|
||||
end note
|
||||
|
||||
Alice -> Bob : A //well formatted// message
|
||||
note right of Alice
|
||||
This is <back:cadetblue><size:18>displayed</size></back>
|
||||
__left of__ Alice.
|
||||
end note
|
||||
note left of Bob
|
||||
<u:red>This</u> is <color #118888>displayed</color>
|
||||
**<color purple>left of</color> <s:red>Alice</strike> Bob**.
|
||||
end note
|
||||
note over Alice, Bob
|
||||
<w:#FF33FF>This is hosted</w> by <img sourceforge.jpg>
|
||||
end note
|
||||
@enduml
|
||||
\`\`\`
|
||||
|
||||
`
|
||||
})
|
||||
}
|
||||
|
||||
export default handler
|
160
frontend/src/pages/api/private/notes/features/revisions/1.ts
Normal file
160
frontend/src/pages/api/private/notes/features/revisions/1.ts
Normal file
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../../../handler-utils/respond-to-matching-request'
|
||||
import type { RevisionDetails } from '../../../../../../api/revisions/types'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<RevisionDetails>(HttpMethod.GET, req, res, {
|
||||
id: 1,
|
||||
createdAt: '2021-12-29T17:54:11.000Z',
|
||||
patch: `Index:
|
||||
===================================================================
|
||||
---
|
||||
+++
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Features
|
||||
-description: Many features, such wow!
|
||||
+description: Many more features, such wow!
|
||||
robots: noindex
|
||||
tags: hedgedoc, demo, react
|
||||
opengraph:
|
||||
title: Features
|
||||
@@ -10,9 +10,9 @@
|
||||
[TOC]
|
||||
|
||||
## some plain text
|
||||
|
||||
-Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magnus aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetezur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam _et_ justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
|
||||
## MathJax
|
||||
You can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com](https://math.stackexchange.com/):
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
## Gist
|
||||
https://gist.github.com/schacon/1
|
||||
|
||||
## YouTube
|
||||
-https://www.youtube.com/watch?v=KgMpKsp23yY
|
||||
+https://www.youtube.com/watch?v=zHAIuE5BQWk
|
||||
|
||||
## Vimeo
|
||||
https://vimeo.com/23237102
|
||||
|
||||
@@ -62,9 +62,9 @@
|
||||
@startuml
|
||||
participant Alice
|
||||
participant "The **Famous** Bob" as Bob
|
||||
|
||||
-Alice -> Bob : hello --there--
|
||||
+Alice -> Bob : bye --there--
|
||||
... Some ~~long delay~~ ...
|
||||
Bob -> Alice : ok
|
||||
note left
|
||||
This is **bold**`,
|
||||
edits: [],
|
||||
length: 2788,
|
||||
authorUsernames: [],
|
||||
anonymousAuthorCount: 4,
|
||||
content: `---
|
||||
title: Features
|
||||
description: Many more features, such wow!
|
||||
robots: noindex
|
||||
tags: hedgedoc, demo, react
|
||||
opengraph:
|
||||
title: Features
|
||||
---
|
||||
# Embedding demo
|
||||
[TOC]
|
||||
|
||||
## some plain text
|
||||
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magnus aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetezur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam _et_ justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
||||
|
||||
## MathJax
|
||||
You can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com](https://math.stackexchange.com/):
|
||||
|
||||
The *Gamma function* satisfying $\\Gamma(n) = (n-1)!\\quad\\forall n\\in\\mathbb N$ is via the Euler integral
|
||||
|
||||
$$
|
||||
x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.
|
||||
$$
|
||||
|
||||
$$
|
||||
\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.
|
||||
$$
|
||||
|
||||
> More information about **LaTeX** mathematical expressions [here](https://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).
|
||||
|
||||
## Blockquote
|
||||
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
||||
> [color=red] [name=John Doe] [time=2020-06-21 22:50]
|
||||
|
||||
## Slideshare
|
||||
{%slideshare mazlan1/internet-of-things-the-tip-of-an-iceberg %}
|
||||
|
||||
## Gist
|
||||
https://gist.github.com/schacon/1
|
||||
|
||||
## YouTube
|
||||
https://www.youtube.com/watch?v=zHAIuE5BQWk
|
||||
|
||||
## Vimeo
|
||||
https://vimeo.com/23237102
|
||||
|
||||
## Asciinema
|
||||
https://asciinema.org/a/117928
|
||||
|
||||
## PDF
|
||||
{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}
|
||||
|
||||
## Code highlighting
|
||||
\`\`\`javascript=
|
||||
|
||||
let a = 1
|
||||
\`\`\`
|
||||
|
||||
## PlantUML
|
||||
\`\`\`plantuml
|
||||
@startuml
|
||||
participant Alice
|
||||
participant "The **Famous** Bob" as Bob
|
||||
|
||||
Alice -> Bob : bye --there--
|
||||
... Some ~~long delay~~ ...
|
||||
Bob -> Alice : ok
|
||||
note left
|
||||
This is **bold**
|
||||
This is //italics//
|
||||
This is ""monospaced""
|
||||
This is --stroked--
|
||||
This is __underlined__
|
||||
This is ~~waved~~
|
||||
end note
|
||||
|
||||
Alice -> Bob : A //well formatted// message
|
||||
note right of Alice
|
||||
This is <back:cadetblue><size:18>displayed</size></back>
|
||||
__left of__ Alice.
|
||||
end note
|
||||
note left of Bob
|
||||
<u:red>This</u> is <color #118888>displayed</color>
|
||||
**<color purple>left of</color> <s:red>Alice</strike> Bob**.
|
||||
end note
|
||||
note over Alice, Bob
|
||||
<w:#FF33FF>This is hosted</w> by <img sourceforge.jpg>
|
||||
end note
|
||||
@enduml
|
||||
\`\`\`
|
||||
|
||||
`
|
||||
})
|
||||
}
|
||||
|
||||
export default handler
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../../../handler-utils/respond-to-matching-request'
|
||||
import type { RevisionMetadata } from '../../../../../../api/revisions/types'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<RevisionMetadata[]>(HttpMethod.GET, req, res, [
|
||||
{
|
||||
id: 1,
|
||||
createdAt: '2021-12-29T17:54:11.000Z',
|
||||
length: 2788,
|
||||
authorUsernames: [],
|
||||
anonymousAuthorCount: 4
|
||||
},
|
||||
{
|
||||
id: 0,
|
||||
createdAt: '2021-12-21T16:59:42.000Z',
|
||||
length: 2782,
|
||||
authorUsernames: [],
|
||||
anonymousAuthorCount: 2
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
export default handler
|
59
frontend/src/pages/api/private/notes/index.ts
Normal file
59
frontend/src/pages/api/private/notes/index.ts
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { HttpMethod, respondToMatchingRequest } from '../../../../handler-utils/respond-to-matching-request'
|
||||
import type { Note } from '../../../../api/notes/types'
|
||||
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse): void => {
|
||||
respondToMatchingRequest<Note>(
|
||||
HttpMethod.POST,
|
||||
req,
|
||||
res,
|
||||
{
|
||||
content: 'new note content',
|
||||
metadata: {
|
||||
id: 'featuresId',
|
||||
version: 2,
|
||||
viewCount: 0,
|
||||
updatedAt: '2021-04-24T09:27:51.000Z',
|
||||
createdAt: '2021-04-24T09:27:51.000Z',
|
||||
updateUsername: null,
|
||||
primaryAddress: 'features',
|
||||
editedBy: [],
|
||||
title: 'New note',
|
||||
tags: ['hedgedoc', 'demo', 'react'],
|
||||
description: 'Many features, such wow!',
|
||||
aliases: [
|
||||
{
|
||||
name: 'features',
|
||||
primaryAlias: true,
|
||||
noteId: 'featuresId'
|
||||
}
|
||||
],
|
||||
permissions: {
|
||||
owner: 'tilman',
|
||||
sharedToUsers: [
|
||||
{
|
||||
username: 'molly',
|
||||
canEdit: true
|
||||
}
|
||||
],
|
||||
sharedToGroups: [
|
||||
{
|
||||
groupName: '_LOGGED_IN',
|
||||
canEdit: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
editedByAtPosition: []
|
||||
},
|
||||
201
|
||||
)
|
||||
}
|
||||
|
||||
export default handler
|
66
frontend/src/pages/api/private/notes/slide-example/index.ts
Normal file
66
frontend/src/pages/api/private/notes/slide-example/index.ts
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue