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

Feature request: Add support for Pikchr #515

Closed
arthurbarr opened this issue Dec 3, 2020 · 6 comments
Closed

Feature request: Add support for Pikchr #515

arthurbarr opened this issue Dec 3, 2020 · 6 comments
Labels
💡 proposal 🍩 enhancement New feature or request

Comments

@arthurbarr
Copy link

arthurbarr commented Dec 3, 2020

Could you please consider adding support for Pikchr?

@ggrossetie
Copy link
Member

Hey @arthurbarr
I actually did consider Pikchr but I couldn't find a pre-built binary. It was also unclear how to get the sources of this project: https://pikchr.org/home/dir?ci=tip 🤔

Any idea?

@arthurbarr
Copy link
Author

It appears to be using Fossil for source code management. You can get the source doing something like this:

fossil clone https://pikchr.org pikchr
fossil open ./pikchr

I don't think there's a pre-built version, as it's just a single C file, with a single function as the entrypoint. So integrating would appear to mean pulling down the latest C file, and then invoking the C function from kroki.

@arthurbarr
Copy link
Author

@bugsbugsbux
Copy link

@arthurbarr i found that fossil complains with your approach of opening the repo. its easier to just create a new folder for the checkout:

fossil clone https://pikchr.org pikchr
mkdir pikchr-checkout
cd pikchr-checkout
fossil open ../pikchr

but there's actually no need to use fossil at all:
just get the preprocessed c file from https://pikchr.org/home/file/pikchr.c
and compile as the Makefile says:
gcc -O0 -g -Wall -Wextra -DPIKCHR_SHELL pikchr.c -o pikchr -lm

ggrossetie added a commit to ggrossetie/kroki that referenced this issue Jan 24, 2021
@ggrossetie
Copy link
Member

For reference, Pikchr now has an official GitHub mirror: https://github.com/drhsqlite/pikchr

but there's actually no need to use fossil at all:
just get the preprocessed c file from pikchr.org/home/file/pikchr.c
and compile as the Makefile says:
gcc -O0 -g -Wall -Wextra -DPIKCHR_SHELL pikchr.c -o pikchr -lm

I can confirm that the following is working fine, thanks 👍

Now the only blocker is that the CLI does not seem to read diagram from stdin (and I don't want to write temporary files on the disk). I never wrote C code but I will see what I can do...

If someone is familiar with C and/or knows how to implement this feature please come forward! The entry point seems to be: https://github.com/drhsqlite/pikchr/blob/91f0247783fc7ae7941f3ec5dd9747518c345b91/pikchr.c#L7716

@ggrossetie
Copy link
Member

Gave it a try: drhsqlite/pikchr#1

@ggrossetie ggrossetie added 💡 proposal 🍩 enhancement New feature or request labels Jan 26, 2021
ggrossetie added a commit to ggrossetie/kroki that referenced this issue Feb 6, 2021
ggrossetie added a commit to ggrossetie/kroki that referenced this issue Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 proposal 🍩 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants