You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: audit-cli/README.md
+141-5Lines changed: 141 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,8 +63,9 @@ audit-cli
63
63
│ └── usage
64
64
├── compare # Compare files across versions
65
65
│ └── file-contents
66
-
└── count # Count code examples
67
-
└── tested-examples
66
+
└── count # Count code examples and documentation pages
67
+
├── tested-examples
68
+
└── pages
68
69
```
69
70
70
71
### Extract Commands
@@ -731,6 +732,135 @@ This command helps writers and maintainers:
731
732
732
733
By default, prints a single integer (total count) for use in CI or scripting. With `--count-by-product`, displays a formatted table with product names and counts.
733
734
735
+
#### `count pages`
736
+
737
+
Count documentation pages (.txt files) in the MongoDB documentation monorepo.
738
+
739
+
This command navigates to the `content` directory and recursively counts all `.txt` files, which represent documentation pages that resolve to unique URLs. The command automatically excludes certain directories and file types that don't represent actual documentation pages.
740
+
741
+
**Use Cases:**
742
+
743
+
This command helps writers and maintainers:
744
+
- Track the total number of documentation pages across the monorepo
745
+
- Monitor documentation coverage by product/project
746
+
- Identify projects with extensive or minimal documentation
747
+
- Exclude auto-generated or deprecated content from counts
748
+
- Count only current versions of versioned documentation
749
+
- Compare page counts across different documentation versions
750
+
751
+
**Automatic Exclusions:**
752
+
753
+
The command automatically excludes:
754
+
- Files in `code-examples` directories at the root of `content` or `source` (these contain plain text examples, not pages)
755
+
- Files in the following directories at the root of `content`:
756
+
-`404` - Error pages
757
+
-`meta` - MongoDB Meta Documentation - style guide, tools, etc.
758
+
-`table-of-contents` - Navigation files
759
+
- All non-`.txt` files (configuration files, YAML, etc.)
-`--for-project <project>` - Only count pages for a specific project (directory name under `content/`)
789
+
-`--count-by-project` - Display counts for each project in a formatted table
790
+
-`--exclude-dirs <dirs>` - Comma-separated list of directory names to exclude from counting (e.g., `deprecated,archive`)
791
+
-`--current-only` - Only count pages in the current version (for versioned projects, counts only `current` or `manual` version directories; for non-versioned projects, counts all pages)
792
+
-`--by-version` - Display counts grouped by project and version (shows version breakdown for versioned projects; non-versioned projects show as "(no version)")
793
+
794
+
**Output:**
795
+
796
+
By default, prints a single integer (total count) for use in CI or scripting. With `--count-by-project`, displays a formatted table with project names and counts. With `--by-version`, displays a hierarchical breakdown by project and version.
797
+
798
+
**Versioned Documentation:**
799
+
800
+
Some MongoDB documentation projects contain multiple versions, represented as distinct directories between the project directory and the `source` directory:
-`current` or `manual` - The current/latest version
806
+
-`upcoming` - Pre-release version
807
+
-`v{number}` - Specific version (e.g., `v8.0`, `v7.0`)
808
+
809
+
The `--current-only` flag counts only files in the current version directory (`current` or `manual`) for versioned projects, while counting all files for non-versioned projects.
810
+
811
+
The `--by-version` flag shows a breakdown of page counts for each version within each project.
812
+
813
+
**Note:** The `--current-only` and `--by-version` flags are mutually exclusive.
0 commit comments