Skip to content
Last updated

Here are the answers to your questions based on the Redocly documentation:

1. Protecting debrief.md with "pearl" role access

To restrict access to debrief.md for users with the "pearl" role, you can use Redocly's access control features. Add the following frontmatter to your Markdown file:


access:
  - pearl

This ensures only users with the pearl role can view the content.


2. Creating a code walkthrough

To create a code walkthrough in Redocly:

  1. Use annotated code blocks with <!-- focus --> comments to highlight sections.
  2. Structure it like this:
```python
def example_function():
    # <!-- focus --> This is the key part
    return "Highlighted code"
```
  1. Enable the walkthrough mode in your Redocly configuration:
features:
  codeSamples:
    walkthrough: true

3. Showing only the mock server in Try-It console

Configure your API definition to use mock servers exclusively:

servers:
  - url: https://mock-server.example.com
    description: Mock server
x-mock:
  enabled: true

Then disable real servers in your Redocly config:

tryIt:
  realServer: false

4. Running API monitoring on a schedule

Use Redocly’s API monitoring with a redocly.monitoring.yaml file:

checks:
  - name: Daily health check
    url: https://api.example.com/health
    schedule: “0 9 * * *”  # 09:00 daily
    assertions:
      - statusCode: 200

Then run:

redocly monitor --schedule

5. Making headings purple in Redocly

Add custom CSS via the theme configuration:

theme:
  colors:
    primary:
      main: ‘#800080’  # Purple
  typography:
    headings:
      fontFamily: ‘inherit’
      color: ‘#800080’

Or inject CSS directly:

theme:
  styles:
    h1:
      color: purple !important

Let me know if you need any clarification!