How to render math formula on the protected page
luzai opened this issue · comments
Hi, thank you very much for this plugin!
I would like to use it to protect some technical reports with math formulas, however, after entering the password, the formula cannot be rendered and is shown as raw text. Without password protection, the formula can be rendered. May I ask how to render math formula on the protected page?
Thanks for your feedback.
This plugin encrypts the content of a page after the Markdown text is rendered to HTML.
The HTML before and after decryption must be the same, so maybe you use some JavaScript to render your formula ?
If this assumption is correct, there is no way in the current version, but i can try to do something in decrypt-form.tpl.html
Could you give me other information on how the rendering of formulas works on your site ?
Maybe some examples that I can reproduce on my side to work on it.
Thanks.
Thank you very much for your reply!
I prepare a simple example here https://luzai.github.io/test-encrypted/, the password is 123456. The corresponding repo is https://github.com/luzai/test-encrypted.
Thank you.
I added a detection of the Arithmatex module which, if present, should relaunch the rendering of the math equations.
No additional configuration is needed for Arithmatex support.
Version 0.0.13 improve math equation rendering.
All comments, improvements, corrections are welcome because I only validate the operation on the generic
part of Arithmatex.
Thank you very much! I tested the new version with Arithmatex support, it renders the math equation successfully!
I close this issue but feel free to reopen it or open an other one, if you have any trouble with this extension :)
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
- https://tquantx.gitlab.io/nsi_en_ligne/maths.html > pwd : maths for the maths formula
- https://tquantx.gitlab.io/nsi_en_ligne/nsi_terms/chpKNN/KNN.html > pwd : KNN where python code should appear in the last box
my configurations files are - https://gitlab.com/TQuantX/nsi_en_ligne/-/blob/master/mkdocs.yml
- https://gitlab.com/TQuantX/nsi_en_ligne/-/blob/master/.gitlab-ci.yml
Could you help me ? I tried to do as you say in the readme.md file