-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
[FEATURE] Make index file configurable #1116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some issues to follow the code in the parseDirectoryHandler. It looks like we can simplify it when we would use the settings manager, and skip the inline defaults? I think it would make sense to define a default in the settings manager. And remove the hardcoded defaults.
Please keep in mind that adding a parameter to any class constructor should be seen as a backward compatibility break. So we might need to make them default to null
when possible. And apply a fallback. Which would be in this case the inline defaults. 'index,Index'
Given the fact that the inline defaults may contain multiple filenames. index
and Index
I think we should allow the users to specify multiple as well?
@@ -98,14 +101,23 @@ private function getDirectoryIndexFile( | |||
$hashedContentFromFilesystem[$itemFromFilesystem['basename']] = true; | |||
} | |||
|
|||
foreach (self::INDEX_FILE_NAMES as $indexName) { | |||
if ($indexName !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the user configured an indexName
we can enforce the index to exist like this. So I would expect a throw in this if block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really get what you are suggesting?
Is adding an additional constructor to a final class that is used by DI really breaking? |
The index file will also be used in automatic menu building. As oposed to setting "input-file" not only the one file mentioned will be rendererd but all files from the directory. However the name of the input file can be changed. Some markdown projects like to change the name of the index file. For example powermail is using Readme.md as index file in every directory: https://github.com/in2code-de/powermail/tree/master/Documentation References #1108
@jaapio, tried to apply the changes as far as I understood them. Please have another look |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
[1.x] Merge pull request #1116 from phpDocumentor/task/menu
The index file will also be used in automatic menu building.
As oposed to setting "input-file" not only the one file mentioned will be rendererd but all files from the directory. However the name of the input file can be changed.
Some markdown projects like to change the name of the index file. For example powermail is using Readme.md as index file in every directory:
https://github.com/in2code-de/powermail/tree/master/Documentation
References #1108