In .verb.md
where you want to inject the TOC:
<!-- toc -->
Done!
/** | |
* Compares two software version numbers (e.g. "1.7.1" or "1.2b"). | |
* | |
* This function was born in http://stackoverflow.com/a/6832721. | |
* | |
* @param {string} v1 The first version to be compared. | |
* @param {string} v2 The second version to be compared. | |
* @param {object} [options] Optional flags that affect comparison behavior: | |
* <ul> | |
* <li> |
text-overflow: ellipsis; | |
overflow: hidden; | |
width: 250px; | |
white-space: nowrap; | |
display: block; |
/** | |
* Connects to the QRS API (REST based) using certificates. | |
* See this article for more information about connecting to QRS https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Connect-API.htm | |
* | |
*/ | |
var https = require('https'); | |
var fs = require('fs'); |
'// ***************************************************************** | |
'// Delete all files by a given fileMask | |
'// ~~ | |
'// Example: | |
'// DeleteFiles("C:\temp\*.txt") | |
'// or | |
'// DeleteFile("*.log") => will delete all .log files in the | |
'// current folder | |
'// ***************************************************************** | |
Sub DeleteFiles(ByVal fileMask) |
// ------------------------------------------------------------------ | |
// QlikView Extension helper functions for sending some messages | |
// to console output | |
// (prevents errors if console object is not available) | |
// ------------------------------------------------------------------ | |
function ConsoleLog(msg) { | |
if (typeof console != "undefined") { | |
console.log(msg); | |
} | |
} |
// Define one or more styles sheets to be used within the extension | |
var cExtensionName = 'ExtensionName'; | |
var cssFiles = []; | |
cssFiles.push('Extensions/' + cExtensionName + '/lib/css/style.css'); | |
cssFiles.push('Extensions/' + cExtensionName + '/lib/css/style2.css'); | |
for (var i = 0; i < cssFiles.length; i++) { | |
Qva.LoadCSS(Qva.Remote + (Qva.Remote.indexOf('?') >= 0 ? '&' : '?') + 'public=only' + '&name=' + cssFiles[i]); | |
} |
// Define one or more javascript files to be used within the extension | |
var cExtensionName = 'ExtensionName'; | |
var jsFiles = []; | |
jsFiles.push('Extensions/' + cExtensionName + '/lib/js/BaseUtils.js'); | |
jsFiles.push('Extensions/' + cExtensionName + '/lib/js/ExtensionUtils.js'); | |
Qv.LoadExtensionScripts(jsFiles, function () { | |
// Initialize the extension | |
//Init(); |
// ------------------------------------------------------------------ | |
// General Utils | |
// ------------------------------------------------------------------ | |
function nullOrEmpty(obj) { | |
if (obj == null || obj.length == 0 || obj == 'undefined') { | |
return true; | |
} | |
return false; | |
} |
function setVariableValue(varName, val) { | |
var qvDoc = Qv.GetCurrentDocument(); | |
qvDoc.SetVariable(varName, val); | |
} |