{"id":21694117,"url":"https://github.com/fvilers/tiny-editor","last_synced_at":"2025-04-12T22:17:50.669Z","repository":{"id":33087492,"uuid":"151252931","full_name":"fvilers/tiny-editor","owner":"fvilers","description":"A tiny HTML rich text editor written in vanilla JavaScript","archived":false,"fork":false,"pushed_at":"2024-10-19T14:43:41.000Z","size":1987,"stargazers_count":118,"open_issues_count":1,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T22:17:46.794Z","etag":null,"topics":["editor","html","javascript","tiny","vanilla","wysiwyg"],"latest_commit_sha":null,"homepage":"https://fvilers.github.io/tiny-editor","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fvilers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fvilers"}},"created_at":"2018-10-02T12:45:18.000Z","updated_at":"2025-04-09T00:01:56.000Z","dependencies_parsed_at":"2024-08-23T07:00:37.677Z","dependency_job_id":"2dcb5f2e-0d90-4bb2-bba7-b9b6e75f3342","html_url":"https://github.com/fvilers/tiny-editor","commit_stats":{"total_commits":118,"total_committers":3,"mean_commits":"39.333333333333336","dds":0.364406779661017,"last_synced_commit":"6c8353203a084ce3342f42a497a5c6924a01352f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvilers%2Ftiny-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvilers%2Ftiny-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvilers%2Ftiny-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvilers%2Ftiny-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fvilers","download_url":"https://codeload.github.com/fvilers/tiny-editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637786,"owners_count":21137538,"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":["editor","html","javascript","tiny","vanilla","wysiwyg"],"created_at":"2024-11-25T18:26:37.218Z","updated_at":"2025-04-12T22:17:50.624Z","avatar_url":"https://github.com/fvilers.png","language":"JavaScript","readme":"# tiny-editor\n\nA tiny HTML rich text editor written in vanilla JavaScript\n\n## Goal\n\nCreate a less than 5 Kb (compressed) library that enables a HTML element to be used as a rich text editor in plain old vanilla JavaScript.\n\n## Support\n\nIf you use and like this library, feel free to support my Open Source projects.\n\n[![donate](https://www.paypalobjects.com/en_US/BE/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=JZ26X897M9V9L\u0026currency_code=EUR)\n\n## How to install\n\n```\nnpm install tiny-editor\n```\n\nor load the bundle file directly at the end of your HTML document.\n\n```\n\u003cscript src=\"https://unpkg.com/tiny-editor/dist/bundle.js\"\u003e\u003c/script\u003e\n```\n\n## How to use\n\n1. Reference the editor library in your HTML document\n2. Add a `data-tiny-editor` attribute to the HTML element you want to transform into an editor\n\n## How to dynamically create an editor\n\nUse the exported function `window.__tinyEditor.transformToEditor()` which take as the first argument the DOM element (usually a `\u003cdiv\u003e`) that you want to transform to an editor. Refer to the `/public/index.html` for an example.\n\n## How to extract the formatted text\n\nListen for the `input` event on the editor HTML element.\n\n```\ndocument\n  .querySelectorAll('[data-tiny-editor]')\n  .forEach(editor =\u003e\n    editor.addEventListener('input', e =\u003e console.log(e.target.innerHTML)\n  )\n);\n```\n\n## How to customize\n\nThere are various options that can be used to customize how the Tiny Editor will be rendered. By default, every options are enabled. You can disable an option using data attributes.\n\nFor example, you can remove the bold format button using the following attribute:\n\n```\n\u003cdiv data-tiny-editor data-bold=\"no\"\u003e\u003c/div\u003e\n```\n\n### Options\n\n- `data-formatblock=\"no\"`: remove the styles drop down list\n- `data-bold=\"no\"`: remove the bold button\n- `data-italic=\"no\"`: : remove the italic button\n- `data-underline=\"no\"`: remove the underline button\n- `data-fontname=\"no\"`: remove the font drop down list\n- `data-forecolor=\"no\"`: : remove the text color button\n- `data-justifyleft=\"no\"`: remove the left align button\n- `data-justifycenter=\"no\"`: remove the center align button\n- `data-justifyright=\"no\"`: remove the right align button\n- `data-insertorderedlist=\"no\"`: remove the numbered list button\n- `data-insertunorderedlist=\"no\"`: remove the bulleted list button\n- `data-outdent=\"no\"`: remove the decrease indent button\n- `data-indent=\"no\"`: remove the increase indent button\n- `data-remove-format=\"no\"`: remove the clear formatting button\n- `data-autofocus=\"no\"`: remove autofocus from the editor\n\n## Supported browsers\n\nModern browser (Chrome, Firefox, Edge,...) are supported. Tiny Editor doesn't work on Internet Explorer.\n","funding_links":["https://github.com/sponsors/fvilers","https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=JZ26X897M9V9L\u0026currency_code=EUR"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffvilers%2Ftiny-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffvilers%2Ftiny-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffvilers%2Ftiny-editor/lists"}