jherr / code-differ

Code diff animation tool
14 stars 3 forks source link

Programmatically generate code animation #4

Open falcaopetri opened 1 year ago

falcaopetri commented 1 year ago

Would it be possible to programmatically generate code animations?

As I understand, the keyframes representation from apps/remotion-builder/Code-1-project.json should be easy to be automatically generated, but I'm not sure if it's enough. Nonetheless, it would still require parsing the file as a Project and exporting its animation.

Loading it with the remotion-builder app yields a poorly rendered output, so I haven't grasped it's use so far.

image

Closely related, would it be possible to have a standalone app/CLI/API that e.g. takes some input and just outputs the rendered result? code-differ seems very modular in it's packages, but I'm not sure if it has a clear standalone app/CLI/API entrypoint.

(FYI, I'm a Python developer with little to none js/node/react background)

jherr commented 1 year ago

What that looks like to me is that you are missing the font it thinks it's rendering to. There are only a limited number of fonts it renders to and adjustments are made on a per-font basis.

As for the remotion-builder option, that came in late as I decided to OSS the project. Unfortunately I couldn't find an easy way to get remotion to dynamically build from code, so you needed to generate the json and then from there do the remotion. It's possible the situation has changed, I think there have be several releases of remotion in the meantime.

Unfortunately I don't have any time to fix issues in this code. So if you want to get things fixed you'll most likely have to learn TS or find a TS/React/Node developer to work with.