Skip to content

Commit c19db51

Browse files
committed
refactored structure; merged Enlighter docs
1 parent c20825e commit c19db51

23 files changed

+561
-8
lines changed

CustomThemes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Create Custom Themes
2+
===========================

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,31 @@ EnlighterJS3 Documentation
55

66
**EnlighterJS, an open source syntax highlighter written in pure javascript**
77

8-
Index
9-
-------------
8+
EnlighterJS on your Website
9+
-----------------------------
1010

1111
* [Mode of Operation](Mode_of_Operation.md) - how EnlighterJS works
1212
* [Integration](Integration.md) - add EnlighterJS to your website
13-
* [Configuration and Options](Options.md) - configure EnlighterJS
14-
* [Methods/API](Methods_and_API.md) - advanced use cases
1513
* [FAQ](FAQ.md) - Frequently Asked Questions
14+
15+
EnlighterJS editing plugins
16+
-----------------------------
17+
18+
* [TinyMCE](editing/TinyMCE.md) - Howto add code snippets via TinyMCE WYSIWYG editor
19+
* [Gutenberg](editing/Gutenberg.md) - Howto add code snippets via WordPress Gutenberg editor
20+
21+
EnlighterJS CMS Integration
22+
-----------------------------
23+
24+
* [Enlighter WordPress Plugin](wordpress/) - use EnlighterJS with WordPress - includes full visual editor integration
25+
26+
For Developers
27+
---------------
28+
29+
* [Developer Guide](development/README.md) - add new themes and languages
30+
* [Configuration and Options](development/Options.md) - configure EnlighterJS
31+
* [Methods/API](development/Methods_and_API.md) - advanced use cases
1632
* [Tweaks + Advanced Settings](Tweaks.md) - change EnlighterJS visual appearance (low level)
17-
* [Developer Guide](DeveloperGuide.md) - add new themes and languages
1833

1934
Related
2035
-------------
@@ -30,9 +45,8 @@ EnlighterJS is OpenSource and managed on [GitHub](https://github.com/EnlighterJS
3045
To simplify the release and quality control process, please follow these remarks:
3146

3247
1. **One Enhancement** _==>_ **One Commit** (don't merge a bunch of changes in a single commit!)
33-
2. Only commit changes to the `src/` or `examples/` directory. Otherwise your request will be rejected
34-
3. Discuss larger project changes with the Maintainer **before implementing**
35-
4. Use GitHub for question, bugreports and discussions
48+
2. Discuss larger project changes with the Maintainer **before implementing**
49+
3. Use GitHub for question, bugreports and discussions
3650

3751
License
3852
----------------------------

assets/gutenberg.gif

151 KB
Loading

assets/tinymce_codeblock_settings.gif

215 KB
Loading

assets/tinymce_codegroup.gif

342 KB
Loading

assets/tinymce_codeinsert.gif

308 KB
Loading

assets/tinymce_editorformats.gif

211 KB
Loading

assets/tinymce_inline.gif

221 KB
Loading

assets/tinymce_tabindent.gif

72.3 KB
Loading

assets/wordpress_markdown_fenced.gif

128 KB
Loading

assets/wordpress_markdown_inline.gif

88 KB
Loading
File renamed without changes.
File renamed without changes.

DeveloperGuide.md renamed to development/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Index
55
----------------
66

77
* [Highlighting-Engine and Symbol](HighlightingEngine_and_Symbols.md)
8+
* [Configuration and Options](development/Options.md) - configure EnlighterJS
9+
* [Methods/API](development/Methods_and_API.md) - advanced use cases
810
* [Theme Development](#theme-development)
911
* [Language Development](#language-development)
1012

editing/Gutenberg.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
WordPress Gutenberg Editor
2+
============================
3+
4+
> The important things first: please use the **Visual Editor Plugin** or **Gutenberg** whenever possible
5+
> **never ever use shortcodes** in the Visual Editor!
6+
>
7+
> Shortcodes are designed to be used with the **Text Editor (HTML)** only!
8+
9+
10+
Insert Code-Snippets
11+
-----------------------------------------
12+
13+
Enlighter provides a full Gutenberg-Editor-Integration which allows you to edit add/edit code to your posts seemless.
14+
15+
### Example ###
16+
17+
![Insert Code](../assets/gutenberg.gif)
18+
19+
### Steps ###
20+
21+
1. Click on the `plus icon` to insert a new Gutenberg Block
22+
2. Search for `Enlighter Sourcecode` block
23+
3. Paste your snippet into the text-area
24+
4. Select the language of your snippet (javascript in this example)
25+
5. You can edit the snippet directly in the Visual Editor at any time
26+
6. Publish your post!

editing/TinyMCE.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
TinyMCE WYSIWYG Editor Tutorial
2+
=====================================
3+
4+
Insert Code-Snippets
5+
----------------------------------------
6+
7+
EnlighterJS provides a full TinyMCE editor integration via [EnlighterJS/Plugin.TinyMCE](https://github.com/EnlighterJS/Plugin.TinyMCE). This allows you to add/edit code to your content seemlessly.
8+
9+
The examples on this page are showing the editor plugin added to WordPress via [Enlighter Plugin](https://wordpress.org/plugins/enlighter/) - it also works standalone!
10+
11+
### Example ###
12+
13+
![Insert Code](../assets/tinymce_codeinsert.gif)
14+
15+
[EnlighterJS TinyMCE Live-Demo](https://tinymce.enlighterjs.org/)
16+
17+
### Steps ###
18+
19+
1. Move the Cursor to the position you want to insert the code snippet
20+
2. Click on the `Enlighter Code Insert` Button on the upper right of the toolbar
21+
3. Paste your snippet into the text-area
22+
4. Select the language of your snippet (javascript in this example)
23+
5. Select "Left-Align-Indentation" - this will strip the unnecessary code indentation (marked in the example)
24+
6. Click **OK**
25+
7. You can edit the snippet directly in the Visual Editor at any time
26+
8. Publish your post!
27+
28+
Use Editor-Formats to highlight existing code
29+
------------------------------------------------------
30+
31+
Sometime you already have some code within your posts you want to highlight. In this case Enlighter comes with its own **Formats** which allows you to highlight a selected text in the Visual Editor.
32+
33+
### Example ###
34+
35+
![Highlight existing Code](../assets/tinymce_editorformats.gif)
36+
37+
### Steps ###
38+
39+
1. Expand the Editor Toolbar
40+
2. Select the content you want to highlight
41+
3. Goto `Formats -> Enlighter Codeblocks` and select the language
42+
4. Publish your post!
43+
44+
45+
Align your code with <kbd>tab</kbd> key
46+
------------------------------------------------------
47+
48+
Enlighter 3.5 comes with its own tab-alignment addon which allows you to align your code directly within the editor (optional feature).
49+
50+
**Requirement**: Set `Enlighter -> Editing -> Visual Editor -> Tweaks -> Enable Tab Indentation`
51+
52+
* Move Right: Select code + press <kbd>tab</kbd> key
53+
* Move Left: Select code + press <kbd>shift</kbd>+<kbd>tab</kbd> key
54+
55+
56+
![Highlight existing Code](../assets/tinymce_tabindent.gif)
57+
58+
59+
Use Inline Code Highlighting
60+
------------------------------------------------------
61+
62+
Enlighter allows you to highlight codeblocks as well as **inline snippets** out-of-the-box. Inline-Code is often used to highlight small pieces of code diretly within a larger textblock.
63+
64+
### Example ###
65+
66+
![Highlight Inline Code](../assets/tinymce_inline.gif)
67+
68+
### Steps ###
69+
70+
1. Expand the Editor Toolbar
71+
2. Select the content you want to highlight
72+
3. Goto `Formats -> Enlighter Inline` and select the language
73+
4. Publish your post!
74+
75+
76+
Change Code Settings / Advanced Code Settings
77+
------------------------------------------------------
78+
79+
Sometime you may need some advanced features like
80+
81+
* Disable Linenumbers
82+
* Change Theme of a individual codeblock
83+
* Set a linenumber offset
84+
* Highlight special lins
85+
* Create Codegroups
86+
87+
this settings are available after the code-snippet has been added to the editor by using the `Enlighter Code Settings` Button
88+
89+
### Example ###
90+
91+
![Change Codeblock Settings](../assets/tinymce_codeblock_settings.gif)
92+
93+
### Steps ###
94+
95+
1. Move the Cursor into an existing Enlighter Codeblock (or inline)
96+
2. The `Enlighter Code Settings` Button will appear on the upper right side of the codeblock **and** on the upper right of the toolbar
97+
3. Click on the `Enlighter Code Settings` Button
98+
4. An advanced settings dialog will be opened
99+
5. Change the Theme
100+
6. Set a linenumber-offset
101+
7. Highlight a special line
102+
8. Click **OK**
103+
9. Publish your post!
104+
105+
Codegroups
106+
------------------------------------------------------
107+
108+
In some cases, your code example rely on a several different languages. For example **HTML**, **CSS** and **Javascript**. It can be helpful to group this snippets together.
109+
110+
### Example ###
111+
112+
![Define Codegoups](../assets/tinymce_codegroup.gif)
113+
114+
### Steps ###
115+
116+
1. Add some code snippets to your post
117+
2. Click on the `Enlighter Code Settings` Button to edit a codeblock
118+
3. Add a `Codegroup Identifier` to each codeblock you want to group together (has to be **unique** for each group)
119+
4. Add an optional `Codegroup Title` to each codeblock - its used as the tabname

wordpress/ActionsEvents.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Actions and Events
2+
======================================================
3+
4+
EVENT::enlighter_init
5+
------------------------------------------------------
6+
7+
**Description:** Triggered after Plugin initialization
8+
9+
#### Example - fetch a list of active themes ####
10+
11+
```php
12+
$themes = array();
13+
function do_after_ejs_init(){
14+
$themes = Enlighter::getAvailableThemes();
15+
}
16+
17+
// the Theme-List become available after the plugin is initialized!
18+
// prior calls will throw an internal error
19+
add_action('enlighter_init', 'do_after_ejs_init');
20+
```

wordpress/FAQ.md

Whitespace-only changes.

0 commit comments

Comments
 (0)