- Notifications
You must be signed in to change notification settings - Fork37
Setu Documentation : Content + API References
License
SetuHQ/docs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Monorepo of content and API reference ofSetu docs
You can find content forSetu docs in/content
folder
- Each category is a folder with products as sub-folders and content files inside product folders.
- All content files are MDX
endpoints.json
- Object with categories and products in Setu docsredirects.json
- key-value pairs contains information about redirecting from one slug to anothermenuItems.json
contains fully nested object for the docs sidebar (DO NOT TOUCH)
Create a new branch and raise a PR for every edit you want to make to the documentation.
To edit any page, you can either,
- clone this repo in your local and edit using VS Code
- or just press
.
after logging into GitHub to open online VS Code
Cloning and editing in local is faster due to virtual workspace in online VS Code
Go through thisdetailed guide on how to write content
For easy syntax higlighting,VSCode MDX
- Install thisextension from marketplace.
- or you can install in VS Code by the extensions tab in the leftside bar or press
Shift + Cmd/Ctrl + X
and search forMDX
For documentation preview,Docter Preview
- Install thisextension from marketplace.
- You can install in VS Code by the extensions tab in the leftside bar or press
Shift + Cmd/Ctrl + X
and search forDocter Preview
Using theDocter Preview
extension, we can preview content and sidebar changes. Please go through theREADME to learn about the features and follow the steps mentioned to use it.
You can find API reference spec files forSetu docs in/api-reference
folder
- Each category is a folder with products as API reference spec files in JSON or YAML format.
- All API reference files are in JSON or YAML format
You can now use Setu's pre-built editor to preview API references.Visit the preview page, copy your content and generate an API reference preview.
Currently this only works for JSON files. Support for YAML is WIP and should be available soon.
To add versions to any product in our docs, these steps need to be followed:
Go toendpoints.json
, add the following key-value pairs inside the product object
versions
- an array of strings with the all the possible versionsdefault_version
- a version string which denotes the default version to load on docs
Example:
{"name":"Account Aggregator","path":"account-aggregator","order":4,"versions": ["v1","v2"],"default_version":"v2","visible_in_sidebar":true}
In future if there is a new version,v1.5
which is not a default version,
We need to addv1.5
to the versions array
To update content for a product based on the versions,
- Existing content in the root of product folder corresponds to the default version documentation. You can make changes to it.
- Create a new folder with older version and add content of previous version
Example:
In case of Account Aggregator, if you see the product folder,
- the files in the root correspond to version
v2
as it is the default version. - there is a folder
v1
which corresponds to the older version documentation. Put all thev1
documentation into this folder.
.├── ...├── account-aggregator│ ├── overview.mdx│ ├── quickstart.mdx│ ├── v1│ │ ├── overview.mdx│ │ ├── quickstart.mdx│ │ └── ...│ └── ...└── ...
In future if there is a new version,v1.5
, which is not a default version,
We need to add a folderv1.5
and add contents of that version into it.
To update API references based on versions,
- In API reference folder,
{product}.json
corresponds to the default version mentioned - Create a new file with name in the format,
{product}_{version}.json
. Hereversion
denotes the verion other other thandefault_version
Example:
In case of Account Aggregator, in api-references folder,
account-aggregator.json
corresponds to the default versionv2
account-aggregator_v1.json
corresponds to a version other than default version,v1
.├── ...├── api-references│ ├── data│ │ ├── account-aggregator.json│ │ ├── account-aggregator_v1.json│ │ └── ...│ └── ...└── ...
In future if there is a new version,v1.5
which is not a default version,
We need to add a fileaccount-aggregator_v1.5.json
and add API reference into it