sofish/pen — dự án mã nguồn mở — đang có 4.8k sao GitHub. enjoy live editing (+markdown)
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/sofish/pen là nguồn chính thức.
sofish/pen có bao nhiêu sao?
sofish/pen có 4.8k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/sofish/pen. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
sofish/pen có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho sofish/pen. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
sofish/pen còn đang phát triển không?
Commit gần nhất trên sofish/pen là 8.2 năm trước (theo timestamp GitHub). Repo có 401 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
sofish/pen là gì?
sofish/pen (sofish/pen) là dự án JavaScript trên GitHub. Theo mô tả gốc: enjoy live editing (+markdown)
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về pen?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về pen.