{"id":21339354,"url":"https://github.com/cuboulder/ucb_shortcodes","last_synced_at":"2025-03-16T02:24:40.909Z","repository":{"id":41826522,"uuid":"406503037","full_name":"CuBoulder/ucb_shortcodes","owner":"CuBoulder","description":"A set of CKEditor plugins to insert short codes","archived":false,"fork":false,"pushed_at":"2022-04-27T21:13:53.000Z","size":60,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-22T15:13:06.429Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CuBoulder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-14T19:52:23.000Z","updated_at":"2021-10-07T15:39:45.000Z","dependencies_parsed_at":"2022-08-11T18:40:28.967Z","dependency_job_id":null,"html_url":"https://github.com/CuBoulder/ucb_shortcodes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CuBoulder%2Fucb_shortcodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CuBoulder%2Fucb_shortcodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CuBoulder%2Fucb_shortcodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CuBoulder%2Fucb_shortcodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CuBoulder","download_url":"https://codeload.github.com/CuBoulder/ucb_shortcodes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814979,"owners_count":20352077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T00:45:34.962Z","updated_at":"2025-03-16T02:24:40.522Z","avatar_url":"https://github.com/CuBoulder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ucb_shortcodes\nA set of CKEditor plugins to insert short codes\n\n## Included shortcodes\n- Button\n- Font Awesome Icon\n\n## Installation\nThis module is installed with the profile.\n\n## Development\nExtending CKEditor in broken up into two parts, the CKEditor plugin and the Drupal plugin. The Drupal plugin connects the CKEditor plugin to the site.\nWe are using CKEditor 4, so making plugins must adhere to the [CKEditor 4 API](https://ckeditor.com/docs/ckeditor4/latest/guide/index.html).\n\n### CKEditor Plugin\nPlugins for CKEditor follow a specific directory structure. You can add new plugins to the `plugins` directory.\n````\nplugin_name\n|_ dialogs         // This is where to define modals for the plugin\n|_ css             // Optional styles for this plugin. Styles are applied to the modal dialog only\n|_ icons           // Contains the button icon that appears on the editor toolbar\n|_ plugin.js       // This defines the plugin\n````\nTo create a plugin, read this [Plugin example](https://ckeditor.com/docs/ckeditor4/latest/guide/plugin_sdk_sample_1.html). You don't have to add the `config.extraPlugins` part since Drupal will do that.\n\n\u003e The name of the icon image **MUST** match the name of the plugin.\n\u003e \u003cbr\u003e\n\u003e **Example:**\n\u003e \u003cbr\u003e\n\u003e The ckeditorfa5 plugin contains an icon called ckeditorfa5.png.\n\u003e \u003cbr\u003e\n\u003e In the call to `editor.ui.addButton()`, the icon option is also named ckeditorfa5 without the file extension.\n\n### Drupal Plugin\nPlugins will extend the `CKEditorPluginBase` class. You can add a new plugin in the `src/Plugin/CKEditorPlugin` directory. Each file must have annotations above the class in order for Drupal to find it.\n\nYou can copy an existing Plugin file to create your own. The two important methods in this class are `getFile()` and `getButtons()`. The former will tell Drupal where the actual CKEditor plugin is. The latter will add the button to the editor toolbar.\n\n\u003e The value for the id in the class annotation MUST match the name of the CKEditor plugin name.\n\u003e \u003cbr\u003e\n\u003e **Example:**\n\u003e \u003cbr\u003e\n\u003e The ckeditorfa5 plugin defines a new plugin with `CKEDITOR.plugins.add('ckeditorfa5',{})`\n\u003e \u003cbr\u003e\n\u003e In the IconShortcode.php annotation, the id has the value \"ckeditorfa5\"\n\n\u003e In the `getButtons()` return array, the key in the associative array **MUST** match the button name in the CKEditor plugin.\n\u003e \u003cbr\u003e\n\u003e **Example:**\n\u003e \u003cbr\u003e\n\u003e In IconShortcode.php, the key name is *ckeditorfa*. In ckedortorfa5/plugin.js, the first argument in the call to `editor.ui.addButton()` is also\n\u003e called *ckeditorfa*\n\n---\n\n### Custom Filters\nFilters are applied to the text before it's rendered to the page. You can add new filters in the `src/Plugin/Filter` directory.\n\nThere is one method, `process()` where the text is transformed. Make sure to return a new string and not the `$text` variable that's passed into the function. If you're adding classes or additional markup, be sure to add it to the *Allowed HTML Tags* filter option on the text editor config page.\n\n### Stylesheets\nTo add CSS to the text editor itself, add CSS files to the `ckeditor_sylesheets` key in [ucb2021_base.info.yml](https://github.com/CuBoulder/ucb2021_base/blob/main/ucb2021_base.info.yml).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuboulder%2Fucb_shortcodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuboulder%2Fucb_shortcodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuboulder%2Fucb_shortcodes/lists"}