-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
126 lines (108 loc) · 3.42 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Excel/Word paste to AsciiDoc PSV</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #F5F5F5;
line-height: 30px;
}
h1 {
font-size: 36px;
text-align: center;
margin-top: 50px;
margin-bottom: 30px;
}
p {
font-size: 18px;
text-align: center;
margin-bottom: 20px;
}
textarea {
display: block;
width: 800px;
height: 500px;
font-family: "Lucida Console";
margin: 0 auto;
padding: 10px;
border-radius: 5px;
border: none;
background-color: #FFFFFF;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.25);
}
button {
display: block;
margin: 0 auto;
margin-top: 20px;
margin-bottom: 50px;
font-size: 20px;
padding: 15px 30px;
border-radius: 5px;
border: none;
color: #FFFFFF;
background-color: #0072C6;
cursor: pointer;
transition: background-color 0.3s ease-in-out;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.25);
width: 220px;
}
pre code {
display: block;
margin: 0 auto;
margin-bottom: 20px;
font-size: 14px;
padding: 20px;
border-radius: 5px;
border: none;
color: #ffffff;
background-color: #1E1E1E;
transition: background-color 0.3s ease-in-out;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.25);
width: 600px;
}
button:hover {
background-color: #005A9E;
}
#copyMessage {
text-align: center;
font-size: 18px;
margin-top: 20px;
opacity: 0;
transition: opacity 1s ease-in-out;
}
#copyMessage.show {
opacity: 1;
}
</style>
</head>
<body>
<h1>Excel clipboard to AsciiDoc PSV table</h1>
<p>Easily convert excel and word tables to AsciiDoc!<br>
Simply paste a copied excel/word table. Note that it should not include special formatting like colors.</p>
<textarea id="editor"></textarea>
<script src="script.js"></script>
<button onclick="copyText()" id="copyButton">Copy to clipboard</button>
<p>For <b>horizontal lines</b> and to treat the <b>first row as header</b>, paste these attributes above table:</p>
<pre><code>[frame=none, grid=rows, options="header"]</code></pre>
<p>To additionally treat the <b>last row as footer</b>, paste instead:</p>
<pre><code>[frame=none, grid=rows, options="header,footer"]</code></pre>
<p>To set the <b>relative column widths</b>, add the <code>cols="..."</code> attribute:</p>
<pre><code>[cols="1,3,1"] // set the columns to be 1:3:1 wide, i.e. 20%, 60%, 20%</code></pre>
<p>Link to GitHub repository: <a href="https://github.com/marcdus/copy-excel-to-asciidoc">marcdus/copy-excel-to-asciidoc</a></p>
<script>
function copyText() {
var copyText = document.getElementById("editor");
copyText.select();
document.execCommand("copy");
var message = document.getElementById("copyButton");
message.innerHTML = "Table copied!";
message.classList.add("show");
setTimeout(function() {
message.innerHTML = "Copy to clipboard";
}, 2500);
}
</script>
</body>
</html>