From b02478f17a1024c9e7b06890eef5505333f27fe7 Mon Sep 17 00:00:00 2001 From: danshalev7 Date: Sun, 18 Jan 2026 19:28:34 +0200 Subject: [PATCH 1/3] Tidy repo and remove duplicates --- .gitignore | 49 + add_h1_headings.py | 81 - check_h1_headings.py | 131 -- check_navigation_complete.py | 98 - comprehensive_nav_check.py | 149 -- final_results.txt | 504 ------ find_duplicate_h1s.py | 71 - fix_all_h1s.py | 76 - fix_angle_brackets.py | 91 - fix_curly_braces.py | 51 - format_results.py | 71 - index-staging.md | 326 ---- output.txt | 753 -------- test_single.py | 34 - verify_navigation.py | 127 -- website/docs/References.md | 37 - website/docs/agentic-memory/cognee.md | 353 ---- .../agentic-memory/graphiti-mcp-server.md | 637 ------- website/docs/agentic-memory/graphiti.md | 243 --- website/docs/agentic-memory/index.md | 47 - .../docs/algorithms/betweenness-centrality.md | 92 - website/docs/algorithms/bfs.md | 98 - website/docs/algorithms/cdlp.md | 182 -- website/docs/algorithms/index.md | 54 - website/docs/algorithms/msf.md | 178 -- website/docs/algorithms/pagerank.md | 100 -- website/docs/algorithms/sppath.md | 103 -- website/docs/algorithms/sspath.md | 109 -- website/docs/algorithms/wcc.md | 116 -- website/docs/browser/readme-browser.md | 145 -- website/docs/cloud/enterprise-tier.md | 52 - website/docs/cloud/features.md | 63 - website/docs/cloud/free-tier.md | 46 - website/docs/cloud/index.md | 62 - website/docs/cloud/pro-tier.md | 90 - website/docs/cloud/startup-tier.md | 59 - website/docs/commands/acl.md | 135 -- website/docs/commands/graph.config-get.mdx | 137 -- website/docs/commands/graph.config-set.mdx | 155 -- .../docs/commands/graph.constraint-create.mdx | 333 ---- .../docs/commands/graph.constraint-drop.mdx | 134 -- website/docs/commands/graph.copy.mdx | 132 -- website/docs/commands/graph.delete.mdx | 133 -- website/docs/commands/graph.explain.mdx | 86 - website/docs/commands/graph.info.md | 36 - website/docs/commands/graph.list.mdx | 97 - website/docs/commands/graph.memory.mdx | 124 -- website/docs/commands/graph.profile.mdx | 119 -- website/docs/commands/graph.query.mdx | 161 -- website/docs/commands/graph.ro-query.mdx | 73 - website/docs/commands/graph.slowlog.mdx | 107 -- website/docs/commands/index.md | 22 - website/docs/cypher/call.md | 146 -- website/docs/cypher/create.md | 57 - website/docs/cypher/cypher-support.md | 147 -- website/docs/cypher/delete.md | 51 - website/docs/cypher/foreach.md | 40 - website/docs/cypher/functions.md | 447 ----- website/docs/cypher/index.md | 45 - .../docs/cypher/indexing/fulltext-index.mdx | 1001 ----------- website/docs/cypher/indexing/index.md | 30 - website/docs/cypher/indexing/range-index.mdx | 798 --------- website/docs/cypher/indexing/vector-index.mdx | 619 ------- website/docs/cypher/known-limitations.md | 67 - website/docs/cypher/limit.md | 18 - website/docs/cypher/load-csv.md | 194 -- website/docs/cypher/match.md | 120 -- website/docs/cypher/merge.md | 92 - website/docs/cypher/optional-match.md | 46 - website/docs/cypher/order-by.md | 29 - website/docs/cypher/procedures.md | 48 - website/docs/cypher/remove.md | 70 - website/docs/cypher/return.md | 64 - website/docs/cypher/set.md | 79 - website/docs/cypher/skip.md | 21 - website/docs/cypher/union.md | 26 - website/docs/cypher/unwind.md | 68 - website/docs/cypher/where.md | 82 - website/docs/cypher/with.md | 50 - website/docs/datatypes.md | 299 ---- website/docs/design/bulk-spec.md | 100 -- website/docs/design/client-spec.md | 295 --- website/docs/design/index.md | 221 --- website/docs/design/result-structure.md | 132 -- website/docs/design/third-party.md | 59 - website/docs/genai-tools/ag2.md | 345 ---- website/docs/genai-tools/graphrag-sdk.md | 122 -- website/docs/genai-tools/graphrag-toolkit.md | 137 -- website/docs/genai-tools/index.md | 19 - website/docs/genai-tools/langchain.md | 371 ---- website/docs/genai-tools/langgraph.md | 312 ---- website/docs/genai-tools/llamaindex.md | 306 ---- website/docs/getting-started/clients.md | 126 -- website/docs/getting-started/configuration.md | 408 ----- website/docs/getting-started/index.mdx | 459 ----- website/docs/index.mdx | 316 ---- website/docs/integration/bolt-support.md | 62 - website/docs/integration/index.md | 23 - website/docs/integration/jena.md | 81 - website/docs/integration/kafka-connect.md | 109 -- website/docs/integration/rest.md | 1574 ----------------- .../docs/integration/spring-data-falkordb.md | 507 ------ website/docs/license.md | 53 - website/docs/operations/building-docker.md | 154 -- website/docs/operations/cluster.md | 123 -- website/docs/operations/docker.md | 489 ----- website/docs/operations/falkordblite.md | 218 --- website/docs/operations/index.md | 58 - website/docs/operations/k8s-support.md | 164 -- website/docs/operations/kubeblocks.md | 851 --------- website/docs/operations/lightning-ai.md | 141 -- website/docs/operations/migration/index.md | 18 - .../operations/migration/kuzu-to-falkordb.md | 279 --- .../operations/migration/neo4j-to-falkordb.md | 349 ---- .../operations/migration/rdf-to-falkordb.md | 290 --- .../migration/redisgraph-to-falkordb.md | 69 - website/docs/operations/opentelemetry.md | 338 ---- website/docs/operations/performance.md | 43 - website/docs/operations/persistence.md | 92 - website/docs/operations/railway.md | 152 -- website/docs/operations/replication.md | 126 -- website/docs/operations/security.md | 55 - website/docs/staging.mdx | 267 --- website/docs/troubleshooting/index.md | 49 - website/docs/tutorials/knowledge-graph-rag.md | 97 - website/docs/tutorials/social-network.md | 46 - website/docs/udfs/flex/bitwise/and.md | 65 - website/docs/udfs/flex/bitwise/index.md | 9 - website/docs/udfs/flex/bitwise/not.md | 78 - website/docs/udfs/flex/bitwise/or.md | 71 - website/docs/udfs/flex/bitwise/shiftLeft.md | 83 - website/docs/udfs/flex/bitwise/shiftRight.md | 98 - website/docs/udfs/flex/bitwise/xor.md | 81 - .../docs/udfs/flex/collections/frequencies.md | 84 - website/docs/udfs/flex/collections/index.md | 9 - .../udfs/flex/collections/intersection.md | 78 - website/docs/udfs/flex/collections/shuffle.md | 76 - website/docs/udfs/flex/collections/union.md | 76 - website/docs/udfs/flex/collections/zip.md | 80 - website/docs/udfs/flex/date/format.md | 101 -- website/docs/udfs/flex/date/index.md | 9 - website/docs/udfs/flex/date/parse.md | 80 - website/docs/udfs/flex/date/toTimeZone.md | 85 - website/docs/udfs/flex/date/truncate.md | 103 -- website/docs/udfs/flex/index.md | 135 -- website/docs/udfs/flex/json/fromJsonList.md | 82 - website/docs/udfs/flex/json/fromJsonMap.md | 80 - website/docs/udfs/flex/json/index.md | 9 - website/docs/udfs/flex/json/toJson.md | 79 - website/docs/udfs/flex/map/fromPairs.md | 82 - website/docs/udfs/flex/map/index.md | 9 - website/docs/udfs/flex/map/merge.md | 82 - website/docs/udfs/flex/map/removeKey.md | 83 - website/docs/udfs/flex/map/removeKeys.md | 84 - website/docs/udfs/flex/map/submap.md | 89 - website/docs/udfs/flex/similarity/index.md | 9 - website/docs/udfs/flex/similarity/jaccard.md | 83 - website/docs/udfs/flex/text/camelCase.md | 71 - website/docs/udfs/flex/text/capitalize.md | 57 - website/docs/udfs/flex/text/decapitalize.md | 57 - website/docs/udfs/flex/text/format.md | 72 - website/docs/udfs/flex/text/index.md | 9 - website/docs/udfs/flex/text/indexOf.md | 74 - website/docs/udfs/flex/text/indexesOf.md | 78 - website/docs/udfs/flex/text/jaroWinkler.md | 78 - website/docs/udfs/flex/text/join.md | 84 - website/docs/udfs/flex/text/levenshtein.md | 75 - website/docs/udfs/flex/text/lpad.md | 84 - website/docs/udfs/flex/text/regexGroups.md | 77 - website/docs/udfs/flex/text/repeat.md | 92 - website/docs/udfs/flex/text/replace.md | 87 - website/docs/udfs/flex/text/rpad.md | 75 - website/docs/udfs/flex/text/snakeCase.md | 77 - website/docs/udfs/flex/text/swapCase.md | 62 - website/docs/udfs/flex/text/upperCamelCase.md | 70 - website/docs/udfs/index.md | 422 ----- website/docusaurus.config.ts | 1 + 177 files changed, 50 insertions(+), 26645 deletions(-) delete mode 100644 add_h1_headings.py delete mode 100644 check_h1_headings.py delete mode 100644 check_navigation_complete.py delete mode 100644 comprehensive_nav_check.py delete mode 100644 final_results.txt delete mode 100644 find_duplicate_h1s.py delete mode 100644 fix_all_h1s.py delete mode 100644 fix_angle_brackets.py delete mode 100644 fix_curly_braces.py delete mode 100644 format_results.py delete mode 100644 index-staging.md delete mode 100644 output.txt delete mode 100644 test_single.py delete mode 100644 verify_navigation.py delete mode 100644 website/docs/References.md delete mode 100644 website/docs/agentic-memory/cognee.md delete mode 100644 website/docs/agentic-memory/graphiti-mcp-server.md delete mode 100644 website/docs/agentic-memory/graphiti.md delete mode 100644 website/docs/agentic-memory/index.md delete mode 100644 website/docs/algorithms/betweenness-centrality.md delete mode 100644 website/docs/algorithms/bfs.md delete mode 100644 website/docs/algorithms/cdlp.md delete mode 100644 website/docs/algorithms/index.md delete mode 100644 website/docs/algorithms/msf.md delete mode 100644 website/docs/algorithms/pagerank.md delete mode 100644 website/docs/algorithms/sppath.md delete mode 100644 website/docs/algorithms/sspath.md delete mode 100644 website/docs/algorithms/wcc.md delete mode 100644 website/docs/browser/readme-browser.md delete mode 100644 website/docs/cloud/enterprise-tier.md delete mode 100644 website/docs/cloud/features.md delete mode 100644 website/docs/cloud/free-tier.md delete mode 100644 website/docs/cloud/index.md delete mode 100644 website/docs/cloud/pro-tier.md delete mode 100644 website/docs/cloud/startup-tier.md delete mode 100644 website/docs/commands/acl.md delete mode 100644 website/docs/commands/graph.config-get.mdx delete mode 100644 website/docs/commands/graph.config-set.mdx delete mode 100644 website/docs/commands/graph.constraint-create.mdx delete mode 100644 website/docs/commands/graph.constraint-drop.mdx delete mode 100644 website/docs/commands/graph.copy.mdx delete mode 100644 website/docs/commands/graph.delete.mdx delete mode 100644 website/docs/commands/graph.explain.mdx delete mode 100644 website/docs/commands/graph.info.md delete mode 100644 website/docs/commands/graph.list.mdx delete mode 100644 website/docs/commands/graph.memory.mdx delete mode 100644 website/docs/commands/graph.profile.mdx delete mode 100644 website/docs/commands/graph.query.mdx delete mode 100644 website/docs/commands/graph.ro-query.mdx delete mode 100644 website/docs/commands/graph.slowlog.mdx delete mode 100644 website/docs/commands/index.md delete mode 100644 website/docs/cypher/call.md delete mode 100644 website/docs/cypher/create.md delete mode 100644 website/docs/cypher/cypher-support.md delete mode 100644 website/docs/cypher/delete.md delete mode 100644 website/docs/cypher/foreach.md delete mode 100644 website/docs/cypher/functions.md delete mode 100644 website/docs/cypher/index.md delete mode 100644 website/docs/cypher/indexing/fulltext-index.mdx delete mode 100644 website/docs/cypher/indexing/index.md delete mode 100644 website/docs/cypher/indexing/range-index.mdx delete mode 100644 website/docs/cypher/indexing/vector-index.mdx delete mode 100644 website/docs/cypher/known-limitations.md delete mode 100644 website/docs/cypher/limit.md delete mode 100644 website/docs/cypher/load-csv.md delete mode 100644 website/docs/cypher/match.md delete mode 100644 website/docs/cypher/merge.md delete mode 100644 website/docs/cypher/optional-match.md delete mode 100644 website/docs/cypher/order-by.md delete mode 100644 website/docs/cypher/procedures.md delete mode 100644 website/docs/cypher/remove.md delete mode 100644 website/docs/cypher/return.md delete mode 100644 website/docs/cypher/set.md delete mode 100644 website/docs/cypher/skip.md delete mode 100644 website/docs/cypher/union.md delete mode 100644 website/docs/cypher/unwind.md delete mode 100644 website/docs/cypher/where.md delete mode 100644 website/docs/cypher/with.md delete mode 100644 website/docs/datatypes.md delete mode 100644 website/docs/design/bulk-spec.md delete mode 100644 website/docs/design/client-spec.md delete mode 100644 website/docs/design/index.md delete mode 100644 website/docs/design/result-structure.md delete mode 100644 website/docs/design/third-party.md delete mode 100644 website/docs/genai-tools/ag2.md delete mode 100644 website/docs/genai-tools/graphrag-sdk.md delete mode 100644 website/docs/genai-tools/graphrag-toolkit.md delete mode 100644 website/docs/genai-tools/index.md delete mode 100644 website/docs/genai-tools/langchain.md delete mode 100644 website/docs/genai-tools/langgraph.md delete mode 100644 website/docs/genai-tools/llamaindex.md delete mode 100644 website/docs/getting-started/clients.md delete mode 100644 website/docs/getting-started/configuration.md delete mode 100644 website/docs/getting-started/index.mdx delete mode 100644 website/docs/index.mdx delete mode 100644 website/docs/integration/bolt-support.md delete mode 100644 website/docs/integration/index.md delete mode 100644 website/docs/integration/jena.md delete mode 100644 website/docs/integration/kafka-connect.md delete mode 100644 website/docs/integration/rest.md delete mode 100644 website/docs/integration/spring-data-falkordb.md delete mode 100644 website/docs/license.md delete mode 100644 website/docs/operations/building-docker.md delete mode 100644 website/docs/operations/cluster.md delete mode 100644 website/docs/operations/docker.md delete mode 100644 website/docs/operations/falkordblite.md delete mode 100644 website/docs/operations/index.md delete mode 100644 website/docs/operations/k8s-support.md delete mode 100644 website/docs/operations/kubeblocks.md delete mode 100644 website/docs/operations/lightning-ai.md delete mode 100644 website/docs/operations/migration/index.md delete mode 100644 website/docs/operations/migration/kuzu-to-falkordb.md delete mode 100644 website/docs/operations/migration/neo4j-to-falkordb.md delete mode 100644 website/docs/operations/migration/rdf-to-falkordb.md delete mode 100644 website/docs/operations/migration/redisgraph-to-falkordb.md delete mode 100644 website/docs/operations/opentelemetry.md delete mode 100644 website/docs/operations/performance.md delete mode 100644 website/docs/operations/persistence.md delete mode 100644 website/docs/operations/railway.md delete mode 100644 website/docs/operations/replication.md delete mode 100644 website/docs/operations/security.md delete mode 100644 website/docs/staging.mdx delete mode 100644 website/docs/troubleshooting/index.md delete mode 100644 website/docs/tutorials/knowledge-graph-rag.md delete mode 100644 website/docs/tutorials/social-network.md delete mode 100644 website/docs/udfs/flex/bitwise/and.md delete mode 100644 website/docs/udfs/flex/bitwise/index.md delete mode 100644 website/docs/udfs/flex/bitwise/not.md delete mode 100644 website/docs/udfs/flex/bitwise/or.md delete mode 100644 website/docs/udfs/flex/bitwise/shiftLeft.md delete mode 100644 website/docs/udfs/flex/bitwise/shiftRight.md delete mode 100644 website/docs/udfs/flex/bitwise/xor.md delete mode 100644 website/docs/udfs/flex/collections/frequencies.md delete mode 100644 website/docs/udfs/flex/collections/index.md delete mode 100644 website/docs/udfs/flex/collections/intersection.md delete mode 100644 website/docs/udfs/flex/collections/shuffle.md delete mode 100644 website/docs/udfs/flex/collections/union.md delete mode 100644 website/docs/udfs/flex/collections/zip.md delete mode 100644 website/docs/udfs/flex/date/format.md delete mode 100644 website/docs/udfs/flex/date/index.md delete mode 100644 website/docs/udfs/flex/date/parse.md delete mode 100644 website/docs/udfs/flex/date/toTimeZone.md delete mode 100644 website/docs/udfs/flex/date/truncate.md delete mode 100644 website/docs/udfs/flex/index.md delete mode 100644 website/docs/udfs/flex/json/fromJsonList.md delete mode 100644 website/docs/udfs/flex/json/fromJsonMap.md delete mode 100644 website/docs/udfs/flex/json/index.md delete mode 100644 website/docs/udfs/flex/json/toJson.md delete mode 100644 website/docs/udfs/flex/map/fromPairs.md delete mode 100644 website/docs/udfs/flex/map/index.md delete mode 100644 website/docs/udfs/flex/map/merge.md delete mode 100644 website/docs/udfs/flex/map/removeKey.md delete mode 100644 website/docs/udfs/flex/map/removeKeys.md delete mode 100644 website/docs/udfs/flex/map/submap.md delete mode 100644 website/docs/udfs/flex/similarity/index.md delete mode 100644 website/docs/udfs/flex/similarity/jaccard.md delete mode 100644 website/docs/udfs/flex/text/camelCase.md delete mode 100644 website/docs/udfs/flex/text/capitalize.md delete mode 100644 website/docs/udfs/flex/text/decapitalize.md delete mode 100644 website/docs/udfs/flex/text/format.md delete mode 100644 website/docs/udfs/flex/text/index.md delete mode 100644 website/docs/udfs/flex/text/indexOf.md delete mode 100644 website/docs/udfs/flex/text/indexesOf.md delete mode 100644 website/docs/udfs/flex/text/jaroWinkler.md delete mode 100644 website/docs/udfs/flex/text/join.md delete mode 100644 website/docs/udfs/flex/text/levenshtein.md delete mode 100644 website/docs/udfs/flex/text/lpad.md delete mode 100644 website/docs/udfs/flex/text/regexGroups.md delete mode 100644 website/docs/udfs/flex/text/repeat.md delete mode 100644 website/docs/udfs/flex/text/replace.md delete mode 100644 website/docs/udfs/flex/text/rpad.md delete mode 100644 website/docs/udfs/flex/text/snakeCase.md delete mode 100644 website/docs/udfs/flex/text/swapCase.md delete mode 100644 website/docs/udfs/flex/text/upperCamelCase.md delete mode 100644 website/docs/udfs/index.md diff --git a/.gitignore b/.gitignore index 464ec3d..fbc4460 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,50 @@ +# Docusaurus build artifacts +website/build/ +website/.docusaurus/ +website/docs/ +website/node_modules/ + +# Dependencies +node_modules/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +yarn.lock + +# Environment variables +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Editor files +*.swp +*.swo +*~ +.vscode/ +.idea/ + +# Spell check artifacts *.dic + +# Build outputs +/build +/dist + +# Local scripts +*.py + +# Generated outputs +output.txt +final_results.txt diff --git a/add_h1_headings.py b/add_h1_headings.py deleted file mode 100644 index e231e71..0000000 --- a/add_h1_headings.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python3 -"""Add H1 headings to all markdown files missing them.""" - -import os -import re -from pathlib import Path - -def has_h1_heading(content_after_frontmatter): - """Check if content has an H1 heading.""" - lines = content_after_frontmatter.strip().split('\n') - for line in lines[:10]: # Check first 10 lines - if line.strip().startswith('# '): - return True - return False - -def extract_title_from_frontmatter(content): - """Extract title from YAML frontmatter.""" - match = re.search(r'^---\s*\n(.*?)\n---', content, re.DOTALL | re.MULTILINE) - if match: - frontmatter = match.group(1) - title_match = re.search(r'^title:\s*(.+)$', frontmatter, re.MULTILINE) - if title_match: - title = title_match.group(1).strip() - # Remove quotes if present - title = title.strip('"').strip("'") - return title - return None - -def add_h1_heading(filepath): - """Add H1 heading to a file if it's missing.""" - with open(filepath, 'r', encoding='utf-8') as f: - content = f.read() - - # Check if file has frontmatter - if not content.startswith('---'): - return False - - # Extract title - title = extract_title_from_frontmatter(content) - if not title: - return False - - # Split at end of frontmatter - match = re.search(r'^---\s*\n.*?\n---\s*\n', content, re.DOTALL | re.MULTILINE) - if not match: - return False - - frontmatter_end = match.end() - frontmatter = content[:frontmatter_end] - after_frontmatter = content[frontmatter_end:] - - # Check if H1 already exists - if has_h1_heading(after_frontmatter): - return False - - # Add H1 heading - new_content = f"{frontmatter}\n# {title}\n{after_frontmatter}" - - with open(filepath, 'w', encoding='utf-8') as f: - f.write(new_content) - - return True - -def main(): - """Process all markdown files in website/docs.""" - docs_dir = Path('/Users/danshalev/docs-staging/website/docs') - - fixed_files = [] - - for md_file in docs_dir.rglob('*.md'): - if add_h1_heading(md_file): - rel_path = md_file.relative_to(docs_dir) - fixed_files.append(str(rel_path)) - print(f"✓ Added H1 to: {rel_path}") - - print(f"\n{'='*60}") - print(f"Fixed {len(fixed_files)} files") - print(f"{'='*60}") - -if __name__ == '__main__': - main() diff --git a/check_h1_headings.py b/check_h1_headings.py deleted file mode 100644 index d2e19ee..0000000 --- a/check_h1_headings.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -""" -Check for .md and .mdx files in website/docs that have frontmatter titles -but are missing H1 headings. -""" - -import os -import re -from pathlib import Path - -def extract_frontmatter_title(lines): - """Extract title from frontmatter if it exists.""" - if not lines or not lines[0].strip().startswith('---'): - return None - - in_frontmatter = False - title = None - - for i, line in enumerate(lines): - if i == 0 and line.strip() == '---': - in_frontmatter = True - continue - - if in_frontmatter: - if line.strip() == '---': - break - - # Check for title field - title_match = re.match(r'^title:\s*(.+)$', line.strip()) - if title_match: - title = title_match.group(1).strip() - # Remove quotes if present - title = title.strip('"').strip("'") - - return title - -def has_h1_heading(lines): - """Check if content has an H1 heading after frontmatter.""" - in_frontmatter = False - frontmatter_ended = False - - for i, line in enumerate(lines): - if i == 0 and line.strip().startswith('---'): - in_frontmatter = True - continue - - if in_frontmatter and line.strip() == '---': - in_frontmatter = False - frontmatter_ended = True - continue - - if frontmatter_ended or not in_frontmatter: - # Check for H1 heading (line starting with "# ") - if line.strip().startswith('# ') and len(line.strip()) > 2: - return True - - return False - -def check_files(docs_dir): - """Check all .md and .mdx files in docs directory.""" - missing_h1 = [] - - for root, dirs, files in os.walk(docs_dir): - for file in files: - if file.endswith(('.md', '.mdx')): - file_path = os.path.join(root, file) - rel_path = os.path.relpath(file_path, docs_dir) - - try: - with open(file_path, 'r', encoding='utf-8') as f: - lines = f.readlines() - - title = extract_frontmatter_title(lines) - - # If there's a title in frontmatter but no H1 heading - if title and not has_h1_heading(lines): - missing_h1.append({ - 'path': rel_path, - 'full_path': file_path, - 'title': title - }) - - except Exception as e: - print(f"Error reading {file_path}: {e}") - - return missing_h1 - -if __name__ == '__main__': - docs_dir = '/Users/danshalev/docs-staging/website/docs' - - if not os.path.exists(docs_dir): - print(f"Directory not found: {docs_dir}") - exit(1) - - missing_h1_files = check_files(docs_dir) - - # Sort by path - missing_h1_files.sort(key=lambda x: x['path']) - - # Focus on index and main section pages - index_files = [f for f in missing_h1_files if 'index' in f['path']] - other_main_files = [f for f in missing_h1_files if 'index' not in f['path']] - - print("=" * 80) - print("FILES MISSING H1 HEADINGS") - print("=" * 80) - print() - - if index_files: - print("INDEX PAGES:") - print("-" * 80) - for file in index_files: - print(f"File: {file['path']}") - print(f" Title: {file['title']}") - print(f" Suggested H1: # {file['title']}") - print() - - if other_main_files: - print("\nOTHER PAGES:") - print("-" * 80) - for file in other_main_files: - print(f"File: {file['path']}") - print(f" Title: {file['title']}") - print(f" Suggested H1: # {file['title']}") - print() - - print("\n" + "=" * 80) - print(f"TOTAL FILES MISSING H1: {len(missing_h1_files)}") - print(f" - Index pages: {len(index_files)}") - print(f" - Other pages: {len(other_main_files)}") - print("=" * 80) diff --git a/check_navigation_complete.py b/check_navigation_complete.py deleted file mode 100644 index 6dfcc8c..0000000 --- a/check_navigation_complete.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 -""" -Final comprehensive navigation check - verifies the site has no navigation errors -""" -import re -from pathlib import Path - -def main(): - workspace = Path('/Users/danshalev/docs-staging') - sidebars_path = workspace / 'website' / 'sidebars.ts' - docs_dir = workspace / 'website' / 'docs' - - with open(sidebars_path, 'r') as f: - content = f.read() - - # Extract all doc references (not in id: fields which are for category links) - # Match patterns like 'path/file' but not in "id: 'path/file'" context - lines = content.split('\n') - doc_refs = [] - - for i, line in enumerate(lines): - # Skip lines that are just category link definitions - if 'id:' in line and i > 0 and 'link:' in lines[i-1]: - continue - - # Match quoted doc paths - matches = re.findall(r"['\"]([a-z0-9_-]+/[a-z0-9_/-]+)['\"]", line) - for match in matches: - if not any(x in match for x in ['type', 'label', 'doc', 'category']): - doc_refs.append(match) - - # Match simple doc names at root level - simple = re.findall(r"^\s*['\"]([a-z0-9_-]+)['\"],?\s*$", line) - for s in simple: - if s not in ['doc', 'category', 'shell']: - doc_refs.append(s) - - print("=" * 80) - print("COMPLETE NAVIGATION CHECK") - print("=" * 80) - print() - - # Check each reference - missing = [] - found = [] - - for doc_id in set(doc_refs): - possible = [ - docs_dir / f"{doc_id}.md", - docs_dir / f"{doc_id}.mdx", - ] - - if any(p.exists() for p in possible): - found.append(doc_id) - else: - missing.append(doc_id) - - print(f"✅ Found {len(found)} valid document references") - - if missing: - print(f"\n❌ Missing {len(missing)} documents:") - for m in sorted(missing): - print(f" - {m}") - return 1 - - # Check build log - build_log = Path('/tmp/full-build.log') - if build_log.exists(): - with open(build_log) as f: - log = f.read() - - if 'BUILD STATUS: SUCCESS' in log or 'Generated static files' in log: - print("\n✅ Build completed successfully") - else: - print("\n❌ Build did not complete successfully") - return 1 - - # Check for critical errors only - if re.search(r'Error:|ERROR:|Module not found|Cannot find', log, re.IGNORECASE): - print("❌ Critical errors found in build") - return 1 - else: - print("✅ No critical errors in build") - - print("\n" + "=" * 80) - print("✅ ✅ ✅ ALL NAVIGATION CHECKS PASSED ✅ ✅ ✅") - print("=" * 80) - print("\nSummary:") - print(f" • {len(found)} pages correctly referenced in sidebar") - print(f" • 0 missing page references") - print(f" • Build completes successfully") - print(f" • No critical errors") - print("\nThe only warnings are broken anchor links (internal sections),") - print("which are minor content issues, not navigation problems.") - return 0 - -if __name__ == '__main__': - exit(main()) diff --git a/comprehensive_nav_check.py b/comprehensive_nav_check.py deleted file mode 100644 index eb4b40c..0000000 --- a/comprehensive_nav_check.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python3 -""" -Comprehensive navigation check - verifies: -1. All pages in sidebars.ts exist -2. No duplicate entries -3. All markdown files are accessible -4. Build succeeds -""" -import re -from pathlib import Path -from collections import Counter - -def extract_all_doc_references(sidebars_content): - """Extract all doc ID references including nested ones""" - doc_ids = [] - - # Pattern for doc IDs in various contexts - patterns = [ - r"id:\s*['\"]([^'\"]+)['\"]", # id: 'doc-id' - r"['\"]([a-zA-Z0-9/_-]+/[a-zA-Z0-9/_-]+)['\"]", # 'path/to/doc' - ] - - for pattern in patterns: - matches = re.findall(pattern, sidebars_content) - doc_ids.extend(matches) - - # Also catch standalone doc references (single words with /) - standalone = re.findall(r"^\s*['\"]([a-z-]+/[a-z-]+(?:/[a-z-]+)*)['\"],?\s*$", - sidebars_content, re.MULTILINE) - doc_ids.extend(standalone) - - return doc_ids - -def main(): - workspace = Path('/Users/danshalev/docs-staging') - sidebars_path = workspace / 'website' / 'sidebars.ts' - docs_dir = workspace / 'website' / 'docs' - - print("=" * 80) - print(" " * 20 + "COMPREHENSIVE NAVIGATION CHECK") - print("=" * 80) - print() - - # Read sidebars - with open(sidebars_path, 'r') as f: - sidebars_content = f.read() - - # Extract all doc references - print("📋 Step 1: Extracting all doc references from sidebars.ts") - doc_ids = extract_all_doc_references(sidebars_content) - print(f" Found {len(doc_ids)} total references") - - # Check for duplicates - print() - print("🔍 Step 2: Checking for duplicate entries") - counts = Counter(doc_ids) - duplicates = {doc: count for doc, count in counts.items() if count > 1} - - if duplicates: - print(f" ❌ Found {len(duplicates)} duplicate entries:") - for doc, count in duplicates.items(): - print(f" - {doc} (appears {count} times)") - else: - print(" ✅ No duplicates found!") - - # Check if files exist - print() - print("🔍 Step 3: Verifying all referenced files exist") - unique_docs = set(doc_ids) - missing = [] - found = [] - - for doc_id in unique_docs: - possible_paths = [ - docs_dir / f"{doc_id}.md", - docs_dir / f"{doc_id}.mdx", - ] - - if any(p.exists() for p in possible_paths): - found.append(doc_id) - else: - missing.append(doc_id) - - if missing: - print(f" ❌ Missing {len(missing)} files:") - for doc in sorted(missing): - print(f" - {doc}") - else: - print(f" ✅ All {len(found)} referenced files exist!") - - # Check all markdown files - print() - print("🔍 Step 4: Finding all markdown files in docs/") - all_md_files = set() - for ext in ['*.md', '*.mdx']: - for file in docs_dir.rglob(ext): - rel_path = file.relative_to(docs_dir) - doc_id = str(rel_path.with_suffix('')) - all_md_files.add(doc_id) - - print(f" Found {len(all_md_files)} markdown files") - - # Check which files aren't in sidebar - not_in_sidebar = all_md_files - unique_docs - if not_in_sidebar: - print(f" ⚠️ {len(not_in_sidebar)} files not referenced in sidebar:") - for doc in sorted(not_in_sidebar): - print(f" - {doc}") - else: - print(" ✅ All markdown files are in the sidebar!") - - # Final summary - print() - print("=" * 80) - print(" " * 30 + "FINAL REPORT") - print("=" * 80) - print(f"📊 Sidebar references: {len(doc_ids)} total, {len(unique_docs)} unique") - print(f"📄 Markdown files in docs/: {len(all_md_files)}") - print(f"✅ Files correctly referenced: {len(found)}") - print(f"❌ Missing files: {len(missing)}") - print(f"🔄 Duplicate references: {len(duplicates)}") - print(f"⚠️ Unreferenced files: {len(not_in_sidebar)}") - print() - - # Overall status - if missing or duplicates: - print("🚨 CRITICAL ISSUES FOUND - Navigation has errors!") - print() - if missing: - print(" Fix missing files by either:") - print(" 1. Creating the missing files") - print(" 2. Removing the references from sidebars.ts") - if duplicates: - print(" Fix duplicates by removing redundant entries from sidebars.ts") - return 1 - elif not_in_sidebar: - print("⚠️ WARNING - Some files exist but aren't in navigation") - print(" These files won't be accessible to users unless added to sidebars.ts") - return 0 - else: - print("✅ ✅ ✅ PERFECT! All navigation verified successfully! ✅ ✅ ✅") - print() - print(" • All referenced files exist") - print(" • No duplicate entries") - print(" • All markdown files are in sidebar") - return 0 - -if __name__ == '__main__': - exit(main()) diff --git a/final_results.txt b/final_results.txt deleted file mode 100644 index 91719a2..0000000 --- a/final_results.txt +++ /dev/null @@ -1,504 +0,0 @@ -Found 125 files with duplicate H1 headings (frontmatter title + markdown H1): - -``` -File: website/docs/References.md -Line: 9 -Heading: # References - -File: website/docs/agentic-memory/cognee.md -Line: 9 -Heading: # Cognee - -File: website/docs/agentic-memory/graphiti.md -Line: 9 -Heading: # Graphiti - -File: website/docs/agentic-memory/index.md -Line: 9 -Heading: # Agentic Memory - -File: website/docs/algorithms/betweenness-centrality.md -Line: 8 -Heading: # Betweenness Centrality - -File: website/docs/algorithms/bfs.md -Line: 8 -Heading: # BFS - -File: website/docs/algorithms/cdlp.md -Line: 8 -Heading: # Community Detection using Label Propagation (CDLP) - -File: website/docs/algorithms/index.md -Line: 9 -Heading: # FalkorDB Algorithms Overview - -File: website/docs/algorithms/msf.md -Line: 9 -Heading: # Minimum Spanning Forest (MSF) - -File: website/docs/algorithms/pagerank.md -Line: 8 -Heading: # PageRank - -File: website/docs/algorithms/sppath.md -Line: 8 -Heading: # `algo.SPpaths` - Shortest Path (Single Pair) - -File: website/docs/algorithms/sspath.md -Line: 8 -Heading: # `algo.SSpaths` - Single Source Paths - -File: website/docs/algorithms/wcc.md -Line: 8 -Heading: # Weakly Connected Components (WCC) - -File: website/docs/cloud/features.md -Line: 9 -Heading: # Features - -File: website/docs/cloud/index.md -Line: 11 -Heading: # FalkorDB Cloud DBaaS - -File: website/docs/commands/acl.md -Line: 9 -Heading: # ACL - -File: website/docs/commands/graph.info.md -Line: 8 -Heading: # GRAPH.INFO - -File: website/docs/commands/index.md -Line: 9 -Heading: # Commands - -File: website/docs/cypher/call.md -Line: 9 -Heading: # CALL \{\} - -File: website/docs/cypher/create.md -Line: 9 -Heading: # CREATE - -File: website/docs/cypher/cypher-support.md -Line: 9 -Heading: # Cypher coverage - -File: website/docs/cypher/delete.md -Line: 9 -Heading: # DELETE - -File: website/docs/cypher/foreach.md -Line: 9 -Heading: # FOREACH - -File: website/docs/cypher/functions.md -Line: 9 -Heading: # Functions - -File: website/docs/cypher/indexing/index.md -Line: 9 -Heading: # Indexing - -File: website/docs/cypher/known-limitations.md -Line: 9 -Heading: # Known limitations - -File: website/docs/cypher/limit.md -Line: 9 -Heading: # LIMIT - -File: website/docs/cypher/load-csv.md -Line: 9 -Heading: # LOAD CSV - -File: website/docs/cypher/match.md -Line: 9 -Heading: # MATCH - -File: website/docs/cypher/merge.md -Line: 9 -Heading: # MERGE - -File: website/docs/cypher/optional-match.md -Line: 9 -Heading: # OPTIONAL MATCH - -File: website/docs/cypher/order-by.md -Line: 9 -Heading: # ORDER BY - -File: website/docs/cypher/procedures.md -Line: 9 -Heading: # Procedures - -File: website/docs/cypher/remove.md -Line: 9 -Heading: # REMOVE - -File: website/docs/cypher/return.md -Line: 9 -Heading: # RETURN - -File: website/docs/cypher/set.md -Line: 9 -Heading: # SET - -File: website/docs/cypher/skip.md -Line: 9 -Heading: # SKIP - -File: website/docs/cypher/union.md -Line: 9 -Heading: # UNION - -File: website/docs/cypher/unwind.md -Line: 9 -Heading: # UNWIND - -File: website/docs/cypher/where.md -Line: 9 -Heading: # WHERE - -File: website/docs/cypher/with.md -Line: 9 -Heading: # WITH - -File: website/docs/design/client-spec.md -Line: 8 -Heading: # Client Specification - -File: website/docs/design/index.md -Line: 9 -Heading: # The FalkorDB Design - -File: website/docs/design/result-structure.md -Line: 8 -Heading: # Result Set Structure - -File: website/docs/design/third-party.md -Line: 8 -Heading: # Third-Party Components in FalkorDB - -File: website/docs/genai-tools/ag2.md -Line: 9 -Heading: # AG2 - -File: website/docs/genai-tools/graphrag-sdk.md -Line: 9 -Heading: # GraphRAG-SDK - -File: website/docs/genai-tools/graphrag-toolkit.md -Line: 9 -Heading: # GraphRAG Toolkit - -File: website/docs/genai-tools/index.md -Line: 9 -Heading: # GenAI Tools - -File: website/docs/genai-tools/langchain.md -Line: 9 -Heading: # LangChain - -File: website/docs/genai-tools/langgraph.md -Line: 9 -Heading: # LangGraph - -File: website/docs/genai-tools/llamaindex.md -Line: 9 -Heading: # LlamaIndex - -File: website/docs/getting-started/configuration.md -Line: 9 -Heading: # Configuration - -File: website/docs/index.mdx -Line: 19 -Heading: # FalkorDB - -File: website/docs/integration/bolt-support.md -Line: 9 -Heading: # [EXPERIMENTAL] BOLT protocol support for FalkorDB - -File: website/docs/integration/index.md -Line: 9 -Heading: # Integration - -File: website/docs/integration/jena.md -Line: 9 -Heading: # Apache Jena Integration - -File: website/docs/integration/kafka-connect.md -Line: 9 -Heading: # Kafka Connect Sink - -File: website/docs/integration/rest.md -Line: 9 -Heading: # FalkorDB Browser REST API - -File: website/docs/integration/spring-data-falkordb.md -Line: 9 -Heading: # Spring Data FalkorDB - -File: website/docs/license.md -Line: 9 -Heading: # FalkorDB License - -File: website/docs/operations/cluster.md -Line: 9 -Heading: # Setting Up a FalkorDB Cluster - -File: website/docs/operations/docker.md -Line: 9 -Heading: # Running FalkorDB with Docker and Docker Compose - -File: website/docs/operations/falkordblite.md -Line: 9 -Heading: # FalkorDBLite - -File: website/docs/operations/index.md -Line: 9 -Heading: # Operations - -File: website/docs/operations/k8s-support.md -Line: 9 -Heading: # Kubernetes support for FalkorDB - -File: website/docs/operations/kubeblocks.md -Line: 9 -Heading: # Deploy FalkorDB with KubeBlocks - -File: website/docs/operations/lightning-ai.md -Line: 9 -Heading: # Deploy FalkorDB on Lightning.AI - -File: website/docs/operations/migration/index.md -Line: 9 -Heading: # Migration - -File: website/docs/operations/migration/kuzu-to-falkordb.md -Line: 8 -Heading: # Kuzu to FalkorDB Migration - -File: website/docs/operations/migration/neo4j-to-falkordb.md -Line: 8 -Heading: # Neo4j to FalkorDB Migration - -File: website/docs/operations/migration/rdf-to-falkordb.md -Line: 8 -Heading: # RDF to FalkorDB Migration - -File: website/docs/operations/migration/redisgraph-to-falkordb.md -Line: 8 -Heading: # RedisGraph to FalkorDB Migration - -File: website/docs/operations/persistence.md -Line: 9 -Heading: # Configuring FalkorDB Docker for Persistence - -File: website/docs/operations/replication.md -Line: 9 -Heading: # Configuring FalkorDB Docker for Replication - -File: website/docs/udfs/flex/bitwise/and.md -Line: 7 -Heading: # bitwise.and - -File: website/docs/udfs/flex/bitwise/index.md -Line: 8 -Heading: # Bitwise Functions - -File: website/docs/udfs/flex/bitwise/not.md -Line: 7 -Heading: # bitwise.not - -File: website/docs/udfs/flex/bitwise/or.md -Line: 7 -Heading: # bitwise.or - -File: website/docs/udfs/flex/bitwise/shiftLeft.md -Line: 7 -Heading: # bitwise.shiftLeft - -File: website/docs/udfs/flex/bitwise/shiftRight.md -Line: 7 -Heading: # bitwise.shiftRight - -File: website/docs/udfs/flex/bitwise/xor.md -Line: 7 -Heading: # bitwise.xor - -File: website/docs/udfs/flex/collections/frequencies.md -Line: 7 -Heading: # coll.frequencies - -File: website/docs/udfs/flex/collections/index.md -Line: 8 -Heading: # Collection Functions - -File: website/docs/udfs/flex/collections/intersection.md -Line: 7 -Heading: # coll.intersection - -File: website/docs/udfs/flex/collections/shuffle.md -Line: 7 -Heading: # coll.shuffle - -File: website/docs/udfs/flex/collections/union.md -Line: 7 -Heading: # coll.union - -File: website/docs/udfs/flex/collections/zip.md -Line: 7 -Heading: # coll.zip - -File: website/docs/udfs/flex/date/format.md -Line: 7 -Heading: # date.format - -File: website/docs/udfs/flex/date/index.md -Line: 8 -Heading: # Date Functions - -File: website/docs/udfs/flex/date/parse.md -Line: 7 -Heading: # date.parse - -File: website/docs/udfs/flex/date/toTimeZone.md -Line: 7 -Heading: # date.toTimeZone - -File: website/docs/udfs/flex/date/truncate.md -Line: 7 -Heading: # date.truncate - -File: website/docs/udfs/flex/index.md -Line: 7 -Heading: # FLEX Function Reference - -File: website/docs/udfs/flex/json/fromJsonList.md -Line: 7 -Heading: # json.fromJsonList - -File: website/docs/udfs/flex/json/fromJsonMap.md -Line: 7 -Heading: # json.fromJsonMap - -File: website/docs/udfs/flex/json/index.md -Line: 8 -Heading: # JSON Functions - -File: website/docs/udfs/flex/json/toJson.md -Line: 7 -Heading: # json.toJson - -File: website/docs/udfs/flex/map/fromPairs.md -Line: 7 -Heading: # map.fromPairs - -File: website/docs/udfs/flex/map/index.md -Line: 8 -Heading: # Map Functions - -File: website/docs/udfs/flex/map/merge.md -Line: 7 -Heading: # map.merge - -File: website/docs/udfs/flex/map/removeKey.md -Line: 7 -Heading: # map.removeKey - -File: website/docs/udfs/flex/map/removeKeys.md -Line: 7 -Heading: # map.removeKeys - -File: website/docs/udfs/flex/map/submap.md -Line: 7 -Heading: # map.submap - -File: website/docs/udfs/flex/similarity/index.md -Line: 8 -Heading: # Similarity Functions - -File: website/docs/udfs/flex/similarity/jaccard.md -Line: 7 -Heading: # sim.jaccard - -File: website/docs/udfs/flex/text/camelCase.md -Line: 7 -Heading: # text.camelCase - -File: website/docs/udfs/flex/text/capitalize.md -Line: 7 -Heading: # text.capitalize - -File: website/docs/udfs/flex/text/decapitalize.md -Line: 7 -Heading: # text.decapitalize - -File: website/docs/udfs/flex/text/format.md -Line: 7 -Heading: # text.format - -File: website/docs/udfs/flex/text/index.md -Line: 8 -Heading: # Text Functions - -File: website/docs/udfs/flex/text/indexOf.md -Line: 7 -Heading: # text.indexOf - -File: website/docs/udfs/flex/text/indexesOf.md -Line: 7 -Heading: # text.indexesOf - -File: website/docs/udfs/flex/text/jaroWinkler.md -Line: 7 -Heading: # text.jaroWinkler - -File: website/docs/udfs/flex/text/join.md -Line: 7 -Heading: # text.join - -File: website/docs/udfs/flex/text/levenshtein.md -Line: 7 -Heading: # text.levenshtein - -File: website/docs/udfs/flex/text/lpad.md -Line: 7 -Heading: # text.lpad - -File: website/docs/udfs/flex/text/regexGroups.md -Line: 7 -Heading: # text.regexGroups - -File: website/docs/udfs/flex/text/repeat.md -Line: 7 -Heading: # text.repeat - -File: website/docs/udfs/flex/text/replace.md -Line: 7 -Heading: # text.replace - -File: website/docs/udfs/flex/text/rpad.md -Line: 7 -Heading: # text.rpad - -File: website/docs/udfs/flex/text/snakeCase.md -Line: 7 -Heading: # text.snakeCase - -File: website/docs/udfs/flex/text/swapCase.md -Line: 7 -Heading: # text.swapCase - -File: website/docs/udfs/flex/text/upperCamelCase.md -Line: 7 -Heading: # text.upperCamelCase - -File: website/docs/udfs/index.md -Line: 8 -Heading: # UDFs - -``` diff --git a/find_duplicate_h1s.py b/find_duplicate_h1s.py deleted file mode 100644 index 468e02e..0000000 --- a/find_duplicate_h1s.py +++ /dev/null @@ -1,71 +0,0 @@ -import os -import re -from pathlib import Path - -def extract_frontmatter_title(content): - """Extract title from frontmatter""" - frontmatter_match = re.match(r'^---\s*\n(.*?)\n---', content, re.DOTALL) - if frontmatter_match: - frontmatter = frontmatter_match.group(1) - title_match = re.search(r'^title:\s*(.+)$', frontmatter, re.MULTILINE) - if title_match: - return title_match.group(1).strip() - return None - -def find_h1_headings(content): - """Find all H1 headings (# ) and their line numbers""" - lines = content.split('\n') - h1_headings = [] - for i, line in enumerate(lines, 1): - # Match H1 headings but not comments in code blocks - if re.match(r'^# [^#]', line): - h1_headings.append((i, line.strip())) - return h1_headings - -def normalize_text(text): - """Normalize text for comparison""" - return re.sub(r'[^a-z0-9]', '', text.lower()) - -docs_dir = Path('website/docs') -results = [] - -# Process both .md and .mdx files -for pattern in ['*.md', '*.mdx']: - for md_file in docs_dir.rglob(pattern): - try: - with open(md_file, 'r', encoding='utf-8') as f: - content = f.read() - - frontmatter_title = extract_frontmatter_title(content) - h1_headings = find_h1_headings(content) - - if frontmatter_title and h1_headings: - normalized_title = normalize_text(frontmatter_title) - for line_num, h1_text in h1_headings: - h1_content = h1_text[2:].strip() # Remove "# " - normalized_h1 = normalize_text(h1_content) - - # Check for exact match or very similar match - if normalized_h1 == normalized_title or normalized_title in normalized_h1 or normalized_h1 in normalized_title: - relative_path = md_file.relative_to(Path('website/docs')) - results.append({ - 'file': str(relative_path), - 'line': line_num, - 'h1': h1_text, - 'frontmatter_title': frontmatter_title - }) - break - except Exception as e: - print(f"Error processing {md_file}: {e}") - -# Sort results by file path -results.sort(key=lambda x: x['file']) - -print(f"Found {len(results)} files with duplicate H1 headings:\n") -print("="*80) -for result in results: - print(f"\nFile: {result['file']}") - print(f"Line: {result['line']}") - print(f"Heading: {result['h1']}") - print(f"Frontmatter Title: {result['frontmatter_title']}") - print("-"*80) diff --git a/fix_all_h1s.py b/fix_all_h1s.py deleted file mode 100644 index bc255b4..0000000 --- a/fix_all_h1s.py +++ /dev/null @@ -1,76 +0,0 @@ -import os -import re -from pathlib import Path - -def extract_frontmatter_title(content): - """Extract title from frontmatter""" - frontmatter_match = re.match(r'^---\s*\n(.*?)\n---', content, re.DOTALL) - if frontmatter_match: - frontmatter = frontmatter_match.group(1) - title_match = re.search(r'^title:\s*(.+)$', frontmatter, re.MULTILINE) - if title_match: - return title_match.group(1).strip() - return None - -def find_first_h1_heading(content): - """Find the first H1 heading and its position""" - lines = content.split('\n') - for i, line in enumerate(lines): - # Match H1 headings but not comments in code blocks - if re.match(r'^# [^#]', line): - return i, line - return None, None - -def normalize_text(text): - """Normalize text for comparison""" - return re.sub(r'[^a-z0-9]', '', text.lower()) - -def remove_duplicate_h1(file_path): - """Remove duplicate H1 heading from a file""" - try: - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - - frontmatter_title = extract_frontmatter_title(content) - h1_line_num, h1_text = find_first_h1_heading(content) - - if not frontmatter_title or h1_line_num is None: - return False - - h1_content = h1_text[2:].strip() # Remove "# " - normalized_title = normalize_text(frontmatter_title) - normalized_h1 = normalize_text(h1_content) - - # Check if they match - if normalized_h1 == normalized_title or normalized_title in normalized_h1 or normalized_h1 in normalized_title: - lines = content.split('\n') - - # Remove the H1 line - del lines[h1_line_num] - - # If the next line is empty, remove it too to avoid extra spacing - if h1_line_num < len(lines) and lines[h1_line_num].strip() == '': - del lines[h1_line_num] - - # Write back - new_content = '\n'.join(lines) - with open(file_path, 'w', encoding='utf-8') as f: - f.write(new_content) - - return True - except Exception as e: - print(f"Error processing {file_path}: {e}") - return False - -docs_dir = Path('website/docs') -fixed_count = 0 - -# Process both .md and .mdx files -for pattern in ['*.md', '*.mdx']: - for md_file in docs_dir.rglob(pattern): - if remove_duplicate_h1(md_file): - fixed_count += 1 - print(f"Fixed: {md_file.relative_to(docs_dir)}") - -print(f"\n{'='*80}") -print(f"Fixed {fixed_count} files!") diff --git a/fix_angle_brackets.py b/fix_angle_brackets.py deleted file mode 100644 index 457e71a..0000000 --- a/fix_angle_brackets.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python3 -""" -Fix < > characters in markdown that should be escaped -""" -import re -from pathlib import Path - -DOCS_DIR = Path("/Users/danshalev/docs-staging/website/docs") - -def fix_angle_brackets(file_path): - """Fix unescaped angle brackets in markdown""" - with open(file_path, 'r', encoding='utf-8') as f: - content = f.read() - - original = content - - # Pattern to find < > that are not: - # - Part of HTML/JSX tags (
,
, , etc.) - # - In code blocks - # - Already escaped - - # Split by code blocks to avoid modifying code - parts = re.split(r'(```[\s\S]*?```|`[^`]+`)', content) - - fixed_parts = [] - for i, part in enumerate(parts): - # Skip code blocks (odd indices) - if i % 2 == 1: - fixed_parts.append(part) - continue - - # Fix angle brackets that look like placeholders (not real HTML tags) - # Match patterns like: , ,