https://github.com/gwleuverink/magic-todo
Aren't todo comments the worst? Turn them into interactive, in-your-face reminders with a single keystroke
https://github.com/gwleuverink/magic-todo
blade laravel
Last synced: 3 months ago
JSON representation
Aren't todo comments the worst? Turn them into interactive, in-your-face reminders with a single keystroke
- Host: GitHub
- URL: https://github.com/gwleuverink/magic-todo
- Owner: gwleuverink
- License: mit
- Created: 2024-08-15T11:47:34.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-26T15:31:01.000Z (9 months ago)
- Last Synced: 2025-03-18T22:28:28.808Z (3 months ago)
- Topics: blade, laravel
- Language: PHP
- Homepage:
- Size: 295 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Magic todo
[](https://github.com/gwleuverink/magic-todo/actions/workflows/codestyle.yml)
[](https://github.com/gwleuverink/magic-todo/actions/workflows/tests.yml)Magically turn HTML comments into interactive hints in your Laravel Blade frontend.
## Installation
```bash
composer require leuverink/magic-todo
```## Usage
Magic Todo turns your standard TODO comments in Blade files into interactive elements. By default, you can activate this feature by adding a pipe `|` symbol at the beginning of your comment.
```html
Some action
```
You can also highlight entire blocks of code:
```html
Some action
```
Blade comments are supported as well:
```blade
{{-- |TODO: This button is not yet implemented --}}
```### Modifying TODO Keywords
You can modify the default behavior by publishing the package config and editing the `magic-todo.open` & `magic-todo.close` keywords. For instance, changing `magic-todo.open` to `TODO` will highlight every todo comment in your templates.
If you change `magic-todo.open` to `TODO`, Every TODO comment in your template will be highlighted.
### Direct Component Usage
For more control, you can use the highlight component directly in your markup:
```blade
Foo bar
Do anything you like in here
```
## Configuration
```php
[
'enabled' => env('MAGIC_TODO_ENABLED', app()->isLocal()),
'open' => 'TODO:',
'close' => 'ENDTODO',
];
```## Development
```bash
composer lint # run all linters
composer fix # run all fixerscomposer analyze # run static analysis
composer baseline # generate static analysis baselinecomposer test # run test suite
composer build # bundle all assets
```## Ideas
Here are some other features I have in mind if there is any interest in this package:
- [ ] Artisan command to list all todos (both in comments & direct component usage)
- [ ] Syntax for rendering in specific environments (e.g., only dev / dev + staging)
- [ ] Support for NOTE & FIXME comments with different styling
- [ ] Replace @mentions with clickable GitHub avatars
- [ ] Add better theme/styling support## License
This package is open-source software licensed under the MIT license.