सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
CodeMirror टेक्स्ट एडिटर के लिए एक डार्ट वैपर, जो फ्लटर वेब एप्लिकेशन में धन्यवाद समृद्ध कोड एडिटिंग क्षमता प्रदान करता है। यह व्याकरण हाइलाइटिंग, लाइन नंबरिंग और कस्टमाइज़ करने योग्य थीम प्रदान करता है, ब्राउज़र में सीधे शक्तिशाली CodeMirror लाइब्रेरी का उपयोग करता है। यह पैकेज इंटरैक्टिव कोड एडिटर, आईडीई-जैसी विशेषताएं या किसी भी ऐप के लिए आदर्श है जिसमें भाषा-विशिष्ट व्याकरण समर्थन के साथ उन्नत टेक्स्ट एडिटिंग की आवश्यकता हो। वेब-केवल फ्लटर प्रोजेक्ट्स के लिए एकीकरण निरंतर है, जिससे एक परिचित और कार्यक्षम संपादन अनुभव सुनिश्चित होता है।
उपयोग
वेब-आधारित कोड संपादक
इंटरैक्टिव कोडिंग ट्यूटोरियल
IDE-जैसी वेब एप्लिकेशन
रियल-टाइम कोड सहयोग
वाक्यांश-उच्चारण इनपुट क्षेत्र
मुख्य विशेषताएँ
व्याकरण उच्चारण
लाइन नंबरिंग
कस्टमाइज़ किए गए थीम
ब्राउज़र-आधारित रेंडरिंग
CodeMirror प्लगइन्स के माध्यम से विस्तार्य
इनके लिए उपयुक्त
Flutter web विकासकर्मी
शैक्षिक प्लेटफॉर्म
कोड साझाकरण टूल्स
डेवलपर टूलिंग
वेब-आधारित आईडीई
विचार योग्य बातें
वेब-केवल प्लेटफॉर्म समर्थन
JavaScript इंटरॉप की आवश्यकता है
ब्राउज़र वातावरण में सीमित
बाह्य CodeMirror लाइब्रेरी पर निर्भर
बंडल आकार में वृद्धि हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
codemirror.dart
What is it?
A Dart wrapper around the CodeMirror text editor. From
codemirror.net:
CodeMirror is a versatile text editor implemented in JavaScript for the
browser. It is specialized for editing code, and comes with a number of language
modes and addons that implement more advanced editing functionality.
Note: This is NOT a Flutter package, it is a Dart package for writing web applications
like DartPad.
An example
final options = <String, String>{
'mode': 'javascript',
'theme': 'monokai'
};
final editor = CodeMirror.fromElement(
document.querySelector('#textContainer')!, options: options);
editor.doc.setValue('foo.bar(1, 2, 3);');
This Dart package ships with several language modes built in. CodeMirror itself
supports over 100 modes; the modes built into the Dart package include the
usual suspects for web development - css, html, dart and javascript as
well as a few
others.
In order to add additional modes, you'll need to reference the mode file from
your html entry point. So,
Similarly with addons, we've included a few common ones, and have made the
others available to import on a case-by-case basis. In order to use the
active-line addon, import:
Be aware that many addons need additional configuration in order to enable then.
This is generally done by passing values into the options of the CodeMirror
constructor.
Some addons are exposed through the main Dart interface. Some are exposed via
side-car Dart libraries available in the main
package, and some
have yet to be exposed. Pull requests welcome :)
You get access to all the CodeMirror themes. If you only want a few, or don't
want to pay the network roundtrip cost to load all the themes, you can import
only the ones you're interested in: