SaswatPadhi / pseudocode.js

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

Rendering problem in markdown and Jekyll #13

Closed Alanthink closed 5 years ago

Alanthink commented 5 years ago

Hi Tate,

Thanks for the project. I am using it in my own blog built with Jekyll and Minimal theme. When I put the following raw html code in the middle of Markdown file

<pre id="ts" style="display:none">
\begin{algorithmic}
\PRINT \texttt{'hello world'}
\end{algorithmic}
</pre>

<script type="text/javascript">
    var testExamples = document.getElementById("ts").textContent;
    pseudocode.render(testExamples, document.body, {
        lineNumber: true,
        noEnd: false
    });
</script>

the output html will put the algorithm in the end of the post like the following:

image

I will appreciate it a lot if you can provide some helpful suggestions.

Thanks,

Chao

Alanthink commented 5 years ago

I have found the reason. I need to change the second parameter of pseudocode.render to the element I want my algorithm to be placed at.

mendax1234 commented 5 months ago

@Alanthink How do you render pseudocode.js in your the minimal theme? Can provide some hints for me. Currently I am stuck at it. Thanks for any help!