Giter VIP home page Giter VIP logo

Comments (8)

kookma avatar kookma commented on May 23, 2024 1

Hi @linonetwo! good idea! I will add some snippets!
just let me to find some free time! I added this to todo list!

from tw-shiraz.

linonetwo avatar linonetwo commented on May 23, 2024 1

Maybe should have both $:/CodeMirrorEnhanced/SnippetsList and $:/tags/TextEditor/Snippet

So it can be in both cme / menu and official snippet menu.

from tw-shiraz.

Gk0Wk avatar Gk0Wk commented on May 23, 2024 1

CME can read system snippets, too. If you write both types of them, snippets may appear twice. So should just write system snippets.

from tw-shiraz.

linonetwo avatar linonetwo commented on May 23, 2024

ζˆͺ屏2021-11-03 上午12 03 00

We can use snippets like this, using / command.

from tw-shiraz.

linonetwo avatar linonetwo commented on May 23, 2024

@Gk0Wk can we let 3rd party snippet have preview (usage demo) field too?

from tw-shiraz.

Gk0Wk avatar Gk0Wk commented on May 23, 2024

@linonetwo yes, but the CME plugin missing a lot of documents. That is the problem.

@kookma If you would like to add some snippets, just add a tiddler with the type of application/json and the tag of $:/CodeMirrorEnhanced/SnippetsList in your plugin, then the CME plugin will find it. The format of this tiddler can be found here:

  • The id is the unique identifier of the snippet, entering /<id> will display the corresponding snippet;
  • name is the name and title of the snippet, not necessarily unique;
  • preview is the preview effect of the snippet, when the snippet is selected in the hint of the CME plugin, it will be rendered in the preview box on the right.
  • Note that both name and preview can support i18n (multi-language), the i18n property is the multi-language function switch, if needed, I will write the usage in the future document, if not, please set it to false for now.
  • snippet is the native content of the snippet. In the hint function of the CME plugin, the selected snippet will write the snippet content to the editor, where $x is a placeholder and will be directly replaced by the cursor. The current cursor will only move to $1, and may move to all $1 in the future.

Another way is to use TW's native snippet system. And the snippet-description field is equal to preview attribute. And placeholders $x can also work.

from tw-shiraz.

kookma avatar kookma commented on May 23, 2024

@Gk0Wk - Thank you for the instruction! I will add both!

from tw-shiraz.

linonetwo avatar linonetwo commented on May 23, 2024

@Gk0Wk I think tiddler with fields for both system and cme, and tag for both, can work in both side.

from tw-shiraz.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.