Is there a utility that maps the include:: "genealogy" of a given file
My team and I use asciidoc includes to transclude content files into multiple assemblies, chapters, and/or guides.
Currently, we use a comment in the content file to manually record the "parent" files (called an assembly file) that include the content file as well as the names of the top level guides in which it appears (e.g., Getting Started Guide, Administration Guide).
Unfortunately, we sometimes forget to update this information.
Does anyone know of a utility or script (in bash, python, or any other language) that maps the genealogy of a "child" file on up through its "parents" (files that contain include::childname) up to the top level?
In my imagination, this utility:
- uses a project folder as the starting point (docs-Red_Hat_Enterprise_Virtualization)
- takes a filepath and filename as an argument
- greps the project folder for that filename
- identifies the parent/ancestor files
- excludes false parents (i.e., excludes parents of files in different directory that have the identical filename)
- outputs the ancestry to a human-readable file.