Hey C folks, I have a question. My template has inline SVGs and they make the whole code unreadable. Is there a way to use a directive with a fopen to put the svg content inside it? Something like:

#define LOGO fopen("../assets/logo.svg", "r");

@thomasorus Unfortunately, you can't do that exactly but, you might be able to move your templates over into separate include files or as separate C files (containing the string as global variables).

@leimon Having them into another file as global variables could be a good solution yes! Thanks for suggesting it, do you have any demo of this somewhere?


@thomasorus Umm, if you'd like I could whip up a little example for you later after my kiddos are in bed.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml