-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: Add page standardization to external tool integrations #2668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a7d22fa
docs: Add User Guide section
dishaprakash a9c315c
rebase
dishaprakash 50e37bb
docs: Add reference and other docs
dishaprakash 43f2b69
Update docs/en/reference/faq.md
dishaprakash 8d97bab
chore: Add workflows to deploy to cloudflare
dishaprakash 8f0ea15
use sticky comment
dishaprakash 6e1c0c3
remove prs from pull_request_target and add second hugo config
dishaprakash a2eb7be
add header
dishaprakash 8a58ffa
docs: implement deep re-routing, pagination, and migration banner
dishaprakash 4a5432e
Apply suggestion from @gemini-code-assist[bot]
dishaprakash d45d9b6
gemini review changes
dishaprakash 80822be
minor fix
dishaprakash c654670
docs: Optimize llms.txt and llms-full.txt
dishaprakash 315df49
add documentation
dishaprakash 3833b43
update integration directory structure
dishaprakash a48e3dd
docs: Add page standardization to external source integrations
dishaprakash 435acc6
add documentation and ci check
dishaprakash 40dd323
docs: Add page standardization to external tool integrations
dishaprakash 5504f55
Update docs/en/integrations/cockroachdb/_index.md
dishaprakash b7520b7
gemini review
dishaprakash 5001d0f
Update DEVELOPER.md
dishaprakash 6613fd6
review changes
dishaprakash 509aeeb
update gha workflow
dishaprakash 8572e4f
minor fix
dishaprakash d14af85
Update DEVELOPER.md
dishaprakash 8492914
Merge branch 'page-standardization' into tools-page-standard
dishaprakash 06cf47c
documentation
dishaprakash ef3d0df
Merge branch 'documentation-reorg' into tools-page-standard
dishaprakash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| python3 - << 'EOF' | ||
| """ | ||
| MCP TOOLBOX: TOOL PAGE LINTER | ||
| ============================= | ||
| This script enforces a standardized structure for individual Tool pages | ||
| (e.g., integrations/postgres/postgres-sql.md). It ensures that LLM agents | ||
| can parse tool capabilities and parameter definitions reliably. | ||
|
|
||
| MAINTENANCE GUIDE: | ||
| ------------------ | ||
| 1. TO ADD A NEW HEADING: | ||
| Add the exact heading text to the 'ALLOWED_ORDER' list in the desired | ||
| sequence. | ||
|
|
||
| 2. TO MAKE A HEADING MANDATORY: | ||
| Add the heading text to the 'REQUIRED' set. | ||
|
|
||
| 3. TO UPDATE SHORTCODE LOGIC: | ||
| If the shortcode name changes, update 'SHORTCODE_PATTERN'. | ||
|
|
||
| 4. SCOPE: | ||
| This script targets all .md files in integrations/ EXCEPT _index.md files. | ||
| """ | ||
|
|
||
| import os | ||
| import re | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| # --- CONFIGURATION --- | ||
| ALLOWED_ORDER = [ | ||
| "About", | ||
| "Compatible Sources", | ||
| "Requirements", | ||
| "Parameters", | ||
| "Example", | ||
| "Output Format", | ||
| "Reference", | ||
| "Advanced Usage", | ||
| "Troubleshooting", | ||
| "Additional Resources" | ||
| ] | ||
| REQUIRED = {"About", "Example"} | ||
| SHORTCODE_PATTERN = r"\{\{<\s*compatible-sources.*?>\}\}" | ||
| # --------------------- | ||
|
|
||
| integration_dir = Path("./docs/en/integrations") | ||
| if not integration_dir.exists(): | ||
| print("Info: Directory './docs/en/integrations' not found. Skipping linting.") | ||
| sys.exit(0) | ||
|
|
||
| has_errors = False | ||
|
|
||
| # Find all .md files, excluding _index.md (which are Source pages) | ||
| for filepath in integration_dir.rglob("*.md"): | ||
| if filepath.name == "_index.md": | ||
| continue | ||
|
|
||
| with open(filepath, "r", encoding="utf-8") as f: | ||
| content = f.read() | ||
|
|
||
| # Separate YAML frontmatter from the markdown body | ||
| match = re.match(r'^\s*---\s*\n(.*?)\n---\s*(.*)', content, re.DOTALL) | ||
| if match: | ||
| frontmatter = match.group(1) | ||
| body = match.group(2) | ||
| else: | ||
| frontmatter = "" | ||
| body = content | ||
|
|
||
| if not body.strip(): | ||
| continue | ||
|
|
||
| file_errors = False | ||
|
|
||
| # 1. Check Frontmatter Title | ||
| title_source = frontmatter if frontmatter else content | ||
| title_match = re.search(r"^title:\s*[\"']?(.*?)[\"']?\s*$", title_source, re.MULTILINE) | ||
| if not title_match or not title_match.group(1).strip().endswith("Tool"): | ||
| found_title = title_match.group(1) if title_match else "None" | ||
| print(f"[{filepath}] Error: Frontmatter title must end with 'Tool'. Found: '{found_title}'") | ||
| file_errors = True | ||
|
|
||
| # 2. Check Shortcode Placement | ||
| sources_section_match = re.search(r"^##\s+Compatible Sources\s*(.*?)(?=^##\s|\Z)", body, re.MULTILINE | re.DOTALL) | ||
| if sources_section_match: | ||
| if not re.search(SHORTCODE_PATTERN, sources_section_match.group(1)): | ||
| print(f"[{filepath}] Error: The compatible-sources shortcode must be placed under '## Compatible Sources'.") | ||
| file_errors = True | ||
| elif re.search(SHORTCODE_PATTERN, body): | ||
| print(f"[{filepath}] Error: Shortcode found, but '## Compatible Sources' heading is missing.") | ||
| file_errors = True | ||
|
|
||
| # 3. Strip code blocks | ||
| clean_body = re.sub(r"^(?:```|~~~).*?^(?:```|~~~)", "", body, flags=re.DOTALL | re.MULTILINE) | ||
|
|
||
| # 4. Check H1 Headings | ||
| if re.search(r"^#\s+\w+", clean_body, re.MULTILINE): | ||
| print(f"[{filepath}] Error: H1 headings (#) are forbidden in the body.") | ||
| file_errors = True | ||
|
|
||
| # 5. Check H2 Headings | ||
| h2s = [h.strip() for h in re.findall(r"^##\s+(.*)", clean_body, re.MULTILINE)] | ||
|
|
||
| # Missing Required | ||
| if missing := (REQUIRED - set(h2s)): | ||
| print(f"[{filepath}] Error: Missing required H2 headings: {missing}") | ||
| file_errors = True | ||
|
|
||
| # Unauthorized Headings | ||
| if unauthorized := (set(h2s) - set(ALLOWED_ORDER)): | ||
| print(f"[{filepath}] Error: Unauthorized H2 headings found: {unauthorized}") | ||
| file_errors = True | ||
|
|
||
| # Strict Ordering | ||
| filtered_h2s = [h for h in h2s if h in ALLOWED_ORDER] | ||
| expected_order = [h for h in ALLOWED_ORDER if h in h2s] | ||
| if filtered_h2s != expected_order: | ||
| print(f"[{filepath}] Error: Headings are out of order.") | ||
| print(f" Expected: {expected_order}") | ||
| print(f" Found: {filtered_h2s}") | ||
| file_errors = True | ||
|
|
||
| if file_errors: | ||
| has_errors = True | ||
|
|
||
| if has_errors: | ||
| print("Linting failed for Tool pages. Please fix the structure errors above.") | ||
| sys.exit(1) | ||
| else: | ||
| print("Success: All Tool pages passed structure validation.") | ||
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
docs/en/integrations/alloydb-admin/alloydb-wait-for-operation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.