benweet / stackedit.js

Add StackEdit to any website
https://benweet.github.io/stackedit.js/
MIT License
1.08k stars 119 forks source link

How to set workspace? #40

Open Fantantonio opened 2 years ago

Fantantonio commented 2 years ago

Is there a way to set the workspace where to open and store the generated file?

Everytime I run this code (same provided by you):

const el = document.getElementById("text-content");

const stackedit = new Stackedit({
    url: "https://stackedit.io/app"
});

const openWritingEditor = function () {
    stackedit.openFile({
        name: 'Filename',
        content: {
            text: el.value
        }
    });
}

stackedit.on('fileChange', (file) => {
    el.value = file.content.text;
});

A new "Filename" file is generated on the default workspace but I'd like it to appear in another workspace. I tryied to change the "https://stackedit.io/app" with the workspace url but nothing changes.

Is there a way to do it? Otherwise it would be a really useful feature to add IMO