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

Rendering the canvas? #1

Open
liquidcarbon opened this issue May 13, 2024 · 4 comments
Open

Rendering the canvas? #1

liquidcarbon opened this issue May 13, 2024 · 4 comments

Comments

@liquidcarbon
Copy link

Hi, maybe a silly question...how do you render the resulting canvas?
Is there an HTML template with a CDN link to canvas.js or the like?

Thanks!

@DangerDrome
Copy link

DangerDrome commented Jul 8, 2024

ha, yeah I was just about to ask the same thing!
do I need to parse the output to or something?

  • also where are the docs?

@rcmckee
Copy link

rcmckee commented Aug 14, 2024

Hi, maybe a silly question...how do you render the resulting canvas?

Is there an HTML template with a CDN link to canvas.js or the like?

Thanks!

I exported the json string to a canvas.canvas file. Next I moved that file to my obsidian folder. You should see the canvas in the obsidian app.

The closest documentation is just reading the code files here.


# Save the canvas as JSON
json_str = canvas.to_json()
# save it to a file
with open("canvas.canvas", "w") as f:
    f.write(json_str)

@dh1011
Copy link
Contributor

dh1011 commented Aug 29, 2024

ha, yeah I was just about to ask the same thing! do I need to parse the output to or something?

* also where are the docs?

Hi, I created a PR for the docs here #2

@CheeksTheGeek
Copy link
Owner

Hi @liquidcarbon and @DangerDrome, this library is not meant to be a complete solution for Obsidian Canvas (which would include rendering and live-editing the canvas files as well), instead it's supposed to be for interfacing with the file format as per the specification given here.

P.S. @rcmckee's solution to your problem about how to view the Canvas files in their rendered mode.

If you still, really want a rendering solution out of this, which I can see why, since then the library could be used as a scriptable rendering solution, please let me know, and I would start working in that direction!

I myself love it when I want to build something but I think it'd be really hard to build it from scratch, but lo' and behold, there's a python library for most of the subparts, so I'd love to support whatever you want to build with such a solution.

I do want to give a fair warning, that I can't guarantee the speed of achieving this task, as it'll either be a PyOpenGL, or a more-interactive Qt based GUI solution, but in either direction, some design will be required, and I'm current in-between a university study term till December, which would hold my speed back a bit, but if someone looking at this thread's up for collaborating or taking a big part out of the process, I'm okay with it!

Sincerely,
chsh

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

5 participants