This issue has originally been reported by @schmunk42 at yiisoft/yii2#3547.
Moved here by @cebe.
As you can specify different sourceDirs when rendering a guide, apidoc should also be able to correctly link to different files, even if they have the same source name.
Eg, if you specify two directories and both contain a README.md file you'll see both files in the index in the left sidebar, but you can access only one of them, since they have the same filename when rendered.
I played around with something like this:
protected function generateGuideFileName($file)
{
$uniqueFileName = static::GUIDE_PREFIX . substr(sha1($file),0,6) . '-' . basename($file, '.md');
return $uniqueFileName . '.html';
}
But it needs to be handled in more places, like generateGuideUrl.
What do you think about the approach adding a hash to the filename, any other ideas?
This issue has originally been reported by @schmunk42 at yiisoft/yii2#3547.
Moved here by @cebe.
As you can specify different
sourceDirswhen rendering a guide, apidoc should also be able to correctly link to different files, even if they have the same source name.Eg, if you specify two directories and both contain a
README.mdfile you'll see both files in the index in the left sidebar, but you can access only one of them, since they have the same filename when rendered.I played around with something like this:
But it needs to be handled in more places, like
generateGuideUrl.What do you think about the approach adding a hash to the filename, any other ideas?