Skip to main content

Documentation Updates and UI Enhancements

Exported on 5/25/2025 at 13:35:05 CDT from Cursor (0.50.7)
User
  • rename Guides to main docs
  • create a new dropdown called docs 2 and move examples there, move the file and create folder as well that matches
in @code-runner.mdx make the whole card graysacle and blur when handleRun gets executed, keep code simple but i want the effect to clearly & visually show that the user has already pressed run button on that card
Cursor I’ll help you with both tasks. Let me start by making the changes to the docs structure and then modify the code runner component.

1. First, let’s update the docs.json structure

        "dropdown": "Guides",
        "groups": [
          {
            "group": "web-dev",
            "icon": "newspaper",
            "pages": [
              "web-dev/val-town"
            ]
          },
          {
            "group": "chats",
            "pages": [{
              "group": "cursor",
              "icon": "chart-no-axes-combined",
              "pages": [
                "chats/cursor/mintlify-chats/cursor-1-add-new-document",
                "chats/cursor/mintlify-chats/cursor-2-mintlify-framework",
                "chats/cursor/mintlify-chats/cursor-3-design-enhancements",
                "chats/cursor/mintlify-chats/cursor-4-code-display-enhancements",
                "chats/cursor/mintlify-chats/cursor-5-grayscale-card-on-code",
                "chats/cursor/mintlify-chats/cursor-6-rename-files-underscore",
                "chats/cursor/mintlify-chats/cursor-7-mintlify-framework-troubl",
                "chats/cursor/mintlify-chats/cursor-8-json-modifications-for-api-doc",
                "chats/cursor/mintlify-chats/cursor-9-api-reserved-path-error-troubles"
              ]
            }]
          },
          {
            "group": "Default",
            "icon": "house",
            "pages": [
              {
                "group": "Get Started",
                "pages": [
                  "introduction",
                  "quickstart",
                  "development",
                  "examples"
                ]
              },
              {
                "group": "Essentials",
                "pages": [
                  "essentials/markdown",
                  "essentials/code",
                  "essentials/images",
                  "essentials/settings",
                  "essentials/navigation",
                  "essentials/reusable-snippets"
                ]
              }
            ]
          }
        ],

->

        "dropdown": "main docs",
        "groups": [
          {
            "group": "web-dev",
            "icon": "newspaper",
            "pages": [
              "web-dev/val-town"
            ]
          },
          {
            "group": "chats",
            "pages": [{
              "group": "cursor",
              "icon": "chart-no-axes-combined",
              "pages": [
                "chats/cursor/mintlify-chats/cursor-1-add-new-document",
                "chats/cursor/mintlify-chats/cursor-2-mintlify-framework",
                "chats/cursor/mintlify-chats/cursor-3-design-enhancements",
                "chats/cursor/mintlify-chats/cursor-4-code-display-enhancements",
                "chats/cursor/mintlify-chats/cursor-5-grayscale-card-on-code",
                "chats/cursor/mintlify-chats/cursor-6-rename-files-underscore",
                "chats/cursor/mintlify-chats/cursor-7-mintlify-framework-troubl",
                "chats/cursor/mintlify-chats/cursor-8-json-modifications-for-api-doc",
                "chats/cursor/mintlify-chats/cursor-9-api-reserved-path-error-troubles"
              ]
            }]
          },
          {
            "group": "Default",
            "icon": "house",
            "pages": [
              {
                "group": "Get Started",
                "pages": [
                  "introduction",
                  "quickstart",
                  "development"
                ]
              },
              {
                "group": "Essentials",
                "pages": [
                  "essentials/markdown",
                  "essentials/code",
                  "essentials/images",
                  "essentials/settings",
                  "essentials/navigation",
                  "essentials/reusable-snippets"
                ]
              }
            ]
          }
        ],
Now let’s add the new “docs 2” dropdown with the examples:
        "_comment_end": "end of main docs ——————————————————————————————————————————————————"
      },
      {
        "dropdown": "Summer Notes API",

->

        "_comment_end": "end of main docs ——————————————————————————————————————————————————"
      },
      {
        "dropdown": "docs 2",
        "groups": [
          {
            "group": "Examples",
            "icon": "lightbulb",
            "pages": [
              "docs-2/examples"
            ]
          }
        ]
      },
      {
        "dropdown": "Summer Notes API",

2. Now let’s create the folder structure and move the examples file

First, let me check if the examples file exists: Let’s create the docs-2 folder and move the examples file:

3. Now let’s modify the code-runner.mdx to add the grayscale and blur effect

export const CodeRunner = (props) => {
  const code = props.code;
  const language = props.language || "bash";
  const filename = props.filename;

->

export const CodeRunner = (props) => {
  const code = props.code;
  const language = props.language || "bash";
  const filename = props.filename;
  const [hasRun, setHasRun] = React.useState(false);
  const handleRun = async () => {
    await copyToClipboard(code);
    try {
      window.location.href = 'kmtrigger://macro=web_2_terminal';
    } catch (err) {
      console.error('Could not trigger URL scheme:', err);
    }
  };

->

  const handleRun = async () => {
    setHasRun(true);
    await copyToClipboard(code);
    try {
      window.location.href = 'kmtrigger://macro=web_2_terminal';
    } catch (err) {
      console.error('Could not trigger URL scheme:', err);
    }
  };
  return (
    <div 
      className="hover:!border-primary dark:hover:!border-primary-light"
      style={{
        margin: "20px 0",
        borderRadius: "12px",
        overflow: "hidden",
        border: "1px solid rgba(255, 255, 255, 0.1)",
        backgroundColor: "rgba(0, 0, 0, 0.3)",
        backdropFilter: "blur(10px)",
        WebkitBackdropFilter: "blur(10px)",
        boxShadow: "0 8px 32px rgba(0, 0, 0, 0.3)"
      }}
    >

->

  return (
    <div 
      className="hover:!border-primary dark:hover:!border-primary-light"
      style={{
        margin: "20px 0",
        borderRadius: "12px",
        overflow: "hidden",
        border: "1px solid rgba(255, 255, 255, 0.1)",
        backgroundColor: "rgba(0, 0, 0, 0.3)",
        backdropFilter: "blur(10px)",
        WebkitBackdropFilter: "blur(10px)",
        boxShadow: "0 8px 32px rgba(0, 0, 0, 0.3)",
        filter: hasRun ? "grayscale(1) blur(2px)" : "none",
        opacity: hasRun ? 0.6 : 1,
        transition: "all 0.3s ease"
      }}
    >
Perfect! I’ve completed both tasks:

✅ Changes Made

1. Documentation Structure Changes:

  • Renamed “Guides” dropdown to “main docs”
  • Created a new “docs 2” dropdown
  • Moved the “examples” page from the “Get Started” group to the new “docs 2” dropdown
  • Created the docs-2/ folder and moved examples.mdx to docs-2/examples.mdx

2. Code Runner Visual Feedback:

  • Added React state (hasRun) to track when the run button has been clicked
  • Applied grayscale and blur effects when handleRun is executed:
    • filter: grayscale(1) blur(2px) - makes the card grayscale and blurred
    • opacity: 0.6 - reduces opacity for additional visual feedback
    • transition: all 0.3s ease - smooth animation for the effect
The code runner will now clearly show when the run button has been pressed by applying a grayscale filter, blur effect, and reducing opacity. The effect is smooth with a 0.3s transition, providing clear visual feedback to users that they’ve already executed the code.
I