libigl / libigl.github.io

Repository for the libigl website, online tutorial and documentation
http://libigl.github.io
4 stars 30 forks source link

code blocks are not being rendered correctly #57

Closed daangoossens22 closed 2 years ago

daangoossens22 commented 2 years ago

On the website, the code blocks are not being rendered correctly, but when it is deployed locally with mkdocs serve it is. See images below:

from https://libigl.github.io: Screenshot_02-05-2022-030406

from localhost using mkdocs serve Screenshot_02-05-2022-030444

From comparing the generated site in the master branch to the locally generated one, it seems that the ```cpp``` codeblocks are indeed not converted correctly. See code snippets below:

from https://libigl.github.io: https://github.com/libigl/libigl.github.io/blob/9a8f08c7199d4064f3cdb273f50da88c79e43436/index.html#L900-L920

from localhost using mkdocs serve

<div class="highlight"><pre><span></span><code><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;igl/cotmatrix.h&gt;</span><span class="cp"></span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;Eigen/Dense&gt;</span><span class="cp"></span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;Eigen/Sparse&gt;</span><span class="cp"></span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;iostream&gt;</span><span class="cp"></span>
<span class="kt">int</span><span class="w"> </span><span class="nf">main</span><span class="p">()</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="n">Eigen</span><span class="o">::</span><span class="n">MatrixXd</span><span class="w"> </span><span class="n">V</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span><span class="mi">2</span><span class="p">);</span><span class="w"></span>
<span class="w">  </span><span class="n">V</span><span class="o">&lt;&lt;</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w">     </span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="w"></span>
<span class="w">     </span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="w"></span>
<span class="w">     </span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="n">Eigen</span><span class="o">::</span><span class="n">MatrixXi</span><span class="w"> </span><span class="n">F</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">);</span><span class="w"></span>
<span class="w">  </span><span class="n">F</span><span class="o">&lt;&lt;</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="w"></span>
<span class="w">     </span><span class="mi">0</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="n">Eigen</span><span class="o">::</span><span class="n">SparseMatrix</span><span class="o">&lt;</span><span class="kt">double</span><span class="o">&gt;</span><span class="w"> </span><span class="n">L</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="n">igl</span><span class="o">::</span><span class="n">cotmatrix</span><span class="p">(</span><span class="n">V</span><span class="p">,</span><span class="n">F</span><span class="p">,</span><span class="n">L</span><span class="p">);</span><span class="w"></span>
<span class="w">  </span><span class="n">std</span><span class="o">::</span><span class="n">cout</span><span class="o">&lt;&lt;</span><span class="s">&quot;Hello, mesh: &quot;</span><span class="o">&lt;&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="o">&lt;&lt;</span><span class="n">L</span><span class="o">*</span><span class="n">V</span><span class="o">&lt;&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
daangoossens22 commented 2 years ago

Seems to be caused by the changes made to the conda environment in 58a301e. I probably didn't have issues locally as I just installed the necessary libraries in a python venv.

jdumas commented 2 years ago

Yeah the problem is caused by pygments 2.12. Pinning the dependency back to 2.11.2 should fix the issue. Should be fixed c549961.