add release script
This commit is contained in:
parent
12d05e4224
commit
5395562513
7 changed files with 1623 additions and 13 deletions
196
dist/diff2html.css
vendored
Normal file
196
dist/diff2html.css
vendored
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
/*
|
||||
*
|
||||
* Diff to HTML (diff2html.css)
|
||||
* Author: rtfpessoa
|
||||
*
|
||||
*/
|
||||
|
||||
.d2h-wrapper {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.d2h-file-wrapper {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.d2h-file-header {
|
||||
padding: 5px 10px;
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
background-color: #f7f7f7;
|
||||
font: 13px Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
}
|
||||
|
||||
.d2h-file-stats {
|
||||
display: inline;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
max-width: 15%;
|
||||
}
|
||||
|
||||
.d2h-lines-added {
|
||||
background-color: #ceffce;
|
||||
border: 1px solid #b4e2b4;
|
||||
color: #399839;
|
||||
border-radius: 5px 0 0 5px;
|
||||
padding: 2px;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.d2h-lines-deleted {
|
||||
background-color: #f7c8c8;
|
||||
border: 1px solid #e9aeae;
|
||||
color: #c33;
|
||||
border-radius: 0 5px 5px 0;
|
||||
padding: 2px;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.d2h-file-name {
|
||||
display: inline;
|
||||
height: 33px;
|
||||
line-height: 33px;
|
||||
max-width: 80%;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.d2h-diff-table {
|
||||
border-collapse: collapse;
|
||||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
font-size: 12px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.d2h-files-diff {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.d2h-file-diff {
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
.d2h-file-side-diff {
|
||||
display: inline-block;
|
||||
overflow-x: scroll;
|
||||
width: 50%;
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.d2h-code-line {
|
||||
display: block;
|
||||
white-space: pre;
|
||||
padding: 0 10px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
margin-left: 80px;
|
||||
/* Override HighlightJS */
|
||||
color: inherit;
|
||||
overflow-x: inherit;
|
||||
background: none;
|
||||
/* ******************** */
|
||||
}
|
||||
|
||||
.d2h-code-side-line.hljs {
|
||||
display: block;
|
||||
white-space: pre;
|
||||
padding: 0 10px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
margin-left: 50px;
|
||||
/* Override HighlightJS */
|
||||
color: inherit;
|
||||
overflow-x: inherit;
|
||||
background: none;
|
||||
/* ******************** */
|
||||
}
|
||||
|
||||
.d2h-code-line del,
|
||||
.d2h-code-side-line del {
|
||||
display: inline-block;
|
||||
margin-top: -1px;
|
||||
text-decoration: none;
|
||||
background-color: #ffb6ba;
|
||||
border-radius: 0.2em;
|
||||
}
|
||||
|
||||
.d2h-code-line ins,
|
||||
.d2h-code-side-line ins {
|
||||
display: inline-block;
|
||||
margin-top: -1px;
|
||||
text-decoration: none;
|
||||
background-color: #97f295;
|
||||
border-radius: 0.2em;
|
||||
}
|
||||
|
||||
.line-num1 {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
width: 30px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.line-num2 {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
width: 30px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.d2h-code-linenumber {
|
||||
position: absolute;
|
||||
width: 2%;
|
||||
min-width: 65px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
background-color: #fff;
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
text-align: right;
|
||||
border: solid #eeeeee;
|
||||
border-width: 0 1px 0 1px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.d2h-code-side-linenumber {
|
||||
position: absolute;
|
||||
width: 35px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
background-color: #fff;
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
text-align: right;
|
||||
border: solid #eeeeee;
|
||||
border-width: 0 1px 0 1px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.d2h-del {
|
||||
background-color: #fee8e9;
|
||||
border-color: #e9aeae;
|
||||
}
|
||||
|
||||
.d2h-ins {
|
||||
background-color: #dfd;
|
||||
border-color: #b4e2b4;
|
||||
}
|
||||
|
||||
.d2h-info {
|
||||
background-color: #f8fafd;
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
border-color: #d5e4f2;
|
||||
}
|
||||
1361
dist/diff2html.js
vendored
Normal file
1361
dist/diff2html.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
dist/diff2html.min.css
vendored
Normal file
1
dist/diff2html.min.css
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.d2h-wrapper{display:block;margin:0 auto;text-align:left;width:100%}.d2h-file-wrapper{border:1px solid #ddd;border-radius:3px;margin-bottom:1em}.d2h-file-header{padding:5px 10px;border-bottom:1px solid #d8d8d8;background-color:#f7f7f7;font:13px Helvetica,arial,freesans,clean,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"}.d2h-file-stats{display:inline;font-size:12px;text-align:center;max-width:15%}.d2h-lines-added{background-color:#ceffce;border:1px solid #b4e2b4;color:#399839;border-radius:5px 0 0 5px;padding:2px;width:25px}.d2h-lines-deleted{background-color:#f7c8c8;border:1px solid #e9aeae;color:#c33;border-radius:0 5px 5px 0;padding:2px;width:25px}.d2h-file-name{display:inline;height:33px;line-height:33px;max-width:80%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.d2h-diff-table{border-collapse:collapse;font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;height:18px;line-height:18px;width:100%}.d2h-files-diff{width:100%}.d2h-file-diff{overflow-x:scroll}.d2h-file-side-diff{display:inline-block;overflow-x:scroll;width:50%;margin-right:-4px}.d2h-code-line{display:block;white-space:pre;padding:0 10px;height:18px;line-height:18px;margin-left:80px;color:inherit;overflow-x:inherit;background:none}.d2h-code-side-line.hljs{display:block;white-space:pre;padding:0 10px;height:18px;line-height:18px;margin-left:50px;color:inherit;overflow-x:inherit;background:none}.d2h-code-line del,.d2h-code-side-line del{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#ffb6ba;border-radius:.2em}.d2h-code-line ins,.d2h-code-side-line ins{display:inline-block;margin-top:-1px;text-decoration:none;background-color:#97f295;border-radius:.2em}.line-num1{display:inline-block;float:left;width:30px;overflow:hidden;text-overflow:ellipsis}.line-num2{display:inline-block;float:right;width:30px;overflow:hidden;text-overflow:ellipsis}.d2h-code-linenumber{position:absolute;width:2%;min-width:65px;padding-left:10px;padding-right:10px;height:18px;line-height:18px;background-color:#fff;color:rgba(0,0,0,0.3);text-align:right;border:solid #eee;border-width:0 1px 0 1px;cursor:pointer}.d2h-code-side-linenumber{position:absolute;width:35px;padding-left:10px;padding-right:10px;height:18px;line-height:18px;background-color:#fff;color:rgba(0,0,0,0.3);text-align:right;border:solid #eee;border-width:0 1px 0 1px;cursor:pointer;overflow:hidden;text-overflow:ellipsis}.d2h-del{background-color:#fee8e9;border-color:#e9aeae}.d2h-ins{background-color:#dfd;border-color:#b4e2b4}.d2h-info{background-color:#f8fafd;color:rgba(0,0,0,0.3);border-color:#d5e4f2}
|
||||
1
dist/diff2html.min.js
vendored
Normal file
1
dist/diff2html.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
44
release.sh
Executable file
44
release.sh
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Diff2Html release script
|
||||
#
|
||||
|
||||
OUTPUT_DIR=dist
|
||||
OUTPUT_JS_FILE=${OUTPUT_DIR}/diff2html.js
|
||||
OUTPUT_MIN_JS_FILE=${OUTPUT_DIR}/diff2html.min.js
|
||||
OUTPUT_CSS_FILE=${OUTPUT_DIR}/diff2html.css
|
||||
OUTPUT_MIN_CSS_FILE=${OUTPUT_DIR}/diff2html.min.css
|
||||
|
||||
echo "Creating Diff2Html release ..."
|
||||
|
||||
echo "Cleaning previous versions ..."
|
||||
rm -rf ${OUTPUT_DIR}
|
||||
mkdir -p ${OUTPUT_DIR}
|
||||
|
||||
echo "Generating js aggregation file in ${OUTPUT_JS_FILE}"
|
||||
|
||||
echo "// Diff2Html minifier version (automatically generated)" > ${OUTPUT_JS_FILE}
|
||||
cat lib/fakeRequire.js >> ${OUTPUT_JS_FILE}
|
||||
cat lib/diff.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/utils.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/diff-parser.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/printer-utils.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/side-by-side-printer.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/line-by-line-printer.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/html-printer.js >> ${OUTPUT_JS_FILE}
|
||||
cat src/diff2html.js >> ${OUTPUT_JS_FILE}
|
||||
|
||||
echo "Minifying ${OUTPUT_JS_FILE} to ${OUTPUT_MIN_JS_FILE}"
|
||||
|
||||
uglifyjs ${OUTPUT_JS_FILE} -c -o ${OUTPUT_MIN_JS_FILE}
|
||||
|
||||
echo "Copying css file to ${OUTPUT_CSS_FILE}"
|
||||
|
||||
cp -f css/diff2html.css ${OUTPUT_CSS_FILE}
|
||||
|
||||
echo "Minifying ${OUTPUT_CSS_FILE} to ${OUTPUT_MIN_CSS_FILE}"
|
||||
|
||||
lessc -x ${OUTPUT_CSS_FILE} ${OUTPUT_MIN_CSS_FILE}
|
||||
|
||||
echo "Diff2Html release created successfully!"
|
||||
|
|
@ -5,27 +5,34 @@
|
|||
<title>Diff to HTML by rtfpessoa</title>
|
||||
|
||||
<!--
|
||||
Diff to HTML (template.html)
|
||||
Diff to HTML (index.html)
|
||||
Author: rtfpessoa
|
||||
-->
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="diff2html.css">
|
||||
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="../css/diff2html.min.css">
|
||||
<script type="text/javascript" src="../lib/diff.js"></script>
|
||||
<script type="text/javascript" src="../lib/fakeRequire.js"></script>
|
||||
<script type="text/javascript" src="../src/utils.js"></script>
|
||||
<script type="text/javascript" src="../src/diff-parser.js"></script>
|
||||
<script type="text/javascript" src="../src/printer-utils.js"></script>
|
||||
<script type="text/javascript" src="../src/side-by-side-printer.js"></script>
|
||||
<script type="text/javascript" src="../src/line-by-line-printer.js"></script>
|
||||
<script type="text/javascript" src="../src/html-printer.js"></script>
|
||||
<script type="text/javascript" src="../src/diff2html.js"></script>
|
||||
-->
|
||||
|
||||
<!-- -->
|
||||
<link rel="stylesheet" type="text/css" href="../dist/diff2html.min.css">
|
||||
<script type="text/javascript" src="../dist/diff2html.min.js"></script>
|
||||
<!-- -->
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="lib/diff.js"></script>
|
||||
<script type="text/javascript" src="lib/fakeRequire.js"></script>
|
||||
|
||||
<script type="text/javascript" src="src/utils.js"></script>
|
||||
<script type="text/javascript" src="src/diff-parser.js"></script>
|
||||
<script type="text/javascript" src="src/printer-utils.js"></script>
|
||||
<script type="text/javascript" src="src/side-by-side-printer.js"></script>
|
||||
<script type="text/javascript" src="src/line-by-line-printer.js"></script>
|
||||
<script type="text/javascript" src="src/html-printer.js"></script>
|
||||
<script type="text/javascript" src="src/diff2html.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/languages/scala.min.js"></script>
|
||||
|
||||
<script>
|
||||
var lineDiffExample = 'diff --git a/src/attributes/attr.js b/src/attributes/attr.js\n' +
|
||||
'index facdd41..b627fe8 100644\n' +
|
||||
Loading…
Reference in a new issue