@@ -19,131 +19,62 @@ Djot is a light markup syntax created by John MacFarlane (creator of CommonMark
1919- ** Full Djot Support** : Headings, emphasis, links, images, code blocks, tables, footnotes, and more
2020- ** Block Editor Support** : Native Gutenberg block for writing Djot with live preview
2121- ** Shortcode Support** : Use ` [djot]...[/djot] ` in your content
22- - ** Content Filtering** : Automatically process ` {djot}...{/djot} ` blocks in posts and pages
2322- ** Content Profiles** : Configurable feature restrictions (full, article, comment, minimal)
24- - ** Safe Mode** : XSS protection for untrusted content (enabled by default for comments)
23+ - ** Safe Mode** : XSS protection for untrusted content
2524- ** Syntax Highlighting** : Built-in highlight.js integration with multiple themes
26- - ** Admin Settings** : Easy configuration through WordPress admin
27- - ** Template Tags** : ` wp_djot_to_html() ` and ` wp_djot_the() ` for theme developers
28- - ** Dark Mode Support** : CSS automatically adapts to dark mode preferences
29- - ** WP-CLI Migration** : Migrate existing HTML/Markdown content to Djot with rollback support
25+ - ** WP-CLI Migration** : Migrate existing HTML/Markdown content to Djot
3026
31- ## Requirements
32-
33- - PHP 8.2 or higher
34- - WordPress 6.0 or higher
35- - Composer (for installation)
36-
37- ## Installation
27+ ## Example
3828
39- ### From GitHub
40-
41- 1 . Clone or download this repository to ` wp-content/plugins/wp-djot `
42- 2 . Run ` composer install ` in the plugin directory
43- 3 . Activate the plugin in WordPress admin
44-
45- ``` bash
46- cd wp-content/plugins/wp-djot
47- composer install
4829```
49-
50- ### From WordPress.org
51-
52- Search for "Djot Markup" in the WordPress plugin directory, or visit:
53- [ wordpress.org/plugins/djot-markup-for-wp] ( https://wordpress.org/plugins/djot-markup-for-wp/ )
54-
55- ## Usage
56-
57- ### Block Editor (Gutenberg)
58-
59- Add a ** Djot** block from the block inserter (search for "Djot"). The block provides:
60-
61- - A code editor for writing Djot markup
62- - Live preview toggle in the sidebar
63- - Server-side rendering for accurate output
64-
65- Simply write your Djot content and toggle preview to see the rendered HTML.
66-
67- ### Shortcode
68-
69- ````
70- [djot]
71- # Hello World
30+ # Welcome to My Blog
7231
7332This is _emphasized_ and this is *strong*.
7433
75- - List item 1
76- - List item 2
34+ Here's a [link to Djot](https://djot.net/) and some `inline code`.
7735
78- ```php
79- echo "Hello, World!";
80- ```
81- [/djot]
82- ````
83-
84- ### Curly Brace Syntax
36+ - First item
37+ - Second item
38+ - Third item
8539
86- If content filtering is enabled in settings:
87-
88- ```
89- {djot}
90- Your Djot content here...
91- {/djot}
92- ```
40+ > A blockquote with some wisdom.
9341
94- ### Template Tags
42+ And a code block:
9543
96- ``` php
97- // Convert and return HTML
98- $html = wp_djot_to_html('# Hello *World*!');
99-
100- // Convert and echo HTML
101- wp_djot_the('# _Hello_ *World*!');
102-
103- // Check if content has Djot
104- if (wp_djot_has($content)) {
105- // ...
106- }
44+ ``` php
45+ <?php
46+ echo "Hello, World!";
10747```
108-
109- ### Shortcode Attributes
110-
11148```
112- [djot safe="true"]
113- Untrusted content - will use safe mode
114- [/djot]
11549
116- [djot class="my-custom-class"]
117- Content with custom CSS class
118- [/djot]
119- ```
50+ ## Requirements
12051
121- ## Configuration
52+ - PHP 8.2 or higher
53+ - WordPress 6.0 or higher
12254
123- Go to ** Settings → Djot Markup ** to configure:
55+ ## Installation
12456
125- - ** Content Settings** : Enable/disable for posts, pages, comments
126- - ** Comment Processing** : Process full comment content as Djot (not just ` {djot} ` blocks)
127- - ** Security Settings** : Safe mode for XSS protection
128- - ** Code Highlighting** : Enable/disable and choose theme
129- - ** Advanced** : Custom shortcode tag, filter priority
57+ ### From WordPress.org
13058
131- ### Optional: HTMLPurifier for Enhanced Security
59+ Search for "Djot Markup" in the WordPress plugin directory, or visit:
60+ [wordpress.org/plugins/djot-markup-for-wp](https://wordpress.org/plugins/djot-markup-for-wp/)
13261
133- For additional XSS protection on comments, you can optionally install HTMLPurifier:
62+ ### From GitHub
13463
13564```bash
136- composer require ezyang/htmlpurifier
65+ cd wp-content/plugins
66+ git clone https://github.com/php-collective/wp-djot.git
67+ cd wp-djot
68+ composer install --no-dev
13769```
13870
139- When installed, HTMLPurifier will automatically be used for sanitizing comment output.
140-
14171## Documentation
14272
143- - [ Content Profiles] ( docs/profiles.md ) - Configure feature restrictions for posts and comments
144- - [ WP-CLI Commands] ( docs/wp-cli.md ) - Migrate existing content to Djot
73+ - [ Usage & Configuration] ( docs/README.md ) - Getting started guide
74+ - [ Content Profiles] ( docs/profiles.md ) - Configure feature restrictions
75+ - [ WP-CLI Commands] ( docs/wp-cli.md ) - Migrate existing content
14576- [ Hooks and Filters] ( docs/hooks.md ) - Customize plugin behavior
146- - [ Djot Syntax] ( docs/syntax.md ) - Quick reference for Djot markup
77+ - [ Djot Syntax] ( docs/syntax.md ) - Quick reference
14778
14879For complete Djot syntax documentation, visit [ djot.net] ( https://djot.net/ ) .
14980
@@ -155,4 +86,4 @@ For complete Djot syntax documentation, visit [djot.net](https://djot.net/).
15586
15687## Changelog
15788
158- See [ CHANGELOG.md] ( CHANGELOG.md ) for full history.
89+ See [ CHANGELOG.md] ( CHANGELOG.md ) for version history.
0 commit comments