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

Is it possible to execute @example bocks of different MD files in different processes? #2611

Closed
peremato opened this issue Nov 25, 2024 · 7 comments

Comments

@peremato
Copy link

I am documenting a package using a set of Markdown files (examples) that include @example blocks. This package interfaces with a C++ library, which is highly sensitive to proper cleanup and re-initialization due to extensive use of global variables on the C++ side.

Is it possible for the @example blocks in each .md file to be executed in separate Julia processes? While I understand they run in isolated namespaces, this isolation is not sufficient for my use case.

Thank you for your help!

@goerz
Copy link
Member

goerz commented Nov 25, 2024

No, this is not currently possible.

You might want to look at Literate.jl, which would allow you to run a document in a standalone process, and save the result as an .md file with both the inputs and output, suitable for inclusion in Documenter.

@fredrikekre
Copy link
Member

Why can't you clean up at the end of the file?

@peremato
Copy link
Author

You might want to look at Literate.jl, which would allow you to run a document in a standalone process, and save the result as an .md file with both the inputs and output, suitable for inclusion in Documenter.

Thanks very much. This is what I am currently doing executing Literate in a standalone progress.

@peremato
Copy link
Author

Why can't you clean up at the end of the file?

Unfortunately not. There are singletons that will keep some history in the next .md file.

@fredrikekre
Copy link
Member

So it is a limitation of th C++ code that you can't cleanup and restart in the same process? Then I think your current best bet is to use Literate for execution.

@peremato
Copy link
Author

peremato commented Nov 25, 2024

Thanks. Yes, it is a limitation in the C++ side. I was hoping to have a solution in Julia to overcome the limitation. I can close the issue.

@fredrikekre
Copy link
Member

Ok, so then something like #2577 wouldn't really help you either.

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

3 participants