Skip to content

Commit 3b67f70

Browse files
committed
UPD | docs: search
1 parent 43359d7 commit 3b67f70

File tree

8 files changed

+56
-19
lines changed

8 files changed

+56
-19
lines changed

docs/content/docs/intro/async-context.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ DEBUG main.cpp:16: Hello from Context #4
8686
8787
TimerPool manages timeouts and intervals. Each timer has a priority level:
8888
89-
- **```TIMER_IMPORTANT```**
90-
The Async Context will continue running until no important timers remain.
89+
- **```TIMER_IMPORTANT```** - The Async Context will continue running until no important timers remain.
9190
9291
```cpp
9392
#include <manapihttp/ManapiEventLoop.hpp>
@@ -116,8 +115,7 @@ int main(int argc, char *argv[]) {
116115
117116
This code will print ```5000ms timeout reached``` and then terminate.
118117
119-
- **```TIMER_DEFAULT```**
120-
The Async Context does not wait for these timers to complete.
118+
- **```TIMER_DEFAULT```** - The Async Context does not wait for these timers to complete.
121119
122120
```cpp
123121
#include <manapihttp/ManapiEventLoop.hpp>

docs/content/docs/intro/syslogs.mdx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@ description: Setting Up System Logging
55

66
ManapiHttp provides 5 levels of system logging:
77

8-
- **```LOG_TRACE_NONE```**
9-
No debug output
8+
- **```LOG_TRACE_NONE```** - No debug output
109

11-
- **```LOG_TRACE_HIGH```**
12-
Only critical messages will be printed
10+
- **```LOG_TRACE_HIGH```** - Only critical messages will be printed
1311

14-
- **```LOG_TRACE_MEDIUM```**
15-
Some less important messages will also be printed
12+
- **```LOG_TRACE_MEDIUM```** - Some less important messages will also be printed
1613

17-
- **```LOG_TRACE_LOW```**
18-
Almost all messages will be printed
14+
- **```LOG_TRACE_LOW```** -Almost all messages will be printed
1915

20-
- **```LOG_TRACE_HARD```**
21-
All debug messages will be printed, including messages from TimerLoop, EventLoop, TCP and UDP
16+
- **```LOG_TRACE_HARD```** - All debug messages will be printed, including messages from TimerLoop, EventLoop, TCP and UDP
2217

2318
<Callout title="Note">
2419
In release mode, messages with the ```LOG_TRACE_HARD``` level are removed.

docs/src/app/(home)/favicon.ico

6.53 KB
Binary file not shown.

docs/src/app/(home)/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default function HomePage() {
1717
Build and run microservices written in C++ with different HTTP implementations
1818
</div>
1919
<div className="flex gap-2 justify-center md:justify-start">
20-
<a className="bg-red-300 transition-colors py-2 px-4 rounded-[1.8rem] bg-gradient-to-r from-red-400 to-purple-800 hover:bg-red-200" href="./docs/intro/quick-start">Quick Start</a>
21-
<a className="bg-gray-300 text-black hover:bg-gray-200 dark:bg-gray-800 transition-colors py-2 px-4 rounded-[1.8rem] dark:hover:bg-gray-700 dark:text-white" href="./docs/">Documentation</a>
20+
<a className="text-white font-bold bg-red-300 transition-colors py-2 px-4 rounded-[1.8rem] bg-gradient-to-r from-red-500 to-purple-500 dark:from-red-400 dark:to-purple-800 hover:bg-red-200" href="./docs/intro/quick-start">Quick Start</a>
21+
<a className="bg-gray-300 fond-bold text-black hover:bg-gray-200 dark:bg-gray-800 transition-colors py-2 px-4 rounded-[1.8rem] dark:hover:bg-gray-700 dark:text-white" href="./docs/intro/install">Documentation</a>
2222
</div>
2323
</div>
2424
<div className="order-[-1] md:order-1 max-h-[350px] flex justify-center items-center">

docs/src/app/api/search/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { source } from '@/lib/source';
2+
import { createFromSource } from 'fumadocs-core/search/server';
3+
// statically cached
4+
export const revalidate = false;
5+
export const { staticGET: GET } = createFromSource(source);

docs/src/app/global.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@
33
@import 'fumadocs-ui/css/preset.css';
44

55
@source '../../node_modules/fumadocs-ui/dist/**/*.js';
6+
7+
:root {
8+
--overlay-gradient1: color-mix(in srgb, #3451b2, transparent 55%);
9+
}
10+
11+
.bg-colored {
12+
background-color: linear-gradient(215deg, var(--overlay-gradient1), transparent 40%), radial-gradient(var(--overlay-gradient1), transparent 40%) no-repeat -60vw
13+
-657.333px -40vh / 105vw 200vh, radial-gradient(var(--overlay-gradient1), transparent 65%) no-repeat 50% calc(100% + 20rem) / 60rem 30rem;
14+
}

docs/src/app/layout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import './global.css';
22
import { RootProvider } from 'fumadocs-ui/provider';
33
import { Inter } from 'next/font/google';
44
import type { ReactNode } from 'react';
5+
import { useDocsSearch } from 'fumadocs-core/search/client';
6+
import { create } from '@orama/orama';
7+
import SearchDialog from '@/components/search';
58

69
const inter = Inter({
710
subsets: ['latin'],
@@ -10,10 +13,9 @@ const inter = Inter({
1013
export default function Layout({ children }: { children: ReactNode }) {
1114
return (
1215
<html lang="en" className={inter.className} suppressHydrationWarning>
16+
<link rel="icon" href="/favicon.ico" sizes="any" />
1317
<body className="flex flex-col min-h-screen">
14-
<RootProvider search={{
15-
enabled: false,
16-
}}>{children}</RootProvider>
18+
<RootProvider search={{SearchDialog}}>{children}</RootProvider>
1719
</body>
1820
</html>
1921
);

docs/src/components/search.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use client';
2+
import { useDocsSearch } from 'fumadocs-core/search/client';
3+
import { create } from '@orama/orama';
4+
import { SearchDialog, SharedProps } from 'fumadocs-ui/components/dialog/search';
5+
6+
function initOrama(locale?: string) {
7+
return create({
8+
schema: { _: 'string' },
9+
language: locale === 'ru' ? 'russian' : 'english',
10+
});
11+
}
12+
13+
export default function DefaultSearchDialog(props: SharedProps) {
14+
const client = useDocsSearch({
15+
type: 'static',
16+
initOrama
17+
});
18+
19+
return (<SearchDialog
20+
onSearchChange={client.setSearch}
21+
search={client.search}
22+
isLoading={client.query.isLoading}
23+
results={client.query.data ?? "empty"}
24+
{...props}
25+
>
26+
27+
</SearchDialog>);
28+
}

0 commit comments

Comments
 (0)