![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@markprompt/docusaurus-theme-search
Advanced tools
A Markprompt plugin for Docusaurus.
npm install @markprompt/docusaurus-theme-search
In your docusaurus.config.js
, add @markprompt/docusaurus-theme-search
to
themes
. Configure markprompt
in the themeConfig
.
const config = {
// …
themes: [
// …
'@markprompt/docusaurus-theme-search',
],
themeConfig:
/** @type {import('@markprompt/docusaurus-theme-search').ThemeConfig} */ ({
markprompt: {
projectKey: 'YOUR-PROJECT-KEY',
trigger: { floating: true },
},
}),
};
Now a search button will appear on your Docusaurus page.
If your Docusaurus project already has a search plugin, such as theme-search-algolia, you need to swizzle the current search plugin, and add Markprompt as a standalone component.
To swizzle your current search plugin, run:
npx docusaurus swizzle
Choose Wrap
, and confirm. This will create a SearchBar
wrapper component in
/src/theme/SearchBar
. Next, install the standalone Markprompt component and
CSS:
npm install @markprompt/react @markprompt/css
Edit /src/theme/SearchBar/index.tsx
to include Markprompt next to your
existing search bar. Here is an example:
import type { WrapperProps } from '@docusaurus/types';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import { type MarkpromptConfig } from '@markprompt/docusaurus-theme-search';
import type SearchBarType from '@theme/SearchBar';
import SearchBar from '@theme-original/SearchBar';
import { lazy, Suspense } from 'react';
// import Markprompt lazily as Docusaurus does not currently support ESM
const Markprompt = lazy(() =>
import('@markprompt/react').then((mod) => ({ default: mod.Markprompt })),
);
import '@markprompt/css';
type Props = WrapperProps<typeof SearchBarType>;
export default function SearchBarWrapper(props: Props): JSX.Element {
const { siteConfig } = useDocusaurusContext();
const { projectKey, ...config } = siteConfig.themeConfig
.markprompt as MarkpromptConfig;
return (
<div style={{ display: 'flex', gap: '16px', alignItems: 'center' }}>
{/* Docusaurus' version of `ReactDOMServer` doesn't support Suspense yet, so we can only render the component on the client. */}
{typeof window !== 'undefined' && (
<Suspense fallback={null}>
<Markprompt projectKey={projectKey} {...config} />
</Suspense>
)}
<SearchBar {...props} />
</div>
);
}
The full documentation for the package can be found on the Markprompt docs.
This library is created by the team behind Markprompt (@markprompt).
FAQs
A Markprompt search theme for Docusaurus
The npm package @markprompt/docusaurus-theme-search receives a total of 86 weekly downloads. As such, @markprompt/docusaurus-theme-search popularity was classified as not popular.
We found that @markprompt/docusaurus-theme-search demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.