Before committing changes
- Your PR title must contain the appropriate prefix (
docs:). - Run the following command in the
docdirectory:You can also try the following. It might work, or you might get an error.npx prettier . --writepnpm format
Before committing changes
docs:).doc directory:
npx prettier . --writepnpm formatAfter a Starlight upgrade to open-payments
cd <to project folder>pnpm installcd docspnpm startSpell as two words, not one (OpenPayments).
All concepts docs (and the getting started overview) should have a summary at the top that gives a TL;DR of the contents/purpose of the page.
For now, we’re using the :::tip aside with the default rocket icon. In newer versions of Starlight, you can use custom icons. We’ll replace the rocket when our version is updated.
https://starlight.astro.build/components/asides/#use-custom-icons
The following sections, at minimum, should be included in all Open Payments developer guides. Included below are some highish-level style standards, but you should look to existing guides for the bigger picture.
Use the :::tip aside and briefly describe the purpose of the guide. Don’t repeat the page title.
Include some general information about the guide that helps to set up the subsequent Scenario section.
For example, in Set up recurring payments with a fixed incoming amount, we use a “subscription payment” as a general example of a recurring transfer of money of the same amount. Then, the scenario section uses “streaming service” as a specific kind of recurring subscription.
Describe the specific scenario the guide will cover. Include values for things like currency type, amount, recurrence schedule, etc. The guide’s steps must follow what you describe here.
List and define the parties involved in the scenario. One will always be the reader of the guide and the role they’re assuming (developer, platform operator, etc.). Other parties could include merchant/retailer, service provider, customer, sender, recipient.
Bold the party name and use a (bold) colon. Then include the description in normal text. For example:
Remember to refer to existing guides for examples.
Provide a bulleted list of every API that’s used in the guide. Prefix each API with the appropriate Badge and wrap each API name in the LinkOut component.
<Badge text="GET" variant="note" /><Badge text="POST" variant="success" /><Badge text="DELETE" variant="danger" />If the guide mentions optional APIs, exclude them from this list. This list is what’s required.
Request snippets should come from a developer. If the developer is nice enough to add the snippets to the doc, review the markdown to make sure it’s formatted correctly.
<Tabs syncKey="lang">).wrap property (```ts wrap).Update each snippet, when possible, to be specific to your scenario. Look at other guides for examples. You might need a developer to help with parts of it.
If you think a parameter or value needs additional explanation, use a double backslash and add a comment to the end of the line (// the management uri).
We should be able to create the API responses by using the snippets and our API docs.
When formatting the response:
<detail> element.Example response (or similar) as the summary.```json wrap in the code block.When revising the response’s values:
createdAt). They should incrementally increase as the steps progress."...".
{ "access_token": { "value": "...", //access token value for incoming payment grant }}{...}.
{ "manage": "https://auth.happylifebank.example.com/token/{...}", // management uri for access token}