Skip to content
Last updated

Here's how you can achieve each of your tasks using Markdown and some additional tools:

  1. Protecting the debrief.md page for "pearl" role: You can use GitHub's permissions and team management features to restrict access to this page. Here's how:

    • First, create a team called "pearl" if you haven't already.
    • Then, go to the repository settings and navigate to the "Manage access" tab.
    • Under "Repository access", click "Edit" and change the access to "Only users in selected teams" and choose the "pearl" team.
    • Click "Save" to apply the changes.
  2. Creating a code walkthrough: You can create a code walkthrough using comments in your code and a simple Markdown table to display them. Here's an example:

    | Line Number | Description |
    |---|---|
    | 10 | This is where the function starts |
    | 15 | The loop begins here |
    | 20 | This line prints the result |

    Then, in your code, add comments with the line numbers:

    # 10: This is where the function starts
    def my_function():
        # 15: The loop begins here
        for i in range(5):
            pass
        # 20: This line prints the result
        print("Done")
  3. Showing only the mock server in the try it console: To show only the mock server in the try it console, you can use environment variables to conditionally display the servers. Here's an example using JavaScript:

    const isMockServer = process.env.SHOW_MOCK_SERVER_ONLY ===true’;
    
    if (isMockServer) {
        // Display only the mock server
    } else {
        // Display both servers or other logic
    }
  4. Running API monitoring using Redocly on a regular schedule: To run API monitoring using Redocly on a regular schedule, you can use task schedulers like cron (for Unix-based systems) or Task Scheduler (for Windows). Here’s how you can set up a cron job:

    • Open the crontab file by running crontab -e in your terminal.

    • Add the following line to run a script (let’s say monitor_api.sh) every day at 5 PM:

      0 17 * * * /path/to/monitor_api.sh
    • Save and close the file. The script monitor_api.sh should contain the commands to run API monitoring using Redocly.

  5. Making headings purple colored in Redocly: To change the color of headings in Redocly, you can use custom CSS. Here’s how you can make headings purple:

    • Go to your Redocly project’s settings.

    • Navigate to the “Themes” tab.

    • Click on “Custom CSS” and add the following code:

      h1, h2, h3, h4, h5, h6 {
          color: purple;
      }
    • Click “Save” to apply the changes.