Skip to content

Commit

Permalink
Merge pull request #30 from pikulsky/gh-pages
Browse files Browse the repository at this point in the history
Issue #29 : Jira style
  • Loading branch information
ozh committed Feb 28, 2018
2 parents 967ed77 + d43753a commit e77aa5a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ Press **Create Table** to get something like:
| This is a row with only one cell | | | |
```

### Jira table
```
|| Col1 || Col2 || Col3 || Numeric Column ||
| Value 1 | Value 2 | 123 | 10.0 |
| Separate | cols | with a tab or 4 spaces | -2,027.1 |
| This is a row with only one cell | | | |
```

### reStructuredText table
```
================================== ========= ======================== ================
Expand Down
17 changes: 16 additions & 1 deletion assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function createTable() {
}

var style = $('#style').val();
var hasHeaderSeparators = true; // Defaults to including a separator line btwn header and data rows
var hasLineSeparators = false; // Defaults to no separator lines btwn data rows
var hasTopLine = true; // Defaults to including the topmost line
var hasBottomLine = true; // Defaults to including the bottom-most line
Expand Down Expand Up @@ -181,6 +182,20 @@ function createTable() {
hdV = "|"; hdH = "-";
spV = "|"; spH = "-";
break;
case "jira":
// jira markdown
hasTopLine = false;
hasBottomLine = false;
autoFormat = false;
hasHeaderSeparators = false;

cTL = ""; cTM = ""; cTR = "";
cML = ""; cMM = ""; cMR = "";
cBL = ""; cBM = ""; cBR = "";

hdV = "||"; hdH = "";
spV = "|"; spH = "";
break;
case "wikim":
// wikimedia
hasLineSeparators = true;
Expand Down Expand Up @@ -252,7 +267,7 @@ function createTable() {

for (var i = 0; i < rows.length; i++) {
// Separator Rows
if (hasHeaders && i == 1 ) {
if (hasHeaders && hasHeaderSeparators && i == 1 ) {
// output the header separator row
for (var j = 0; j <= colLengths.length; j++) {
if ( j == 0) {
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ <h2>Input</h2>
<option value="separated">ASCII (separated)</option>
<option value="compact">ASCII (compact)</option>
<option value="gfm">Github Markdown</option>
<option value="jira">Jira</option>
<option value="rounded">ASCII (rounded)</option>
<option value="bubbles">ASCII (bubbles)</option>
<option value="girder">ASCII (girder)</option>
Expand Down

0 comments on commit e77aa5a

Please sign in to comment.