{"id":21319541,"url":"https://github.com/simplajs/simpla-text","last_synced_at":"2026-01-11T13:30:29.594Z","repository":{"id":58242890,"uuid":"44274391","full_name":"simplajs/simpla-text","owner":"simplajs","description":"An editable richtext element you can update inline","archived":false,"fork":false,"pushed_at":"2017-12-15T05:54:41.000Z","size":1424,"stargazers_count":10,"open_issues_count":6,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-10T11:12:45.857Z","etag":null,"topics":["content-management","editor","javascript","polymer","richtexteditor","simpla","text","web-components"],"latest_commit_sha":null,"homepage":"https://www.simplajs.org","language":"HTML","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/simplajs.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":"2015-10-14T20:27:35.000Z","updated_at":"2019-07-15T20:41:58.000Z","dependencies_parsed_at":"2022-08-31T04:22:11.383Z","dependency_job_id":null,"html_url":"https://github.com/simplajs/simpla-text","commit_stats":null,"previous_names":["simplaelements/simpla-text"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplajs%2Fsimpla-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplajs","download_url":"https://codeload.github.com/simplajs/simpla-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225795416,"owners_count":17525316,"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":["content-management","editor","javascript","polymer","richtexteditor","simpla","text","web-components"],"created_at":"2024-11-21T19:42:44.998Z","updated_at":"2026-01-11T13:30:29.562Z","avatar_url":"https://github.com/simplajs.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simpla Text\n[![Build status][travis-badge]][travis-url] ![Size][size-badge] ![Version][bower-badge] [![Published][webcomponents-badge]][webcomponents-url]\n\nSimpla-text is an element containing editable richtext, which you can update seamlessly inline on your page. Use it on its own or inside other textual elements. It's built on the [Simpla](https://www.simpla.io) content system.\n\n\u003c!---\n```\n\u003ccustom-element-demo\u003e\n  \u003ctemplate\u003e\n    \u003cscript src=\"../webcomponentsjs/webcomponents-lite.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/simpla@^2.0.0\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      Simpla.init('local');\n      Simpla.editable(true);\n    \u003c/script\u003e\n    \u003clink rel=\"import\" href=\"simpla-text.html\"\u003e\n    \u003cstyle\u003e\n      body {\n        font-family: sans-serif;\n        line-height: 1.6;\n        padding: 1rem 0.5rem;\n      }\n    \u003c/style\u003e\n    \u003cnext-code-block\u003e\u003c/next-code-block\u003e\n  \u003c/template\u003e\n\u003c/custom-element-demo\u003e\n```\n--\u003e\n\n```html\n\u003csimpla-text path=\"/text\"\u003e\u003c/simpla-text\u003e\n```\n\n### Contents\n\n- [Installation and setup](#installation-and-setup)\n- [Editing content](#editing-content)\n- [Saving content](#saving-content)\n- [Inline content](#inline-content)\n- [Initializing with static content](#initializing-with-static-content)\n- [Plaintext](#plaintext)\n- [Custom placeholders](#custom-placeholders)\n- [Typographer](#typographer)\n- [Readonly](#readonly)\n- [Contributing](#contributing)\n\n### Resources\n\n- [API reference][api]\n- [Demo][demo]\n- [License][license]\n\n## Installation and setup\n\nInstall simpla-text with Bower (Yarn support coming soon)\n\n```sh\n$ bower i simpla-text --save\n```\n\n[Setup Simpla][simpla-setup] on your page, then import simpla-text into your `\u003chead\u003e`\n\n```html\n\u003clink rel=\"import\" href=\"/bower_components/simpla-text/simpla-text.html\"\u003e\n```\n\nUse `\u003csimpla-text\u003e` wherever you want editable text on your page. Give each text element a unique `path`, where it will store its content in your project\n\n```html\n\u003csimpla-text path=\"/text\"\u003e\u003c/simpla-text\u003e\n```\n\n## Editing content\n\nEdit text by entering edit mode with Simpla, or setting the `editable` property directly on an element.\n\n```js\n// Enter edit mode\nSimpla.editable(true);\n```\n\n```html\n\u003c!-- Make only this text editable --\u003e\n\u003csimpla-text path=\"/text\" editable\u003e\u003c/simpla-text\u003e\n```\n\nEntering edit mode is the recommended way to edit text. It ensures all elements on a page remain in sync and updates Simpla's public `editable` state, which other elements may rely on.\n\n## Saving content\n\nSave simpla-text content by calling Simpla's `save()` method, which will save all modified content on the page. It returns a promise.\n\n```js\n// Save all modified Simpla content\nSimpla.save();\n```\n\n\u003e You must be authenticated with Simpla before saving content\n\n## Inline content\n\nYou can use `\u003csimpla-text\u003e` either as a standalone text container, or inside other textual elements (headings, paragraphs, etc). When used inside other textual elements, simpla-text automatically enables `inline` mode, which disables paragraphs and inserts line breaks for new lines.\n\n```html\n\u003c!-- Standalone text container, uses paragraphs --\u003e\n\u003csimpla-text path=\"/text\"\u003e\u003c/simpla-text\u003e\n\n\u003c!-- Inline content, line breaks only --\u003e\n\u003ch1\u003e\n  \u003csimpla-text path=\"/text\"\u003e\u003c/simpla-text\u003e\n\u003c/h1\u003e\n```\n\nYou can also force `inline` mode by setting the `inline` property on simpla-text\n\n```html\n\u003c!-- Inline content, line breaks only --\u003e\n\u003csimpla-text path=\"/text\" inline\u003e\u003c/simpla-text\u003e\n```\n\n## Initializing with static content\n\nYou can write HTML content inside simpla-text just like you would with any other element. The HTML you insert will be parsed into simpla-text's content model when you enter edit mode. If content for a text's `path` exists on Simpla's API any static content will be overwritten.\n\n```html\n\u003csimpla-text path=\"/text\"\u003e\n  \u003cp\u003eSimpla text is a block of editable richtext for the Simpla content system\u003c/p\u003e\n\u003c/simpla-text\u003e\n```\n\nInitializing with static content is useful for converting existing sites to Simpla, or bootstrapping a project with predefined content. By putting content inside `\u003csimpla-text\u003e` and then calling `Simpla.save()` you can easily set content directly to Simpla's API.\n\n\u003e Since static content is overwritten by remote data, you should not have content inside `\u003csimpla-text\u003e` in production. If newer content gets saved you will experience FOUC (Flash Of Unformatted Content) when the static content is overwritten\n\n## Plaintext\n\nBy default simpla-text provides editable richtext, with basic formatting controls (bold, italic, underline, links) available to the user. You can disable all formatting tools and force simpla-text to create plain text content only with the `plaintext` property.\n\n```html\n\u003csimpla-text path=\"/text\" plaintext\u003e\u003c/simpla-text\u003e\n```\n\n## Custom placeholders\n\nYou can set custom placeholders (displayed when simpla-text is editable and doesn't have content) with a `placeholder` attribute\n\n```html\n\u003csimpla-text \n  path=\"/text\" \n  placeholder=\"Start typing...\"\u003e\n\u003c/simpla-text\u003e\n```\n\n## Typographer\n\nSimpla-text applies 'smart typography' rules to its content, including:\n\n- Smart quotes (`\"` to `“`)\n- Automatic em dashes (`--` to `—`)\n- Automatic ellipses (`...` to `…`)\n\nYou can disable the typographer by giving simpla-text a `noTypographer` property\n\n```html\n\u003csimpla-text path=\"/text\" no-typographer\u003e\u003c/simpla-text\u003e\n```\n\n## Readonly\n\nSimpla-text has a `readonly` property that stops the element from becoming editable, even if Simpla is in edit mode or you try to set `editable` on the element directly. This is useful for using simpla-text to purely consume and display content from Simpla's API.\n\n```html\n\u003csimpla-text path=\"/text\" readonly\u003e\u003c/simpla-text\u003e\n```\n\n## Contributing\n\nIf you find any issues with simpla-text please report them! If you'd like to see a new feature in supported file an issue. We also happily accept PRs. \n\n***\n\nMIT © [Simpla][simpla]\n\n[simpla]: https://www.simpla.io\n[simpla-setup]: https://docs.simpla.io/guides/get-started.html\n\n[api]: https://www.webcomponents.org/element/simplaio/simpla-text/page/API.md\n[demo]: https://www.webcomponents.org/element/simplaio/simpla-text/demo/demo/index.html\n[license]: https://github.com/simplaio/simpla-text/blob/master/LICENSE\n\n[bower-badge]: https://img.shields.io/bower/v/simpla-text.svg\n[travis-badge]: https://img.shields.io/travis/simplaio/simpla-text.svg\n[travis-url]: https://travis-ci.org/simplaio/simpla-text\n[size-badge]: http://img.badgesize.io/simplaio/simpla-text/master/simpla-text.html?compression=gzip\u0026label=render_bundle_%28gzip%29\n[webcomponents-badge]: https://img.shields.io/badge/webcomponents.org-published-blue.svg\n[webcomponents-url]: https://www.webcomponents.org/element/simplaio/simpla-text\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplajs%2Fsimpla-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplajs%2Fsimpla-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplajs%2Fsimpla-text/lists"}