-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
Description
Contribution guidelines
- I've read the contribution guidelines and wholeheartedly agree
I've found a bug and checked that ...
- ... the problem doesn't occur with the
mkdocsorreadthedocsthemes - ... the problem persists when all overrides are removed, i.e.
custom_dir,extra_javascriptandextra_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) - Material:
pip show mkdocs-material | grep -E ^Version--> Version: 8.2.5
Configuration
# Project information
site_name: test
# Configuration
theme:
name: material
features:
- content.code.annotate
# Path where the markdown files are
docs_dir: 'website'
# Navigation
nav:
- Examples:
- Integrate pi: examples/integrate_pi.md
# Extensions
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfencesSystem information
- Operating system: debian bookworm inside Windows WSL
- Browser: Brave and FireFox tested
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open