Skip to content

Commit eb9a15b

Browse files
committed
Restructured code
1 parent 44540f8 commit eb9a15b

11 files changed

+772
-962
lines changed

index.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
<script src="vendor/js/showdown.min.js"></script>
4141
<script src="vendor/js/prism.js"></script>
4242

43-
<script src="src/codeparl-bootstrap-markdown-editor.js"></script>
43+
<script src="src/dist/codeparl-bootstrap-markdown-editor.min.js"></script>
4444

4545
<script>
46-
$('.editor').codeparlMarkdown({
46+
var data = {
4747
fullscreen: true,
4848
help: {
4949
show: true
@@ -52,8 +52,19 @@
5252
image: {
5353
backendScript: "php/image-upload.php"
5454
}
55+
},
56+
onInput: function(text) {
57+
console.log(text);
5558
}
56-
})
59+
}
60+
61+
$('.editor').codeparlMarkdown();
62+
63+
//Allows preview only
64+
// $('.editor').codeparlMarkdown({
65+
// previewOnly: false,
66+
// markdown: " ```html <br> <headd> </head> ``` "
67+
// });
5768
</script>
5869
</body>
5970

-90.2 KB
Binary file not shown.
-1.71 KB
Binary file not shown.
-31 KB
Binary file not shown.

php/images/hassan.jpg

-9.27 KB
Binary file not shown.

php/images/screenshot-01.png

-50.7 KB
Binary file not shown.

readme.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ This is a jQuery plugin written by H. Mugabo @codeparl.com.
1010
* jQuery
1111
* Ace editor (http://ace.c9.io)
1212
* Showdown (http://showdownjs.com/)
13+
* Prism (https://prismjs.com/)
1314

1415
## Features
1516

16-
* Preview support
17-
* Image uload support
17+
* Supports Preview
18+
* syntax highlighter (supported by [Prism](https://prismjs.com/) ) - optional
19+
* Image upload support
1820
* Shortcuts
1921
* Automatic URL detection
22+
* Supports Emojis
2023
* Multiple instances on the same page
21-
* Fullscreen
22-
* Themes
23-
* help bar
24+
* Fullscreen mode
25+
* Editor Themes
26+
* help bar for markdown syntax
2427
* i18n
2528

2629
## Screenshots
@@ -62,14 +65,16 @@ then include the js files before the closing tag of the `<body>` element of your
6265
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
6366
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.3/ace.js"></script>
6467
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
68+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/prism.min.js" integrity="sha512-axJX7DJduStuBB8ePC8ryGzacZPr3rdLaIDZitiEgWWk2gsXxEFlm4UW0iNzj2h3wp5mOylgHAzBzM4nRSvTZA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
6569
<script src="codeparl-bootstrap-markdown-editor.min.js"></script>
6670
</body>
6771
```
6872

69-
7073
## Example Usage
7174

72-
### Initialize the editor:
75+
### Initialize the editor
76+
77+
#### This will initialize the editor
7378

7479
```javascript
7580
//select your div element to turn into a markdown editor.
@@ -95,6 +100,14 @@ $('.mardown-editor').codeparlMarkdown({
95100
});
96101
```
97102

103+
### Initialize the Markdown Preview
104+
105+
#### This will initialize the previewer only
106+
107+
```javascript
108+
$('.mardown-editor').codeparlMarkdown({previewOnly: true});
109+
```
110+
98111
## Plugin documentation
99112

100113
### Options
@@ -181,7 +194,8 @@ $.fn.codeparlMarkdown.defaults.editor.editorHeight = '500px';
181194

182195
## License
183196

184-
Licensed under MIT (https://github.com/codeparl/CodeParl-bootstrap-markdown-editor/blob/master/LICENSE).
197+
Licensed under MIT (https://github.com/codeparl CodeParl-bootstrap-markdown-editor/blob/master/LICENSE)
198+
185199
## Authors
186200

187201
[H. Mugabo - aka codeparl](https://github.com/codeparl)

src/_animation.scss

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

0 commit comments

Comments
 (0)