SaswatPadhi / pseudocode.js

Beautiful pseudocode for the Web
https://saswatpadhi.github.io/pseudocode.js
MIT License
224 stars 33 forks source link

Add some javascript code to automatically find and replace blocks. #3

Closed freemo closed 2 years ago

freemo commented 7 years ago

I had to write some generic javascript in order to use what you wrote to find the blocks of pseudocode, render them, and remove the old ones. Seems to me this can be included as a small helper javascript method that does all that. I have some code that will find any and all blocks in a webside, delete it and replace it with the rendered code in the same place as the original block. You can see the javascript code and incorporate it into this code if you'd like. Here is a link and an explanation to my javascript to solve this.

http://jeffreyfreeman.me/latex-inspired-rendering-of-algorithms-in-html/

tatetian commented 5 years ago

I am happy to see pseudocode.js deployed on and useful to your blog.

I think that the helper function that you proposed makes sense and could be convenient. But the helper function imposes on the users a specific way to use pseudocode.js. And I am not entirely sure that it is the most desirable way to use pseudocode.js. I think the users can write the glue code to use pseudocode.js themselves easily, which may or may not be the way you proposed.

I try to maintain this project with a minimal effort. So I won't make changes actively. And I am sorry for the long response latency :)

SaswatPadhi commented 2 years ago

Thanks @freemo for this proposal and the example code.

I believe #32 implements a very similar idea (thanks to @zcysxy for the PR). So, I am going to mark this issue as resolved.