-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Feature request: define static cascade files to display on start #25
Comments
Dockerfile used for running: FROM node:14
RUN git clone https://github.com/parture-org/cascade.page.git
RUN cd ./cascade.page && npm install && npm i -S pathe @nuxt/kit tailwindcss && npm run build
WORKDIR ./cascade.page
CMD npm run generate |
Your initial description sounds like sharing a cascade? Which would entail:
If that is indeed what you want, that's great, and I hope you didn't spend too much time trying to hack something else together. That would also indicate that I need to update the UI to better reflect that what you're describing is very possible! If that's not what you want or you don't want your timeline to be public, you can go down the path you're going down. I would, however, recommend taking advantage of the subpath stuff I've already built for displaying read-only cascades. You'd of course have to substitute your own storage solution. I'm not sure how you could take advantage of localStorage to share timelines, since you'd have to send it down the wire one way or another... you could just as well make a timeline, copy the text you wrote to make it, and tell people to paste it into the editor on cascade.page 😆 I hope that makes sense. If I'm not understanding your request let me know. |
Thanks for the swift reply! The problem is I have a web3 app that cannot be hosted centrally anywhere, so no server. So I have to statically compile cascade.page and host it on Sia Skynet. I would like to just edit a (cascade)-Markdown file in my repository, and that my CI/CD pipeline includes the repo (cascade-)Markdown file in the compilation and generates the static web app with the local file used as the public read-only cascade on every commit. When one saves a cascade from the editor, where does it get stored on the server? Then in theory I could take the result file and put it in the same storage directory with a statically compiled app for distribution. Again, thanks for the work on this app, its really awesome! |
It works! I had to set edittable to false: <Main :edittable="false" /> and add this to index.ts: // import precompiled timelines
// this is an absolute path in Docker but ideally a "precompiled timeline folder" setting is available
import precompiledTimelines from '/map.json';
interface DateInterval {...}
export interface TimeMarker {...}
...
let currentTimelineName = "";
let list = [] as string[];
// populate precompiled timelines
// todo: there should be a better nicer way to this that fits with the business logic
// like in MutationTree::getLocalTimelines()
if (process.browser) {
for (const [timelineName, timeline] of Object.entries(precompiledTimelines)) {
localStorage.setItem(timelineName, timeline + "");
}
currentTimelineName = "main";
list = Object.keys(precompiledTimelines);
localStorage.setItem("timelines", list.join(','))
}
const exampleTimeline = `// Comments start with two slashes: \`//\`
... Now I can define a file with precompiled timelines. Like /map.json: {
"main": "section Education I #Education\n08/2008-05/2012: Psych degree #Education\n02/2010-06/2012: Dispatcher #Work\n\n// Add a shareable google photos link to display images. \n10/2010: Barn built across the street https://photos.app.goo.gl/Er9D81cdiE2tUwDZA\n06/2011-08/2011: Westover Air Reserve Base https://photos.app.goo.gl/NZ5rnGS7vZTXHe7aA #Work\nendSection"
} |
Could we also provide such |
@almereyda I've been thinking about doing something similar, either |
I'm happy if this can be implemented via an additional route on the daemon. Considering a static view of a cascade, the viewer application could also be a "single page app" which does not connect to the daemon, and only ingests information via Btw., which would be the correct mime type and file extension for a Cascade map? I see it's a custom syntax, why some specification may aid here. If that's there, then we don't need to encode |
So I have added the feature to load files via url fragment. The format is I have added a few other things related to local file editing which gets to your other questions. The mime type I'm going with is This doesn't quite resolve the OP's issue but hopefully it's a good start - it at least allows one to host the files nearly anywhere and have markwhen.com display them. |
Awesome! That's indeed a great start. Like this I can get started for displaying single files. But to show multiple files like you do in the demo would still require hosting, correct? In the end it would be nice to have a compile-time solution, or it would get difficult when hosting the app behind a non-referral subdomain, like http://roadmap.domain.com. |
Possibly related to #55 |
I would like to host the Cascade editor as read-only, and preload a few cascades for visitors to look at, since this would function well as a public roadmap. Currently to do so would require hacking the HTML and prefilling the LocalStorage, correct?
Edit: considering that Nuxt can statically render using 'npm run generate' I guess the only thing needed is a way to set context.req.timelineFile when server-side rendering
The text was updated successfully, but these errors were encountered: