Open morlay opened 1 year ago
@morlay Yup, D2 will soon have this. E.g. https://github.com/alixander/test-render/edit/main/README.md
@alixander looks good. but now seems got 403 error when visit directly.
https://api.d2lang.com/render/svg?script=qlDQtVOo5AIEAAD__w==&layout=dagre&theme=101&sketch=1
yes, it's whitelisted to only allow from playground and github right now. Do you have somewhere else specific you'd like to access the api from or are you just testing? @morlay
@alixander
Now just testing, but hope it could be embed in other doc systems in future.
I found kroki already start to support d2 https://github.com/yuzutech/kroki/pull/1414 If d2-playground have github limited, I have to wait the next release of kroki.
Like mermaid.live did
https://mermaid.live/view#pako:eNptkMtqAzEMRX9F0bYzP-BFSqGFppBVt7NRPDcZgx-Jx6aEkH-PxtMuCvHqWjpHIN3YphFseMalIlq8OzllCUMkfW_eWfTb7ctXmqKhT3ifaMkdTemHJIOuqb4-hVfMSlwQmiCZAn7Rpdcr2jdHB7vV7mjXjEartnmO7-gIeDplSNlwxwE5iBt1i9siDFwmBAxsNB5k1jTEu3JSS_q-Rsum5IqO63mU8rfx_-LH6ErKbI7iZy2ifffrqdrF7g9-RmWe
Hope to add
/export/{format}
to render raw svg/pnghttps://play.d2lang.com/export/{format}?script=qlDQtVOo5AIEAAD__w%3D%3D&layout=dagre&theme=8
In this way, we could be easy to back to edit mode, with the shared link.
https://play.d2lang.com?script=qlDQtVOo5AIEAAD__w%3D%3D&layout=dagre&theme=8