Skip to content

Commit

Permalink
Merge pull request #39 from ozh/pr38
Browse files Browse the repository at this point in the history
/** docblock */
  • Loading branch information
ozh committed Oct 1, 2018
2 parents 39501b7 + 43dabe2 commit cf93fb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ function createTable() {
var align; // Default alignment: left-aligned

// Add comment/remark indicators for use in code":
commentbefore = "";
commentafter = "";
prefix = "";
suffix = "";
switch (commenting) {
Expand All @@ -127,6 +129,12 @@ function createTable() {
// ada/AppleScript/Haskell/Lua/SQL
prefix = "-- ";
break;
case "docblock":
// PHPDoc, JSDoc, Javadoc
commentbefore = "/**";
commentafter = " */";
prefix = " * ";
break;
case "percent":
// MATLAB
prefix = "% ";
Expand Down Expand Up @@ -161,7 +169,7 @@ function createTable() {
suffix = " */";
break;
case "xml":
// XML
// XML
prefix = "<!-- ";
suffix = " -->";
break;
Expand Down Expand Up @@ -351,6 +359,9 @@ function createTable() {
// output the text
var output = "";

// echo comment wrapper if any
output += commentbefore + "\n";

// output the top most row
// Ex: +---+---+
if (hasTopLine ) {
Expand Down Expand Up @@ -417,6 +428,9 @@ function createTable() {
output += getSeparatorRow(colLengths, cBL, cBM, cBR, spH, prefix, suffix)
}

// echo comment wrapper if any
output += commentafter + "\n";

$('#output').val(output);
$('#outputText').show();
$('#outputTbl').hide();
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ <h2>Input</h2>
<option value="hash">"# " Perl/PowerShell/Python/R/Ruby</option>
<option value="doubledash">"-- " ada/AppleScript/Haskell/Lua/SQL</option>
<option value="percent">"% " MATLAB </option>
<option value="docblock">" * " Docblock (PHP/Java/JS) </option>
<option value="singlespace">" " (1 space) wikimedia</option>
<option value="quadspace">" &nbsp;&nbsp;&nbsp;" (4 spaces) reddit</option>
<option value="singlequote">"' " (single quote) VBA</option>
Expand Down

0 comments on commit cf93fb6

Please sign in to comment.