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

Rendering issue and Pyodide support #14

Closed
CoinK0in opened this issue Jul 18, 2021 · 3 comments
Closed

Rendering issue and Pyodide support #14

CoinK0in opened this issue Jul 18, 2021 · 3 comments
Assignees

Comments

@CoinK0in
Copy link
Collaborator

Hi,
sorry to bother you. I have tried to use it too, which seems to work. However, no updates, the lateX formulas stay in their lateX form, and the python file using pyodide do not appear, after the password is entered.
For instance

Could you help me ? I tried to do as you say in the readme.md file

Originally posted by @TQuantX in #12 (comment)

@CoinK0in
Copy link
Collaborator Author

No problem, ur welcome.
I need to know the versions of the packages you are using.
Mainly those related to mkdocs pip3 list | grep mkdocs to verify that it doesn't have a version incompatibility.

For the rendering Arithmatex issue when I clone your repo I reproduce the problem of formatting lateX formulas.
However when I don't use your "override" configuration files and I put those of the theme material back by default, I no longer have the problem of rendering on the mathematical functions. I think something is wrong with your current "override" setup.

For the 'pyodide' part, I will be looking at the beginning of the week how it works and what is needed / lacking on my plugin to make it work.

@TQuantX
Copy link

TQuantX commented Jul 19, 2021

Hi, thanks !

For the rendering, indeed, I was looking at the documentation, and it's specified to put them in the "docs" folder. Thanks for this point !

For the pyodide part :

For the packages :

  • mkdocs 1.2.1
  • mkdocs-encryptcontent-plugin 1.1.0
  • mkdocs-enumerate-headings-plugin 0.4.4
  • mkdocs-macros-plugin 0.5.12
  • mkdocs-material 7.1.10
  • mkdocs-material-extensions 1.0.1
  • mkdocs-windmill 1.0.4

If it may help, in your setup, when the decryption is done, for Arithmatex, you unlock the line

{% if arithmatex %}MathJax.typesetPromise(){% endif %}

In this case, the python terminal is in the tag "ide_classe" and similarly in interpreter.js , Pyodide seems to be launched by

async function main() {
await loadPyodide({ indexURL : 'https://cdn.jsdelivr.net/pyodide/v0.17.0/full/' });
}
let pyodideReadyPromise = main();
...

maybe a

{% if ide_classe %} pyodideReadyPromise {%endif%} ?

I took what was done in https://gitlab.com/bouillotvincent/pyodide-mkdocs
Thanks again for your help !

@CoinK0in
Copy link
Collaborator Author

I finally took the time to do something about the problem. I don't really like the way I did it, but it's functional ..

So the problem of loading the python files is related to the loading of the JS functions present in the ide.js file. This ide.js file contains code executed directly on loading, which it is no longer possible to recall after loading the lib.

So I added a feature that allows you to force the reloading some scripts after the decryption process. Reload scripts

I let you try with this new feature. Tell me if you have any troubles.

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

2 participants