-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add new template for running yii2-apidoc on a user-submitted project #151
base: master
Are you sure you want to change the base?
Conversation
jcherniak
commented
Oct 29, 2017
Q | A |
---|---|
Is bugfix? | no |
New feature? | yes |
Breaks BC? | no |
Tests pass? | yes |
Fixed issues | #131 |
… and instructions for use
It works for me! |
/** | ||
* @var string URL for the README to use for the index of the guide. | ||
*/ | ||
public $readmeUrl = "https://raw.github.com/yiisoft/yii2-framework/master/README.md"; |
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.
Why URL instead of local file path?
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.
That URL was hard-coded in the bootstrap template which I copied. For it to work without changing the command line params, it has to match the value that was in the previous template.
$appTypes = $this->filterTypes($types, 'app'); | ||
|
||
// It's a hack, but we'll go with it for now. | ||
$readme = @file_get_contents($this->readmeUrl); |
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.
Silencing errors isn't good.
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 suppose I could throw an exception here. Would that be preferred?
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.
Just for the record, Bootstrap template silences errors, too:
$readme = @file_get_contents("https://raw.github.com/yiisoft/yii2-framework/master/README.md"); |
It works good, but IMHO it isn't a perfect solution. The navigation sidebar never displays |
@ricpelo - Do you want yii namespaces in a custom project? I'd think not as it would make the sidebar be very crowded. I used this to generate docs for Craft CMS 3, which already has a ton of namespaces and classes. I'd think you wouldn't want the yii classes there. |
@jcherniak - First of all, thank you for your code! It works for me, as I said before. Maybe you're right: I only tested with a-few-classes project but with tons of classes could be overkill to have both |
Hi! Will this PR be merged for 2.0.7 release (or maybe before :))? Thanks! |
Any chance this can be merged? |
Yes, please. I've used it for months and it works great, IMO. |
We need @cebe here. |
Any chance this can be merged now? Looks like @cebe made a few changes, so it would be nice to get this into core. |
@cebe @samdark @arogachev is this PR going to be merged or should it be closed? |
@mtangoo I'd get this one in. Would be great if you'll test it with custom project. |
I will find time and test it. Wanted to be sure there's desire to merge it in |