Skip to content

Commit 73021e3

Browse files
chore(examples): rename and move examples to directories
1 parent 188f66f commit 73021e3

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

examples/amd.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

examples/amd/requirejs.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<div id="root" style="padding: 50px"></div>
2+
3+
<!-- RequireJS -->
4+
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
5+
6+
<script>
7+
window.requirejs.config({
8+
paths: {
9+
'html-react-parser': '../../dist/html-react-parser.min',
10+
react: 'https://unpkg.com/react@16/umd/react.development',
11+
'react-dom': 'https://unpkg.com/react-dom@16/umd/react-dom.development'
12+
}
13+
});
14+
15+
window.requirejs(
16+
['html-react-parser', 'react-dom'],
17+
function (HTMLReactParser, ReactDOM) {
18+
ReactDOM.render(
19+
HTMLReactParser(
20+
'<h2 style="font-family:\'Lucida Grande\';">' +
21+
'HTMLReactParser loaded with RequireJS' +
22+
'<\/h2>'
23+
),
24+
document.getElementById('root')
25+
);
26+
}
27+
);
28+
</script>

examples/script.html renamed to examples/script/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="root" style="padding: 50px;"></div>
1+
<div id="root" style="padding: 50px"></div>
22

33
<!-- React -->
44
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
@@ -7,7 +7,7 @@
77
-->
88

99
<!-- HTMLReactParser -->
10-
<script src="../dist/html-react-parser.min.js"></script>
10+
<script src="../../dist/html-react-parser.min.js"></script>
1111

1212
<!-- ReactDOM -->
1313
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>

examples/index.html renamed to examples/script/repl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<textarea cols="50" rows="5"><p>Hello, world!</p></textarea>
22
<pre><code></code></pre>
33
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
4-
<script src="../dist/html-react-parser.min.js"></script>
4+
<script src="../../dist/html-react-parser.min.js"></script>
55
<script>
66
var code = document.querySelector('code');
77
var textarea = document.querySelector('textarea');

0 commit comments

Comments
 (0)