-
-
Notifications
You must be signed in to change notification settings - Fork 634
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
WIP add example tag implementation #1145
Conversation
Hi @siad007, This looks very promising! I like how you have properly used the Assembler and Descriptors. Have you looked at http://www.phpdoc.org/docs/latest/references/phpdoc/tags/example.html to see where the tag looks for the example file? I can see that you code only looks in the provided Also: I see duplication between the XML writer and the Twig writer. Perhaps you can solve that by introducing a Compiler pass that inserts the example file's contents into the ExampleDescriptor. That way neither writer needs to know about this business logic and it is really encapsulated into phpDocumentor; what do you think? |
$exampleFromConfg = rtrim($this->exampleDir, '\\/') .DIRECTORY_SEPARATOR . $filename; | ||
$source = sprintf('%s%s%s%s%s', getcwd(), DIRECTORY_SEPARATOR, trim($this->sourceDir, '\\/'), DIRECTORY_SEPARATOR, trim($filename, '"')); | ||
|
||
$file = @file($exampleFromConfg) ?: @file($source) ?: @file($example) ?: @file($filename); |
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.
Please do not use nested ternaries; those can be confusing
Awesome stuff! |
This PR is superceded by #1209; so I am closing this |
@mvriel i just made a rough thought about an implementation of the example tag. i did not notice your heavy changes inside the xml writer so i will make some changes there. in the meantime you could give me a hint if this solution would be helpful and if which changes you see there ad hoc? greetings siad