sofish/pen — an open-source project — sits at 4.8k GitHub stars. enjoy live editing (+markdown)
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
You can clone the source code from github, or using bower.
bower install pen
1. installation
1.1 init with id attribute
var editor = new Pen('#editor');
1.2 init with an element
var editor = new Pen(document.getElementById('editor'));
1.3 init with options
var options = {
editor: document.body, // {DOM Element} [required]
class: 'pen', // {String} class of the editor,
debug: false, // {Boolean} false by default
textarea: '<textarea name="content"></textarea>', // fallback for old browsers
list: ['bold', 'italic', 'underline'], // editor menu list
linksInNewWindow: true // open hyperlinks in a new windows/tab
}
var editor = new Pen(options);
2. configure
The following object sets up the default settings of Pen:
If you want to customize the toolbar to fit your own project, you can instanciate Pen constructor with an options object like #1.3: init with options:
2.1 Fallback for old browser
You can set defaults.textarea to a piece of HTML string, by default, it's <textarea name="content"></textarea>。This will be set as innerHTML of your #editor.
2.2 Change the editor class
Pen will add .pen to your editor by default, if you want to change the class, make sure to replace the class name pen to your own in src/pen.css.
2.3 Enable debug mode
If options.debug is set to true, Pen will output logs to the Console of your browser.
2.4 Customize the toolbar
You can set options.list to an Array, add the following strings to make your own:
blockquote, h2, h3, p, pre: create a tag as its literal meaning
insertorderedlist: create an ol>li list
insertunorderedlist: create a ul>li list
indent: indent list / blockquote block
outdent: outdent list / blockquote block
bold: wrap the text selection in a b tag
italic: wrap the text selection in an i tag
underline: wrap the text selection in a u tag
createlink: insert link to the text selection
inserthorizontalrule: insert a hr tag
insertimage: insert an image (img) tag
2.5 Add tooltips to the toolbar icons
You can set options.titles to an object with properties that match the toolbar actions. The value of each property
will be used as the title attribute on the icon. Most browsers will display the title attribute as a tooltip when
the mouse hovers over the icon.
The most recent commit recorded on sofish/pen was 8.2 years ago, based on the GitHub push timestamp. The repository has 401 forks — one of the better signals of community interest.
How many stars does sofish/pen have?
sofish/pen has 4.8k GitHub stars — refresh the page for the live number, or check github.com/sofish/pen. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is sofish/pen open source?
TopGit's metadata for sofish/pen does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
What is sofish/pen?
sofish/pen (sofish/pen) is a JavaScript project on GitHub. From the project's own README: enjoy live editing (+markdown)
Where do I read more about sofish/pen?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/sofish/pen is the definitive source.
Read full README in the tab above.
Is pen worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of pen.