Can I cause JsDoc3 to omit the <footer> tag with the date in it? - jsdoc

JSDoc outputs a date in the footer of each page:
<footer>
Documentation generated by JSDoc 3.2.0 on Fri Jan 17 2014 14:30:54 GMT-0800 (PST)
</footer>
So whenever I rebuild my library, all the documentation files look like they've changed to Git. That's not desirable -- I only want to commit these docs when they actually change in content.
Can I cause JsDoc to not output this footer at all?

I submitted a PR for this issue (https://github.com/jsdoc3/jsdoc/pull/916), and it's now on the 3.3.0 branch.
This change was not published to NPM at the time I'm writing this answer, but you can require the 3.3.0 branch from git:
"jsdoc": "git+https://git#github.com/jsdoc3/jsdoc.git#releases/3.3"
Afterwards, you can add the following field to your config file:
{
...
"templates": {
...
"default": {
"includeDate": false
}
},
...
}
Notice this option is only available for the default jsdoc template.

I have some modest experience with creating jsdoc 3 templates and I've looked at the code to check what you are asking. Here is what I found:
<footer> is hardcoded in the default template's layout.tmpl file. By hardcoded, I mean the element itself is not optional.
I've not seen any code in the default template's publish.js file that would somehow remove <footer> when processing layout.tmpl.
So to remove this footer you'd have to use a customized template or do some sort of post-processing on the files generated by jsdoc 3.
With versions prior to 3.3.0, removing <footer> from the template would mean copying the whole default template and making the change to layout.tmpl. Version 3.3.0, which is currently in alpha, will provide the possibility to basically tell jsdoc 3 to use the default template but with a different layout.tmpl file, which will make customizing templates much easier.

Related

Have VSCode ignore specific reference links in markdown validation

In Visual Studio Code with Markdown validation enabled (markdown.validate.enabled: true), I can ignore links to specific files that may not exist in the current context via the markdown.validate.ignoredLinks setting. However, that setting does not seem to apply to reference links (e.g. [link]: some-reference), nor can I find a corresponding setting specific to reference links.
Why do I want this? My specific use-case involves an extension the "standard" (CommonMark) markdown format to auto-generate a table-of-contents using the following syntax (and no, I don't expect VSCode to generate a preview of that TOC):
[[_TOC_]]
<!-- or -->
[TOC]
VScode happily generates a warning for such links, namely:
No link definition found: 'TOC' (link.no-such-reference)
Somewhat obviously, I can make the warning disappear I define a (bogus) TOC reference, such as:
[toc]: bogus
I can also disable validation of all reference links ("markdown.validate.referenceLinks.enabled": false), but I don't want to do that. I want to ignore the error for a specific reference, much like one can ignore a GLOB pattern for file links (markdown.validate.ignoredLinks).
Does anyone know of a such a setting before I submit a bug/missing-feature report?

Can exams2moodle export additional metainfo such as idnumber and tags?

When I export the xml file of a multiple choice question, it contains the following lines:
<idnumber>arbitrary_id_set_by_user</idnumber>
<answernumbering>ABCD</answernumbering>
<tag></tag>
Is there a way to add idnumber, answernumbering and tag to the metainformation section of the question so that r-exams can export to moodle XML as <idnumber>idnumber</idnumber>,<answernumbering>ABCD</answernumbering>, <tag>tag1</tag>, and <tag>tag2</tag> etc?
The <answernumbering> tag can be set in exams2moodle() via the answernumbering= argument, see ?exams2moodle. The reason for this is that this is set in the same way for all exercises in a quiz. This is more consistent than setting it individually and potentially inconsistently in the meta-information of the different exercises.
The <idnumber> tag appears to be used by Moodle only for internal purposes. It is also not mentioned in the official Moodle XML documentation at https://docs.moodle.org/311/en/Moodle_XML_format. Hence we did not implement it in exams2moodle().
The <tag> is currently not supported in exams2moodle() because we felt that it would be more important to have tags in the Rmd (or Rnw) exercise itself and not the Moodle version of the exercise. For structuring the content on the Moodle side the exsection meta-information can be used, see boxhist for a worked example.
Finally, you can add arbitrary metainformation by using the exextra tag. This is used, for example, in the essayreg exercise template. However, there is no general way of using this extra metainformation to insert additional XML code in the exams2moodle() output. To do that, the source code underlying exams2moodle() would have to be adapted correspondingly.

Manage hierarchy / enforce priority of TS-templates

Well, there is actually another guy with exact the same problem. But until today, they didn't come up with a solution, that's why I'm asking it once again.
My entire TS is included by an extension in TYPO3 7.6.8. This works fine except with indexed_search. The TS inside my resources EXT get overwritten by the indexed_search default TS.
This is the order of the TS inside the Template-Analyzer:
SYS: TYPO3_CONF_VARS:FE:defaultTypoScript
EXT:fluid_styled_content/Configuration/TypoScript/...
... a bunch of other third party extensions ...
EXT:indexed_search/Configuration/TypoScript
EXT:templates_ext/Resources/Private/TypoScript
extbase
fluid
extensionmanager
belog
beuser
felogin
indexed_search
sys_note
realurl
So #7 is the extension which includes all my TS but it gets overwritten by #14. The only way to configure the indexed_search is inside the setup of the page template (which comes after all those above). But I want to avoid that to keep things clean.
Is there a way to prioritize a certain TS so that it doesn't get overwritten?
Open the TypoScript record, switch to the tab "Includes", at the bottom you will find the field Static Template Files from TYPO3 Extensions:. Select the value Include before all static templates if root flag is set.
Try putting the TS from your template extension inside the root page Setup field like this (adjust the path if necessary, your example says Resources/Private/TypoScript?):
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:templates_ext/Configuration/TypoScript/setup.ts">
This should make sure that it is included AFTER all the other includes (I assume you included those via the includes tab?)

Stop Umbraco 7.2.8 tinyMCE editor removing script tags

I've been trying to stop the latest version of Umbraco's tinyMCE editor from automatically stripping any script tags. This was working fine some months ago. Umbraco has not been updated to my knowledge.
I have tried a number of solutions, mostly summed up in this thread: https://our.umbraco.org/forum/using/ui-questions/48866-RTE-not-updating-to-show-new-HTML-tags-in-Umbraco-7
I have edited umbracoSettings.config
<content>
<TidyEditorContent>False</TidyEditorContent>
<errors>...
And have allowed all in validElements in tinyMceConfig.config
<validElements><![CDATA[*[*]]]></validElements>
Finally I changed wed.config in order to force Umbraco to reload.
I still cannot get the script tags to save?
Any suggestions appreciated.
First off, This Is A Very Bad Idea (tm) - don't do it - you'll open it up to all sorts of problems.
The better way to do it is develop a macro that takes a block of text as a parameter, and make that macro useable in the Richtext Edit control.
Your Macro Script can then render the input any way you want, including using script tags (which probably should be part of the macro script). This way you have complete control over what's rendered.
I know this is old but this works on all versions of 7+
To enable javascript to be added to the editor you need to change the following.
You need to replace some of the configs in the config > tinyMceConfig.config file
<![CDATA[+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],
-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],
img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],
-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],
-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],
thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],
-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],
-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],
-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],
dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],
param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],script[language|type|src]]]>
</validElements>
<invalidElements>font</invalidElements>
<!-- this area is for custom config settings that should be added during TinyMCE initialization -->
<customConfig>
<!-- <config key="myKey">mySetting</config>-->
<config key="entity_encoding">raw</config>
<config key="codemirror">
{
"indentOnInit": false,
"path": "../../../../lib/codemirror",
"config": {
},
"jsFiles": [
],
"cssFiles": [
]
}
</config>
<config key="allow_script_urls">true</config>

Mezzanine/TinyMCE filtering script type

I'm building a website using brython and I came by a problem that has nothign to do with it.
My problem is with Mezzanine or TinyMCE editor (I'm not sure which). To make brython work I need the script tag to be "text/python". But the editor filters it automatically to "text/javascript".
I disabled the filtering already, both in the admin panel and in the actual source code, I tried adding "text/python" to the RICHTEXT_ALLOWED defaults in the mezzanine configuration too.
Just to be clear, security is not an issue, this particular feature won't go online in the final version of the website.
Although the HTML specification does allow one to put any value other than "text/javascript" in script's type attribute, few projects do that, and Brython is one of those few. It is likely the "text/javascript" value is simply hardcoded in the editor and it won't allow you to change that.
(There is probably a big chance of having an issue closed as "won't fix/not a bug" or equivalent if you try to report this to the editor's issue tracker).
I think the workaround in this case is to write some javascript to change the text on the attribute on the relevant script tags to "text/python" prior to calling Brython. i.e., instead of triggering Brython on your page with
<body onload="brython()" >
Do something along
<body onload="function (){var x = document.getElementsByName("python"); for(var i=0; i < x.length; x++){x.type="text/python"};brython()}()" >
(and of course, add the attribute name='python' to all your python script tags)