Open tiagorangel1 opened 5 months ago
@tiagorangel2011 I'm not sure what you mean. The core library is already built to work with vanilla JS.
That's wonderul news.
Could you perhaps create a tiny example for that use case? How would I use the library to generate a minimal text area and UI?
Using the HTML provided in the README results in a error (see #87)
<div id="editor"></div>
<script type="module">
import { ink } from 'https://esm.sh/ink-mde@0.22.0';
ink(document.getElementById('editor')!);
</script>
Using the HTML provided in the README results in a error (see #87)
<div id="editor"></div> <script type="module"> import { ink } from 'https://esm.sh/ink-mde@0.22.0'; ink(document.getElementById('editor')!); </script>
Yes, that was the exact same issue I was having: https://github.com/davidmyersdev/ink-mde/issues/87
@tiagorangel2011 @flatsiedatsie it sounds like there might be an issue with the esm.sh service then. If you install it via NPM, I think it would work. I'll open this back up to investigate that service though.
Wonderful, thank you!
Would it perhaps be possible to provide a single-file version of the library? For privacy protection reasons I can't use a CDN, the library files must be provided from the same server as the rest of the project. I've tried downloading the files form ESM, but that's quite hard to do, because it links to many other files, and those link to yet more files, etc.
@flatsiedatsie a single file version might be possible, but it would be pretty large due to the various dynamic imports that are used for code block language parsers, optional features, etc. It'd be better to install it via NPM and bundle it with something like Vite if that's possible.
how am I supposed to link it after installing with npm? this:
<div id="editor"></div>
<script type="module">
import { ink } from '/node_modules/ink-mde/dist/index.js'
ink(document.getElementById('editor'))</script>
plus basic HTTP server returns in error Uncaught TypeError: The specifier “solid-js/web” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.
sorry I'm kinda of a noob when it comes to this kind of stuff. I really don't want to use anything like vite
@davidmyersdev Thanks
It'd be better to install it via NPM and bundle it with something like Vite if that's possible.
Unfortunately that's not possible. I'm trying to integrate it into an existing plain JS project. And like the poster above, I know nothing about Vite either.
it would be pretty large due to the various dynamic imports
That's no issue. The project loads multiple gigabytes of AI files (.gguf) to the browser, so large is very relative in my case :-)
I would love to use this, but the app I'm working on uses vanilla javascript. No frameworks, no fancy stuff.