Skip to content

Commit 65e886b

Browse files
authored
Merge pull request #934 from PhilippeR26/doc-search
Add search functionnality to the official website.
2 parents 42efef2 + c91f3f3 commit 65e886b

File tree

6 files changed

+63
-31
lines changed

6 files changed

+63
-31
lines changed

src/utils/calldata/enum/CairoCustomEnum.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ export type CairoEnumRaw = {
88
* {Success: 234, Warning: undefined, Error: undefined}.
99
* Only one variant with a value, object, array.
1010
* @returns an instance representing a Cairo custom Enum.
11-
* @example ```typescript
11+
* @example
12+
* ```typescript
1213
* const myCairoEnum = new CairoCustomEnum( {Success: undefined, Warning: "0x7f32ea", Error: undefined})
1314
* ```
1415
*/
1516
export class CairoCustomEnum {
1617
/**
1718
* direct readonly access to variants of the Cairo Custom Enum.
1819
* @returns a value of type any
19-
* @example ```typescript
20+
* @example
21+
* ```typescript
2022
* const successValue = myCairoEnum.variant.Success;
2123
*/
2224
readonly variant: CairoEnumRaw;

src/utils/calldata/enum/CairoOption.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export enum CairoOptionVariant {
88
* @param variant CairoOptionVariant.Some or CairoOptionVariant.None
99
* @param someContent value of type T.
1010
* @returns an instance representing a Cairo Option.
11-
* @example ```typescript
11+
* @example
12+
* ```typescript
1213
* const myOption = new CairoOption<BigNumberish>(CairoOptionVariant.Some, "0x54dda8");
1314
* ```
1415
*/

src/utils/calldata/enum/CairoResult.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export enum CairoResultVariant {
88
* @param variant CairoResultVariant.Ok or CairoResultVariant.Err
99
* @param resultContent value of type T or U.
1010
* @returns an instance representing a Cairo Result.
11-
* @example ```typescript
11+
* @example
12+
* ```typescript
1213
* const myOption = new CairoResult<BigNumberish, CustomError>(CairoResultVariant.Ok, "0x54dda8");
1314
* ```
1415
*/

www/docusaurus.config.js

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,35 @@ const config = {
3838

3939
themeConfig:
4040
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
41-
({
41+
{
42+
algolia: {
43+
// The application ID provided by Algolia
44+
appId: '86VVNRI64B',
45+
46+
// Public API key: it is safe to commit it
47+
apiKey: '6f4db54e4ee0ae77619b41dbe862af7f',
48+
49+
indexName: 'starknetjs',
50+
51+
// Optional: see doc section below
52+
contextualSearch: true,
53+
54+
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
55+
//externalUrlRegex: 'external\\.com|domain\\.com',
56+
57+
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
58+
//replaceSearchResultPathname: {
59+
// from: '/docs/', // or as RegExp: /\/docs\//
60+
// to: '/',
61+
62+
// Optional: Algolia search parameters
63+
//searchParameters: {},
64+
65+
// Optional: path for search page that enabled by default (`false` to disable it)
66+
//searchPagePath: 'search',
67+
68+
//... other Algolia param
69+
},
4270
announcementBar: {
4371
content: `<a href="${migrationGuideLink}">Migrate from v4</a>`,
4472
backgroundColor: 'rgb(230 231 232)',
@@ -67,6 +95,7 @@ const config = {
6795
dropdownActiveClassDisabled: true,
6896
position: 'left',
6997
},
98+
7099
{
71100
label: 'GitHub',
72101
href: 'https://github.com/starknet-io/starknet.js',
@@ -119,7 +148,7 @@ const config = {
119148
theme: lightCodeTheme,
120149
darkTheme: darkCodeTheme,
121150
},
122-
}),
151+
},
123152

124153
plugins: [
125154
[
@@ -155,7 +184,6 @@ const config = {
155184
'Function',
156185
'Accessor',
157186
'Method',
158-
'ObjectLiteral',
159187
'Parameter',
160188
'TypeParameter',
161189
'TypeLiteral',

www/package-lock.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"devDependencies": {
2828
"@docusaurus/module-type-aliases": "^2.4.0",
2929
"@tsconfig/docusaurus": "^1.0.7",
30-
"docusaurus-plugin-typedoc": "^0.19.2",
31-
"typedoc": "^0.24.7",
32-
"typedoc-plugin-markdown": "^3.15.3",
30+
"docusaurus-plugin-typedoc": "^0.21.0",
31+
"typedoc": "^0.25.4",
32+
"typedoc-plugin-markdown": "^3.17.1",
3333
"typescript": "^5.0.4"
3434
},
3535
"browserslist": {

0 commit comments

Comments
 (0)