What is @sanity/generate-help-url?
@sanity/generate-help-url is a utility package designed to generate help URLs for Sanity.io. It is useful for creating consistent and easily maintainable links to documentation or help resources.
What are @sanity/generate-help-url's main functionalities?
Generate Help URL
This feature allows you to generate a help URL based on a specific error code. The generated URL points to the relevant documentation or help page on Sanity.io.
const generateHelpUrl = require('@sanity/generate-help-url');
const url = generateHelpUrl('some-error-code');
console.log(url); // Outputs: 'https://docs.sanity.io/help/some-error-code'
Other packages similar to @sanity/generate-help-url
generate-url
The 'generate-url' package is a general-purpose URL generator that can be used to create URLs based on various parameters. Unlike @sanity/generate-help-url, it is not specifically tailored for generating help URLs for Sanity.io but can be customized for different use cases.
url-join
The 'url-join' package is used to safely join URL segments together, ensuring that there are no double slashes or other issues. While it does not specifically generate help URLs, it can be used in conjunction with other logic to create URLs for documentation or help resources.
query-string
The 'query-string' package is used to parse and stringify URL query strings. It can be useful for adding query parameters to help URLs, although it does not generate the base URL itself like @sanity/generate-help-url.
@sanity/generate-help-url
Generates URLs to specific sections of the Sanity documentation.
Installation
npm install --save @sanity/generate-help-url
Usage
import {generateHelpUrl} from '@sanity/generate-help-url'
console.log(generateHelpUrl('form-builder-input-missing-required-prop'))
The above example generates a help URL that points to a help document with the id form-builder-input-missing-required-prop
.
License
MIT © Sanity.io