@hrefcl/apidoc - v4.0.5
    Preparing search index...

    Function parse

    • Api

      Parser for tags - extracts HTTP method, URL, and title from API definitions

      This parser handles the main tag that defines API endpoints. It extracts:

      • HTTP method (GET, POST, PUT, DELETE, etc.)
      • URL path with parameters
      • Optional title/description

      Parameters

      • content: string

        Raw content from the tag

      Returns { type: string; url: string; title: string }

      Parsed API information or null if parsing fails

      // Input: "{get} /users Get all users"
      // Output: { type: "get", url: "/users", title: "Get all users" }
      // Input: "{post} /users/:id/update Update user by ID"
      // Output: { type: "post", url: "/users/:id/update", title: "Update user by ID" }
      // Input: "/users Get users"
      // Output: { type: undefined, url: "/users", title: "Get users" }
      // Input: "{delete} /users/:id"
      // Output: { type: "delete", url: "/users/:id", title: "" }

      4.0.0