philippoehrlein / typo-and-paste
A Kirby plugin for managing and inserting special characters with multi-language support.
Installs: 2 188
Dependents: 0
Suggesters: 0
Security: 0
Stars: 31
Watchers: 3
Forks: 2
Open Issues: 0
Type:kirby-plugin
Requires
- php: >=8.1.0
- getkirby/composer-installer: ^1.2
Requires (Dev)
- getkirby/cms: ^4.0 || ^5.0
README
Typo & Paste is a Kirby plugin that allows users to easily manage and insert special characters with multi-language support.
Table of Contents
Features
- Multi-Language Support: Supports various languages for characters and the user interface.
- Custom Characters: Users can define and add their own characters.
- Multiple Access Points:
- Panel toolbar button
- Writer mark button
- Textarea button
- Keyboard shortcuts (
Option+T
/Alt+T
)
- Clipboard Copy: Easily copy characters to the clipboard.
Compatibility
This plugin is compatible with Kirby 4 and 5.
Installation
Composer
composer require philippoehrlein/typo-and-paste
Manual Installation
- Download and extract the plugin
- Copy the
typo-and-paste
folder into/site/plugins/
Configuration
Access Points
The plugin provides four ways to access special characters:
1. Panel Toolbar Button
In Kirby 5, configure the Panel toolbar button in your page, site, or file blueprint:
buttons: - typo-and-paste - preview - settings - languages - status
Or globally in your config:
// site/config/config.php return [ 'panel' => [ 'viewButtons' => [ // Page view 'page' => ['typo-and-paste', 'preview', 'settings', 'languages', 'status'], // Site view 'site' => ['typo-and-paste', 'preview', 'languages'] ] ] ];
2. Writer Mark Button
To add the Typo & Paste button to the Writer toolbar, include typo-and-paste
in your field's marks configuration:
fields: article: label: Article type: writer toolbar: inline: true marks: - bold - italic - underline - strike - code - "|" - link - email - "|" - clear - "|" - typo-and-paste
3. Textarea Button
To add the Typo & Paste button to a textarea, add typo-and-paste
in your field's buttons configuration:
fields: article: label: Article type: textarea buttons: - typo-and-paste
4. Keyboard Shortcuts
- Use
Option+T
(Mac) orAlt+T
(Windows/Linux) to open the character dialog from anywhere - Navigate characters using arrow keys
- Press
Enter
to add the selected character to your clipboard
Character Configuration
Define custom characters in your config: Each character can either be defined as a simple string or as an object with value and a multilingual label. Labels are used for accessibility and shown as tooltips in the UI.
// site/config/config.php return [ 'philippoehrlein.typo-and-paste' => [ 'characters' => [ [ 'label' => [ 'en' => 'Quotation Marks', 'de' => 'Anführungszeichen', ], 'lang' => 'fr', // Optional: Show only for French content 'characters' => [ ['value' => '«', 'label' => ['en' => 'Left guillemet', 'de' => 'Linkes Guillemets']], ['value' => '»', 'label' => ['en' => 'Right guillemet', 'de' => 'Rechtes Guillemets']], '‹', // also allowed: plain characters '›' ] ], ] ] ];
AI Support
This plugin includes an AI-friendly schema definition (AI-SCHEMA.md) to help generate configurations using AI language models. The schema provides:
- Structured format for character group definitions
- Clear property descriptions and requirements
- Guidelines for creating meaningful character groups
- Examples of proper configuration
Using AI for Configuration
- Share the content of AI-SCHEMA.md with your AI assistant
- Describe your specific use case and requirements
- The AI will generate a configuration following the schema
- Review and adjust the generated configuration as needed
Example prompt:
Using the schema, create a configuration for a blog about [your topic]. The content will be in [languages] and editors work in [languages].
Translations
The plugin includes a default set of translations for en
, de
, fr
, es
, nl
, and it
.
Add custom translations:
// site/languages/en.php return [ 'translations' => [ 'philippoehrlein.typo-and-paste.buttonTitle' => 'Special Characters', 'philippoehrlein.typo-and-paste.copiedMessage' => '{character} copied to clipboard', ] ];
Search
Extend Typo & Paste with a searchable interface for special characters. Simply install Typo, Search & Paste — and you’re ready to go.
Composer
composer require philippoehrlein/typo-search-and-paste
Github
Development
- Clone the repository
- Install dependencies:
composer install
- Run playground:
composer dev
- Open: localhost:8000
License
MIT License