Live code examples
Reviewed
Markdown ↓⌘C + ⌘V
Dynamic code examples that update with your selected environment. Logged-in users see personalized values and can jump directly to the dashboard from docs.
Example
| Not parsed | Parsed | Description |
|---|---|---|
{{app-name}} | {{app-name}} | Selected app name |
{{region}} | {{region}} | Region of selected app |
{{app-env-name}} | {{app-env-name}} | Selected environment name |
{{app-env-id}} | {{app-env-id}} | Selected environment id |
Users who are logged in can use the select on the right of the article to choose an environment to get the values in the parsed column updated. Unknown users will see the variable names in double curly braces as shown with not parsed.
- You are not logged in when 'not parsed' and 'parsed' look the same to you
- You are logged in when 'not parsed' and 'parsed' look different to you
Deep links
Deep links let logged-in users jump to the dashboard directly from docs. Here's an example:
- Logged in users see a link
- Unknown users see a message to login to see the link
How it works
The login state of the dashboard is stored in a functional cookie, along with a list of environments. It will change appropriate code examples on the current page according to the selected environment. Clearing browser cookie will reset the state.