-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Hoping to understand the intent of the guard here:
mkdocs-monorepo-plugin/mkdocs_monorepo_plugin/parser.py
Lines 175 to 180 in 02fbd09
| if not self.absNavPath.startswith(self.rootDir): | |
| log.critical( | |
| "[mkdocs-monorepo] The mkdocs file {} is outside of the current directory. ".format(self.absNavPath) + | |
| "Please move the file and try again." | |
| ) | |
| raise SystemExit(1) |
A repository structure I have worked with recently made this guard prohibitive to achieve what seemed like a reasonable organization strategy:
.
├── docs-site
│ └── mkdocs.yml # Root Project
│ # Contents:
│ # package-a: !include ../package-a/mkdocs.yml
│ # package-b: !include ../package-b/mkdocs.yml
├── package-a
│ ├── docs
│ │ └── index.md
│ └── mkdocs.yml # Package A Documentation (Included by Root)
└── package-b
├── docs
│ └── index.md
└── mkdocs.yml # Package B Documentation (Included by Root)
By allowing upward traversal, self references might occur. If this guard is intended to protect against self references, could we consider a guard that specifically protects against self references but allows for upward and lateral traversal of the file system?
I was able to run a simple test to validate that the proper site is built when building the site with that guard removed. I have not validated what occurs in a situation where a self reference is attempted to be modeled.