-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.html
More file actions
139 lines (116 loc) · 3.55 KB
/
Test.html
File metadata and controls
139 lines (116 loc) · 3.55 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="https://mooz.github.io/org-js/org.js"></script>
<script type="text/javascript">
// <![CDATA[
function loadFile(filePath) {
var result = null;
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", filePath, false);
xmlhttp.send();
if (xmlhttp.status==200) {
result = xmlhttp.responseText;
}
return result;
}
function convert_org(input){
var orgParser = new Org.Parser();
var orgDocument = orgParser.parse(input);
var orgHTMLDocument = orgDocument.convert(Org.ConverterHTML, {
headerOffset: 1,
exportFromLineNumber: false,
suppressSubScriptHandling: false,
suppressAutoLink: false
});
return orgHTMLDocument.toString();
}
function handle_onload(){
var text = loadFile("test.org");
alert(text);
}
function handle_onclick(){
var in_el = document.getElementById("org_input");
var out_el = document.getElementById("output");
out_el.innerHTML = convert_org(in_el.value);
}
// ]]>
</script>
</head>
<body onload="handle_onload();">
<table>
<tr>
<td colspan="2">
<button type="button" onclick='handle_onclick();'>Refresh</button>
</td>
</tr>
<tr>
<td valign="top">
<textarea id="org_input">
#+TITLE: Org Mode Syntax Cheat Sheet
#+OPTIONS: toc:nil
# Adapted from http://karl-voit.at/2017/09/23/orgmode-as-markup-only/
* Top Level Heading
** Second Level Heading
*** Third Level Heading
# A comment line. This line will not be exported.
Paragraphs are separated by at least one empty line.
*bold* /italic/ _underlined_ +strikethrough+ =monospaced=
[[https://nickhigham.wordpress.com/][Link description]]
https://nickhigham.wordpress.com/ A link without a description.
A DOI (digital object identifier) link:
[[doi:10.1093/comnet/cnv016][Matching Exponential-Based and Resolvent-Based Centrality Measures]]
A horizontal line, fill-width across the page:
-----
- First item in a list.
- Second item.
- Sub-item
1. Numbered item.
2. Another item.
- [ ] Item yet to be done.
- [X] Item that has been done.
LaTeX macros can be included: $x_2 = \alpha + \beta^2 - \gamma$.
**** TODO A todo item.
**** DONE A todo item that has been done.
#+BEGIN_QUOTE
This text will be indented on both the left margin and the right margin.
#+END_QUOTE
: Text to be displayed verbatim (as-is), without markup
: (*bold* does not change font), e.g., for source code.
: Line breaks are respected.
Some MATLAB source code:
#+BEGIN_SRC matlab
>> rand(1,3)
ans =
5.5856e-01 7.5663e-01 9.9548e-01
#+END_SRC
Some arbitrary text to be typeset verbatim in monospace font:
#+BEGIN_SRC text
Apples, oranges,
cucumbers, tomatoes
#+END_SRC
# Table and spreadsheet. The column headed "Ratio" is automatically
# calculated by hitting C-c C-c in Emacs on the #+TBLFM line.
|----------------+-----------+-----------+-------|
| Country | Abstracts | Downloads | Ratio |
|----------------+-----------+-----------+-------|
| United States | 7 | 497 | 71.0 |
| Unknown | 4 | 83 | 20.8 |
| United Kingdom | 3 | 41 | 13.7 |
| Germany | 3 | 29 | 9.7 |
| Netherlands | 2 | 21 | 10.5 |
| Japan | 1 | 18 | 18.0 |
|----------------+-----------+-----------+-------|
#+TBLFM: $4=$3/$2;%.1f
Include an image:
file:nickhighamwordpress.jpg
</textarea>
</td>
<td>
<div id="output"></div>
</td>
</tr>
</table>
<h2> AND THIS IS THE END. </h2>
</body>
</html>