Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

POC for documentation using typedoc and sphinx-js #37

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sphinx-js==3.2.1
sphinx-copybutton==0.5.2
sphinx-book-theme==1.0.1
sphinx-copybutton==0.5.2
sphinx-design==0.5.0
sphinx-sitemap==2.5.1
sphinx-togglebutton==0.3.2
sphinxext-opengraph==0.8.2
9 changes: 9 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,17 @@
"sphinx_design",
"sphinx_sitemap",
"sphinxext.opengraph",
"sphinx_js"
]

primary_domain = 'js'

js_language = 'typescript'

js_source_path = '../src/restapi'

jsdoc_config_path = '../typedoc.conf.json'

# For more information see:
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
myst_enable_extensions = [
Expand Down
5 changes: 5 additions & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,8 @@ const { useGetContent } = client;

const { data, isLoading } = useGetContent({ path: pathname });
```

.. autofunction:: getContentQuery
.. autofunction:: createContentMutation
.. autofunction:: updateContentMutation
.. autofunction:: deleteContentMutation
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ sphinx-design
sphinx-sitemap
sphinx-togglebutton
sphinxext-opengraph
sphinx-js
7 changes: 7 additions & 0 deletions src/restapi/content/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export const createContent = async ({
return apiRequest('post', validatedArgs.path, options);
};

/**
* Use the createContentMutation function to get the mutation for adding content at a given path.
*
* @param path
* @param data
* @returns details about the created content
*/
export const createContentMutation = ({
config,
}: {
Expand Down
6 changes: 6 additions & 0 deletions src/restapi/content/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export const deleteContent = async ({
return apiRequest('delete', validatedArgs.path, options);
};

/**
* Use the deleteContentMutation function to get the mutation for deleting content at a given path.
*
* @param path
* @returns undefined
*/
export const deleteContentMutation = ({
config,
}: {
Expand Down
10 changes: 10 additions & 0 deletions src/restapi/content/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ export const getContent = async ({
return apiRequest('get', path, options);
};

/**
* Use the getContentQuery function to get the query for fetching the content at a given path.
*
* @param path
* @param version
* @param page
* @param fullObjects
* @param expand
* @returns details about the content at the given path
*/
export const getContentQuery = ({
path,
version,
Expand Down
7 changes: 7 additions & 0 deletions src/restapi/content/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export const updateContent = async ({
return apiRequest('patch', validatedArgs.path, options);
};

/**
* Use the updateContentMutation function to get the mutation for updating content at a given path.
*
* @param path
* @param data
* @returns details about the updated content
*/
export const updateContentMutation = ({
config,
}: {
Expand Down
30 changes: 30 additions & 0 deletions typedoc.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types": ["vite", "vitest/globals"]
},
"entryPoints": ["src"],
"excludePrivate": true,
"excludeExternals": true,
"readme": "none",
"excludeInternal": true,
"exclude": [
"node_modules",
"lib",
"lib64"
]
}
Loading