You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New feature: Include specific kind of comment like //-> that will be evaluated. This could help to call function definitions to see example of uses. Really useful in case of libraries with functions for which as there are no invocations quokka is not useful... I usually include comments with hardcoded data structures... it would be great if instead of documentation I can include some code that reveals internal data structure, examples of use.
Sample code
// The line below will be executed by quokka.//=> getTaxValueFromNumber(1975.08, 10.001) //? 197.528functiongetTaxValueFromNumber(x,tax){try{if(x&&!isNaN(x)&&tax&&!isNaN(tax)){x=parseFloat(x);tax=parseFloat(tax);returngetNumberRound((x/100)*tax,countDecimals(tax));}}catch(err){console.log(err);}returnnull;}functiongetNumberRound(x,decimals){returnNumber(Math.round(x+'e'+decimals)+'e-'+decimals);};functioncountDecimals(x){if(x&&x%1){returnx.toString().length-x.toString().indexOf('.')-1||0;}return0;}module.exports={getTaxValueFromNumber}
Sample repository link
N/A
Quokka.js Console Output
Code editor version
Visual Studio Code v1.?
OS name and version
OSX
The text was updated successfully, but these errors were encountered:
Thanks... I am using something similar to your example. The only thing I miss is to be able to show several values within a block of comment. It will be nice if //? works inside the comment block.
This looks similar to my suggestion: #514 Would be really amazing to have something like this. I've just renewed quokka and wallaby licenses for the year and want to try and use them more this time around. I think this would be just to feature to encourage that and make quokka completely indispensable :-)
Issue description or question
New feature: Include specific kind of comment like //-> that will be evaluated. This could help to call function definitions to see example of uses. Really useful in case of libraries with functions for which as there are no invocations quokka is not useful... I usually include comments with hardcoded data structures... it would be great if instead of documentation I can include some code that reveals internal data structure, examples of use.
Sample code
Sample repository link
N/A
Quokka.js Console Output
Code editor version
Visual Studio Code v1.?
OS name and version
OSX
The text was updated successfully, but these errors were encountered: