-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow disabling footer date with includeDate template config (#910) #916
Conversation
@@ -29,7 +29,7 @@ | |||
<br class="clear"> | |||
|
|||
<footer> | |||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a> on <?js= (new Date()) ?> | |||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc<?js if(env.conf.templates.includeDate == undefined || env.conf.templates.includeDate) { ?><?js= env.version.number ?></a> on <?js= (new Date()) ?><?js } ?> |
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.
- This code should be looking for the property
env.conf.templates.default.includeDate
, because this option is specific to thedefault
template. - For safety, check for
env.conf.templates
andenv.conf.templates.default
first. - Please check whether the property
!== false
, rather than for== undefined
or truthy. - If you want to remove the JSDoc version number as well, please use a separate
includeVersion
property to control that behavior. (And please make sure the</a>
tag shows up when this property is set tofalse
. In your current patch, settingincludeDate
tofalse
causes the</a>
tag to be omitted.)
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.
This code should be looking for the property
env.conf.templates.default.includeDate
, because this option is specific to the default template.
Indeed. I missed the default object you explained on the issue.
For safety, check for
env.conf.templates
andenv.conf.templates.default
first.
Included.
Please check whether the property
!== false
, rather than for== undefined
or truthy.
Fixed, checking for false simplifies the condition.
If you want to remove the JSDoc version number as well, please use a separate includeVersion property to control that behavior. (And please make sure the tag shows up when this property is set to false. In your current patch, setting includeDate to false causes the tag to be omitted.)
My bad. I shouldn't be removing the version as well. Fixed.
Allow disabling footer date with includeDate template config (#910)
Merged to master. I'll also merge the change to the 3.3.0 branch. Thanks for fixing those issues and squashing the commits! |
@hegemonic Thanks, you're welcome, happy to have this issue fixed! |
This was added to jsdoc in jsdoc/jsdoc#916 the feature is described here: http://usejsdoc.org/about-configuring-default-template.html#showing-the-current-date-in-the-page-footer Closes davidshimjs#46.
As described in #910, this PR allows the user to disable the footer date in the default template, to prevent unnecessary noise in the commits.
This PR adds a new boolean option called
includeDate
to thetemplates
config section.Leaving it out preserves the current functionality (date is displayed). If you want to turn off that feature, you must pass
includeDate: false
explicitly:I'll open an issue at https://github.com/jsdoc3/jsdoc3.github.com/issues along with this PR to include documentation about this new option.