Skip to content

Commit d2aaa26

Browse files
committed
docs: update dependencies and enhance code block rendering
- Remove unused tokio dependency from docs example - Add CSS styles to hide external link icons in footer and style copyright - Adjust code preview dimensions for better layout - Replace static code blocks with Highlight component for syntax highlighting - Implement proper code tokenization and line rendering
1 parent 8a566ed commit d2aaa26

4 files changed

Lines changed: 35 additions & 7 deletions

File tree

docs/docs/intro.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ asyncio.run(main())
4747
```toml
4848
[dependencies]
4949
vectorless = "0.1"
50-
tokio = { version = "1", features = ["full"] }
5150
```
5251

5352
```rust

docs/src/css/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,19 @@
5151
.footer {
5252
background-color: transparent !important;
5353
}
54+
55+
/* Hide external-link icons in footer */
56+
.footer__link-item svg {
57+
display: none;
58+
}
59+
60+
/* Copyright styling */
61+
.footer__copyright {
62+
text-align: center;
63+
font-size: 0.82rem;
64+
color: var(--text-light);
65+
letter-spacing: 0.03em;
66+
margin-top: 1rem;
67+
padding-top: 1.5rem;
68+
border-top: 1px solid var(--border);
69+
}

docs/src/pages/index.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151

5252
/* -- Right column: code preview -- */
5353
.codePreview {
54-
flex: 0 0 440px;
55-
max-width: 440px;
54+
flex: 1 1 520px;
55+
max-width: 560px;
5656
border-radius: 12px;
5757
overflow: hidden;
5858
border: 1px solid var(--border);

docs/src/pages/index.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Layout from '@theme/Layout';
44
import Heading from '@theme/Heading';
55
import Link from '@docusaurus/Link';
66
import useBaseUrl from '@docusaurus/useBaseUrl';
7+
import {Highlight, themes} from 'prism-react-renderer';
78

89
import styles from './index.module.css';
910

@@ -43,8 +44,7 @@ function HomepageHeader() {
4344
</span>
4445
<span className={styles.codeLang}>Python</span>
4546
</div>
46-
<pre className={styles.codeBlock}>
47-
<code>{`import asyncio
47+
<Highlight theme={themes.dracula} code={`import asyncio
4848
from vectorless import Engine, IndexContext
4949
5050
async def main():
@@ -66,8 +66,21 @@ async def main():
6666
)
6767
print(result.single().content)
6868
69-
asyncio.run(main())`}</code>
70-
</pre>
69+
asyncio.run(main())`} language="python">
70+
{({tokens, getLineProps, getTokenProps}) => (
71+
<pre className={styles.codeBlock}>
72+
<code>
73+
{tokens.map((line, i) => (
74+
<div key={i} {...getLineProps({line})}>
75+
{line.map((token, key) => (
76+
<span key={key} {...getTokenProps({token})} />
77+
))}
78+
</div>
79+
))}
80+
</code>
81+
</pre>
82+
)}
83+
</Highlight>
7184
</div>
7285
</div>
7386
</header>

0 commit comments

Comments
 (0)