GithubHelp home page GithubHelp logo

davidmyersdev / ink-mde Goto Github PK

View Code? Open in Web Editor NEW
182.0 182.0 12.0 129.08 MB

A beautiful, modern, customizable Markdown editor powered by CodeMirror 6 and TypeScript

Home Page: https://stackblitz.com/fork/github/davidmyersdev/ink-mde/tree/main/examples/template-ts?file=src/main.ts

License: MIT License

HTML 2.05% TypeScript 87.49% Vue 1.26% CSS 6.13% JavaScript 1.79% Svelte 1.28%
codemirror extensible hacktoberfest javascript markdown mde plugins typescript vim vue

ink-mde's Introduction

Hi. I'm David (he/him). ✌🏻

A little bit about me.

Connect on LinkedIn Follow me on Twitter Join my Discord community Sponsor me Donate

ink-mde's People

Contributors

collinherber avatar davidmyersdev avatar demetrius-mp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ink-mde's Issues

Ability to Get Codemirror Instance

Is there any way I can get the Codemirror instance from Ink MDE?

I'm likely missing something, but if there isn't this feature already, this will be very useful. Thank you for the awesome project!

Inline syntax highlighting is broken in the latest version(s)

It looks like recent changes to reduce the final package size have omitted whatever code/files were necessary for the inline Markdown syntax highlighting. I recently updated the version of Ink that I use and pointed at https://cdn.jsdelivr.net/npm/[email protected]/+esm and just noticed that the inline Markdown styles no longer work. I had to go back a few versions to find one that jsdelivr would serve (other recent versions run into the issue where they exceed 100MB); it looks like https://cdn.jsdelivr.net/npm/[email protected]/+esm is the most recent working version that is also small enough for jsdelivr to serve up.

Editor broken when used with Shadow DOM

It appears the editor is broken when you attempt to create a Web Component out of it that leverages the Shadow DOM. Is there a know way to make Ink compatible with this use?

Update checkbox styles

Checkboxes should match the container background color (or be closer in color) with a border that provides a high contrast with the background.

Allow opt-out/opt-in for language specific syntax library

We use Ink-MDE in a Vue.js app as a Markdown editor for its wonderful wysiwyg-syntax-highlighting. When building the project (yarn build), I noticed more than forty dependencies, most of which are specific to a certain programming language. At the end, yarn printed a warning:

(!) Some chunks are larger than 500 KiB after minification. Consider:

I would like to be able to restrict the language-dependencies bundled into my app to the one I need, Markdown in our case. As this relates to bundle size, I imagine other users, too, to appreciate the possibility to reduce the supported languages to only the subset needed. Could this be a future feature—or is there already a way to do this?

Add KaTeX support

I feel like this would be a really nice feature and I use it daily, at least maybe highlighting $ and $$ signs would be nice.

(This is obv just an enhancement that I would rly appreciate)

Bottom border for headers

First of all thanks for this awesome editor. This is already the 3rd I'm trying out, best so far.

I've tried to add bottom borders to the h1 and h2 elements inside the editor:

image

So I've checked, they have

<div class="cm-line"><span class="ͼ14 ͼ1i">#</span><span class="ͼ14"> Header 1</span></div>
<div class="cm-line"><span class="ͼ15 ͼ1i">##</span><span class="ͼ15"> Header 2</span></div>
<div class="cm-line"><span class="ͼ16 ͼ1i">###</span><span class="ͼ16"> Header 3</span></div>

So there is the css I've come up with:

.cm-line:has(.ͼ14), .cm-line:has(.ͼ15) {
  padding-bottom: .3em;
  border-bottom: 1px solid #eaecef;
}

Afterward I've noticed that after deploying the code the class name changed:

<div class="cm-line"><span class="ͼl ͼy">##</span><span class="ͼl"> Header 1</span></div>

Is there a way to add the bottom borders?

Is there a way to use CodeMirror's `placeholder` extension?

Hello! First off, thank you so much for Ink. I've been wanting to plug a markdown editor into my personal Rails site for a while and was dreading it, but I couldn't believe how easy it was to put Ink into an import map and just plug it in.

I was wondering if there's an out-of-the-box way to use CodeMirror 6's placeholder extension to get a… well, placeholder into my editor 😄 It's easy enough to provide an initial doc but it would be even better to get true placeholder functionality so that it isn't considered content and is automatically overridden as soon as content is typed in.

Add markdown toolbar

Hi!

This is an idea, actually.

In my experience, markdown is simple but scary for newbies. Toolbars help new users to learn markdown. You could go one step ahead and hide the markup on element blur, as they are drawing a lot of attention right now.

Thank you!

Input lag on Safari

My college noticed a severe input lag on Safari 17.1.2 on macOS Sonoma 14.1.2 spec: Macbook Pro 2018 15" i7, 32 GB

It doesn't happen on Chrome on the same computer.

We have also tested the editor https://octo.app/docs/new with more or less the same result.

I guess it's because recalculating styles each keypress is quite expensive. Could we introduce debounce time before recalculating the styles?

Add SSR support

To better support the migration of Octo to Nuxt 3, Ink should support being included in an SSR context. Full SSR support (server-side initialization) will happen later.

Bug: Toolbar Actions Don't Work Expectedly When No Selection

Summary

When you use the toolbar to perform an action with nothing selected, the default should not be to select whatever has changed, but rather to put the cursor into a position which can edit that change.

For example, when I click Bold on the toolbar, it should automatically put double asterisks around my current cursor position. Rather, it creates 4 asterisks and selects all of them.

custom/external formatting toolbar?

Hello!
Great work on ink-mde!

I'm currently integrating it into a React Native project, which loads ink-mde inside of a webview.

Since this will be used on mobile devices, I'd like to create a custom formatting toolbar as an InputAccessoryView on the keyboard.

This makes me wonder: how can/could I externally control formatting options in ink-mde? Is it currently possible to do that?

svelte wrapper

i dont know if you have any interest on a svelte wrapper for this component, but i have created the following ink-mde-svelte package. Also published on npm.

if you want to move it to this repo, or move it to your account, i'd be happy to help.

Consolidate UI tooling

The UI layer is currently split between Svelte and Sinuous. While I like Sinuous more than Svelte (for the interoperability with TS and non-UI modules), I think SolidJS is actually going to be a great replacement for them both.

List indentation with tabs

I often use outlines to organize my notes. One little thing is that I can easily create a list, but when I want a sublist, things get difficult.

As a user, I expect that I can hit tab to indent a list item, but this doesn't work. Instead, I have to backspace to delete the new list item, then tab a few times, and then start a new list item. This works and new items will be indented, but this is a bit of a drag and disrupts the note-taking flow.

Ideally, when it hit tab on a list, it indents the whole line, not the text inline. It would also be nice if the sub items had a different bullet style, but that isn't super important today.

Allow a text element to be supplied in constructor

For better progressive enhancement, a text element should be an acceptable "parent" element. It might require some investigation, but a naive approach, for now, would be to replace that element with a normal container (such as a div).

Support smart punctuation

When GFM is involved, a common parsing/formatting option is to allow support for smart punctuation, so it would be nice to be able to configure Ink to use smart quotes/punctuation for writing and editing markdown, updating as punctuation, quotes, or matching quote-pairs are found. For example:

  • "Hello, world!" they exclaimed. ➡️ “Hello, world!” they exclaimed.
  • That's a smart looking apostrophe. ➡️ That’s a smart looking apostrophe.
  • The 's' is silent. ➡️ The ‘s’ is silent.
  • 2020--2022 was a bad time. ➡️ 2020–2022 was a bad time.
  • I wondered---out loud---if they were being serious. ➡️ I wondered—out loud—if they were being serious.
  • You don't say... ➡️ You don’t say…
    • I think this one isn't usually included, but it's the other "smart punctuation" I miss that other editors or modern operating systems do for you 😅

How Do I get an instance object of codemirror from AwaitableInstance

Hi there, great project you've built here.

I created an ink instance using the following method:

const editor = ink(document.getElementById('editor')!, options)

But how can I obtain the object of the codemirror editor?
For example, I need to call the cm.getDoc().getCursor() method of codemirror to obtain the current cursor position, etc. to use the https://github.com/susisu/mte-kernel provided Table tools

It needs to implement the following interfaces:
image

So can you tell me how to obtain the instance of codemirror from AwaitableInstance, or is there any other way,look forward your prompt reply.♥️

cant install ink-mde when using svelte 4

most likely due to

"svelte": "^3.0.0",

what do you think of instead of providing a component for the framework (such as svelte or vue), just providing a "copy-pastable" component (since it is very likely that a wrapper will fit in a single component, no matter the framework), which could be shown in the readme, for example? one clear benefit is that version conflicts would never occur.

i believe this is a plausible approach, given that the core of the package itself (i.e. the ink export from the package) works in native js.

another approach to avoid version conflicts would be to provide the framework-specific components in a separate package, such as @ink-mde/svelte or @ink-mde/vue. however, probably not worth the effort

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.