Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streamline printing workflow #24

Open
fidelthomet opened this issue Aug 2, 2024 · 2 comments
Open

streamline printing workflow #24

fidelthomet opened this issue Aug 2, 2024 · 2 comments
Assignees

Comments

@fidelthomet
Copy link
Owner

No description provided.

@fidelthomet
Copy link
Owner Author

add option to import from file / url

@fidelthomet
Copy link
Owner Author

added option to import stories from json files in 1b730fd

Printing Workflow

1. upload Story JSON to server

see

function upload() {
// storyStore.uploadStory(commandStore.storyId)
storyStore.downloadStory(commandStore.storyId)
}

&

async function uploadStory(id) {
const url = import.meta.env.VITE_STORIES_API_URL
// const story = JSON.parse(localStorage.getItem(`story-${id}`))
const res = await fetch(url, {
method: 'POST',
// body: JSON.stringify({ [`story-${id}`]: story })
body: localStorage.getItem(`story-${id}`)
})
console.log(res)
}

2. have a server endpoint that accepts the json and saves it to a file

this would be fairly easy to set up

3. download and import

on a different machine download the new json file through sftp / scp / …
import the downloaded file in the interface
image

4. open story and print

or save as pdf

Automated Printing Workflow

follow steps 1 & 2, then

  • have a script that watches the directory where the files are added (i.e. in node using fs.watch)
  • use puppeteer to execute steps 3 & 4 programmatically (pdf generation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants