You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... the problem doesn't occur with the mkdocs or readthedocs themes
... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
... the documentation does not mention anything about my problem
... there are no open or closed issues that are related to my problem
Description
Hello everyone and thanks for this very nice package here!
I witnessed a possible bug where my code annotations are not always shown correctly. This happenend in large c++ code blocks.
Expected behaviour
The code annotations should be resolved correctly.
Actual behaviour
The code annotations are not resolved
but if i remove a bit of the c++ code the code annotations are resolved.
Steps to reproduce
My very condensed mkdocs.yml file looks like se below at configuration
I have the following markdown file "examples/integrate_pi.md" with c++ code:
```cpp
#include <numbers>
#include <dune/alugrid/grid.hh>
#include <dune/geometry/quadraturerules.hh>
#include <dune/grid/io/file/vtk/vtkwriter.hh>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <ikarus/Grids/GridHelper/griddrawer.h>
int main() {
constexpr int gridDim = 2; // (1)
using Grid = Dune::ALUGrid<gridDim, 2, Dune::simplex, Dune::conforming>;
auto grid = Dune::GmshReader<Grid>::read("../../examples/src/testFiles/circleCoarse.msh", false);
auto gridView = grid->leafGridView();
draw(gridView);
/// Calculate area from volume function of elements
double area1 = 0.0;
for (auto& element : elements(gridView))
area1 += element.geometry().volume();
/// Integrate function using integration rule on grid
auto f = [](auto&& global) { return sqrt(global[0] * global[0] + global[1] * global[1]); };
double area2 = 0.0;
for (auto& element : elements(gridView)) {
const auto& rule = Dune::QuadratureRules<double, 2>::rule(element.type(), 1, Dune::QuadratureType::GaussLegendre);
for (auto& gp : rule)
// area2 += element.geometry().integrationElement(gp.position()) * gp.weight();
area2 += f(element.geometry().global(gp.position())) * element.geometry().integrationElement(gp.position())
* gp.weight(); // integrationElement --> JacobiDeterminant
}
std::cout << area1 << " " << area2 << std::endl;
/// Naive refinement of grid and compare calculated area to pi
for (int i = 0; i < 3; ++i) {
area1 = 0.0;
grid->globalRefine(1);
auto gridViewRefined = grid->leafGridView();std::cout << "This gridview contains: ";std::cout << gridViewRefined.size(0) << " elements" << std::endl;draw(gridViewRefined);for (auto& element : elements(gridViewRefined)) { area1 += element.geometry().volume();}
}
}
```
1. Create ALUGrid from gmsh file.
Now the code annotation is not resolved:
If i remove the block from the end :
for (int i = 0; i < 3; ++i) {
area1 = 0.0;
grid->globalRefine(1);
auto gridViewRefined = grid->leafGridView();
std::cout << "This gridview contains: ";
std::cout << gridViewRefined.size(0) << " elements" << std::endl;
draw(gridViewRefined);
for (auto& element : elements(gridViewRefined)) {
area1 += element.geometry().volume();
}
}
the code annotation is resolved correctly
Package versions
Python: python3 --version --> Python 3.9.10
MkDocs: mkdocs --version --> mkdocs, version 1.2.3 from /home/alex/.local/lib/python3.9/site-packages/mkdocs (Python 3.9)
Thanks for reporting. This seems to be a side effect of the fix added in #3643 as of which code blocks are only mounted when they become visible. The problem was that the intersection threshold was set to 1, which means element becomes 100% visible, which for a code block of this size was never the case, as it was always either cut off at the top or bottom. Thus, the code block (and as a result annotations) were never mounted. This is also why when you removed some lines, the annotations suddenly started working.
88cfda4 sets the threshold to 0 which means that the code block is mounted the moment it becomes visible.
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
Hello everyone and thanks for this very nice package here!
I witnessed a possible bug where my code annotations are not always shown correctly. This happenend in large c++ code blocks.
Expected behaviour
The code annotations should be resolved correctly.
Actual behaviour
The code annotations are not resolved
but if i remove a bit of the c++ code the code annotations are resolved.
Steps to reproduce
My very condensed mkdocs.yml file looks like se below at configuration
I have the following markdown file "examples/integrate_pi.md" with c++ code:
Now the code annotation is not resolved:
the code annotation is resolved correctly
Package versions
python3 --version
--> Python 3.9.10mkdocs --version
--> mkdocs, version 1.2.3 from /home/alex/.local/lib/python3.9/site-packages/mkdocs (Python 3.9)pip show mkdocs-material | grep -E ^Version
--> Version: 8.2.5Configuration
System information
The text was updated successfully, but these errors were encountered: