Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 0544364

Browse files
authored
Merge pull request #200 from janhq/fix/docs-responsive
bug: should be responsive and stacking up on mobile
2 parents 96de0b1 + 2ca9040 commit 0544364

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

docs/docs/features/chat.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Chat Completion feature in Nitro provides a flexible way to interact with an
88

99
To send a single query to your chosen LLM, follow these steps:
1010

11-
<div style={{ width: '50%', float: 'left', clear: 'left' }}>
11+
<div class="code-snippet-left">
1212

1313
```bash title="Nitro"
1414
curl http://localhost:3928/v1/chat/completions \
@@ -27,7 +27,7 @@ curl http://localhost:3928/v1/chat/completions \
2727

2828
</div>
2929

30-
<div style={{ width: '50%', float: 'right', clear: 'right' }}>
30+
<div class="code-snippet-right">
3131

3232
```bash title="OpenAI"
3333
curl https://api.openai.com/v1/chat/completions \
@@ -52,7 +52,7 @@ This command sends a request to your local LLM, querying about the winner of the
5252

5353
For ongoing conversations or multiple queries, the dialog request feature is ideal. Here’s how to structure a multi-turn conversation:
5454

55-
<div style={{ width: '50%', float: 'left', clear: 'left' }}>
55+
<div class="code-snippet-left">
5656

5757
```bash title="Nitro"
5858
curl http://localhost:3928/v1/chat/completions \
@@ -82,7 +82,7 @@ curl http://localhost:3928/v1/chat/completions \
8282

8383
</div>
8484

85-
<div style={{ width: '50%', float: 'right', clear: 'right' }}>
85+
<div class="code-snippet-right">
8686

8787
```bash title="OpenAI"
8888
curl https://api.openai.com/v1/chat/completions \
@@ -116,7 +116,7 @@ curl https://api.openai.com/v1/chat/completions \
116116

117117
Below are examples of responses from both the Nitro server and OpenAI:
118118

119-
<div style={{ width: '50%', float: 'left', clear: 'left' }}>
119+
<div class="code-snippet-left">
120120

121121
```js title="Nitro"
122122
{
@@ -145,7 +145,7 @@ Below are examples of responses from both the Nitro server and OpenAI:
145145

146146
</div>
147147

148-
<div style={{ width: '50%', float: 'right', clear: 'right' }}>
148+
<div class="code-snippet-right">
149149

150150
```js title="OpenAI"
151151
{

docs/docs/features/embed.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To utilize the embedding feature, include the JSON parameter `"embedding": true`
1414

1515
Here’s an example showing how to get the embedding result from the model:
1616

17-
<div style={{ width: '50%', float: 'left', clear: 'left' }}>
17+
<div class="code-snippet-left">
1818

1919
```bash title="Nitro" {1}
2020
curl http://localhost:3928/v1/embeddings \
@@ -28,7 +28,7 @@ curl http://localhost:3928/v1/embeddings \
2828
```
2929

3030
</div>
31-
<div style={{ width: '50%', float: 'right', clear: 'right' }}>
31+
<div class="code-snippet-right">
3232

3333
```bash title="OpenAI request" {1}
3434
curl https://api.openai.com/v1/embeddings \
@@ -47,7 +47,7 @@ curl https://api.openai.com/v1/embeddings \
4747

4848
The example response used the output from model [llama2 Chat 7B Q5 (GGUF)](https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/tree/main) loaded to Nitro server.
4949

50-
<div style={{ width: '50%', float: 'left', clear: 'left' }}>
50+
<div class="code-snippet-left">
5151

5252
```js title="Nitro"
5353
{
@@ -68,7 +68,7 @@ The example response used the output from model [llama2 Chat 7B Q5 (GGUF)](https
6868

6969
</div>
7070

71-
<div style={{ width: '50%', float: 'right', clear: 'right' }}>
71+
<div class="code-snippet-right">
7272

7373
```js title="OpenAI"
7474
{

docs/docs/new/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ One of the significant advantages of using Nitro is its compatibility with OpenA
2121

2222
For instance, compare the Nitro inference call:
2323

24-
<div style={{ width: '50%', float: 'left', clear: 'left' }}>
24+
<div class="code-snippet-left">
2525

2626
```bash title="Nitro chat completion"
2727
curl http://localhost:3928/v1/chat/completions \
@@ -44,7 +44,7 @@ curl http://localhost:3928/v1/chat/completions \
4444

4545
</div>
4646

47-
<div style={{ width: '50%', float: 'right', clear: 'right' }}>
47+
<div class="code-snippet-right">
4848

4949
```bash title="OpenAI API chat completion"
5050
curl https://api.openai.com/v1/chat/completions \

docs/src/styles/components/base.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,11 @@
7777
}
7878
}
7979
}
80+
81+
.code-snippet-left {
82+
@apply w-full lg:w-1/2 float-left;
83+
}
84+
85+
.code-snippet-right {
86+
@apply w-full lg:w-1/2 float-right;
87+
}

docs/src/styles/tweaks/sidebar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
[class*="docItemCol_"] {
19-
@apply px-8;
19+
@apply lg:px-8;
2020
}
2121

2222
// * Including custom sidebar table of content

0 commit comments

Comments
 (0)