Skip to content

Commit

Permalink
added search for docs (#119)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand. Add
screenshots when necessary -->

### Linked issues
<!-- DOC: Link issue with a keyword: close, closes, closed, fix, fixes,
fixed, resolve, resolves, resolved. See
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

Resolves #..

### Tests
<!-- How is this tested? Please see the checklist below and also
describe any other relevant tests -->

- [x] manually tested
- [ ] added unit tests
- [ ] added integration tests


<img width="1704" alt="image"
src="https://github.com/user-attachments/assets/2c8fc5ee-65cd-448c-afd5-df4cdd62901c"
/>

---------

Co-authored-by: renardeinside <polarpersonal@gmail.com>
  • Loading branch information
sundarshankar89 and renardeinside authored Jan 22, 2025
1 parent a48ce18 commit 8f613b6
Show file tree
Hide file tree
Showing 6 changed files with 452 additions and 58 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ coverage:
docs-build:
yarn --cwd docs/dqx build

docs-serve:
docs-serve-dev:
yarn --cwd docs/dqx start

docs-install:
yarn --cwd docs/dqx install
yarn --cwd docs/dqx install

docs-serve: docs-build
yarn --cwd docs/dqx serve
12 changes: 12 additions & 0 deletions docs/dqx/docs/dev/docs_authoring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ make docs-install

To run the documentation locally, use the following command:

```bash
make docs-serve-dev
```

## Checking search functionality

<Admonition type="tip" title="Tip" emoji="💡">
We're using local search, and it won't be available in the development server.
</Admonition>

To check the search functionality, run the following command:

```bash
make docs-serve
```
Expand Down
13 changes: 10 additions & 3 deletions docs/dqx/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
Expand Down Expand Up @@ -32,7 +32,7 @@ const config: Config = {
defaultLocale: 'en',
locales: ['en'],
},

plugins: [
async (context, options) => {
return {
Expand All @@ -47,6 +47,7 @@ const config: Config = {
}
},
'docusaurus-plugin-image-zoom',
'docusaurus-lunr-search'
],

presets: [
Expand Down Expand Up @@ -82,12 +83,18 @@ const config: Config = {
src: 'img/logo.svg',
},
items: [
{
type: 'search',
position: 'right',
},
{
href: 'https://github.com/databrickslabs/dqx',
position: 'right',

className: 'header-github-link',
'aria-label': 'GitHub repository',
},

],
},
footer: {
Expand Down
1 change: 1 addition & 0 deletions docs/dqx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@radix-ui/react-slot": "^1.1.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"docusaurus-lunr-search": "3.6.1",
"docusaurus-plugin-image-zoom": "^2.0.0",
"lucide-react": "^0.471.1",
"prism-react-renderer": "^2.3.0",
Expand Down
4 changes: 4 additions & 0 deletions docs/dqx/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ button {
@apply font-sans;
}

#search_input_react {
@apply font-sans;
}


.header-github-link::before {
content: '';
Expand Down
Loading

0 comments on commit 8f613b6

Please sign in to comment.