Skip to content

Commit bc704db

Browse files
committed
Initial release v1.0.0
- Full Djot markup syntax support via php-collective/djot - Process full content or [djot]...[/djot] blocks - Admin settings page with content, security, and highlighting options - Syntax highlighting with highlight.js (12+ themes) - Safe mode for XSS protection - Template tags: djot_to_html(), the_djot(), has_djot() - WordPress filters: wp_djot_pre_convert, wp_djot_post_convert - Dark mode CSS support
0 parents  commit bc704db

File tree

21 files changed

+2159
-0
lines changed

21 files changed

+2159
-0
lines changed

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
# https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_size = 4
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.{yml,yaml}]
18+
indent_size = 2
19+
20+
[*.json]
21+
indent_size = 2
22+
23+
[composer.json]
24+
indent_size = 4

.gitattributes

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# PHP files
5+
*.php text eol=lf
6+
7+
# Templates
8+
*.phtml text eol=lf
9+
10+
# CSS/JS
11+
*.css text eol=lf
12+
*.js text eol=lf
13+
14+
# Markdown
15+
*.md text eol=lf
16+
17+
# Config files
18+
*.json text eol=lf
19+
*.xml text eol=lf
20+
*.yml text eol=lf
21+
*.yaml text eol=lf
22+
*.neon text eol=lf
23+
24+
# Shell scripts
25+
*.sh text eol=lf
26+
27+
# Windows specific
28+
*.bat text eol=crlf
29+
30+
# Binary files
31+
*.png binary
32+
*.jpg binary
33+
*.jpeg binary
34+
*.gif binary
35+
*.ico binary
36+
*.woff binary
37+
*.woff2 binary
38+
*.ttf binary
39+
*.eot binary
40+
41+
# Export ignore (exclude from release archives)
42+
/.editorconfig export-ignore
43+
/.gitattributes export-ignore
44+
/.gitignore export-ignore
45+
/.github export-ignore
46+
/phpcs.xml export-ignore
47+
/phpstan.neon export-ignore
48+
/stubs export-ignore
49+
/tests export-ignore
50+
/CHANGELOG.md export-ignore

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
syntax-check:
11+
name: PHP Syntax Check
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php-version: ['8.2', '8.3', '8.4']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
tools: composer:v2
25+
26+
- name: Install dependencies
27+
run: composer install --prefer-dist --no-progress
28+
29+
- name: Check PHP syntax
30+
run: find src -name "*.php" -exec php -l {} \;
31+
32+
coding-standards:
33+
name: Coding Standards
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: '8.2'
43+
tools: composer:v2, phpcs
44+
45+
- name: Install dependencies
46+
run: composer install --prefer-dist --no-progress
47+
48+
- name: Check coding standards
49+
run: phpcs --standard=phpcs.xml || true

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dependencies
2+
/vendor/
3+
4+
# IDE
5+
/.idea/
6+
/.vscode/
7+
*.sublime-*
8+
9+
# OS
10+
.DS_Store
11+
Thumbs.db
12+
13+
# Composer
14+
composer.lock
15+
16+
# Build artifacts
17+
/build/
18+
*.zip
19+
20+
# Testing
21+
/coverage/
22+
.phpunit.result.cache
23+
24+
# Temporary files
25+
*.log
26+
*.tmp
27+
_*

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.0.0] - 2024-XX-XX
11+
12+
### Added
13+
14+
- Initial release
15+
- Full Djot markup syntax support via php-collective/djot
16+
- `[djot]...[/djot]` shortcode for posts and pages
17+
- `{djot}...{/djot}` curly brace syntax for content filtering
18+
- Admin settings page under Settings → WP Djot
19+
- Content settings: enable/disable for posts, pages, comments
20+
- Security settings: safe mode for XSS protection
21+
- Syntax highlighting with highlight.js (12+ themes)
22+
- Advanced settings: custom shortcode tag, filter priority
23+
- Template tags: `djot_to_html()`, `the_djot()`, `has_djot()`
24+
- WordPress filters: `wp_djot_pre_convert`, `wp_djot_post_convert`
25+
- Dark mode CSS support
26+
- Multisite compatible
27+
- Clean uninstall (removes all options)
28+
29+
### Security
30+
31+
- Safe mode enabled by default for untrusted content
32+
- Comments always processed with safe mode
33+
- XSS protection via djot-php safe mode
34+
35+
[Unreleased]: https://github.com/dereuromark/wp-djot/compare/v1.0.0...HEAD
36+
[1.0.0]: https://github.com/dereuromark/wp-djot/releases/tag/v1.0.0

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Mark Scherer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)