erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.05k stars 1.51k forks source link

Fix typo in documentation #676

Closed TerensTare closed 2 years ago

TerensTare commented 3 years ago

I was reading the docs today and came across a small typo on the for loop right before this section: https://box2d.org/documentation/md__d_1__git_hub_box2d_docs_collision.html#autotoc_md41

// Visit each child edge.
for (int32 i = 0; i \< chain.GetChildCount(); ++i) // notice the \<, probably should be <
{
    b2EdgeShape edge;
    chain.GetChildEdge(&edge, i);

    ...
}

I encountered the same typo in the first example of Contact Manifolds

b2WorldManifold worldManifold;
worldManifold.Initialize(&manifold, transformA, shapeA.m_radius,
transformB, shapeB.m_radius);

for (int32 i = 0; i \< manifold.pointCount; ++i) // \<
{
    b2Vec2 point = worldManifold.points[i];
    ...
}
HughPH commented 3 years ago

Backslash (or "Backtick") is used to escape characters that would (or could) otherwise be misinterpreted. In these cases, it's reasonable to expect that < might be misinterpreted as the beginning of a HTML tag in the final output, and so it's been escaped.

https://www.markdownguide.org/basic-syntax/

It looks like the escaping has behaved differently to expectations when producing the HTML documentation in those files.

TerensTare commented 3 years ago

I am not 100% sure, but the characters inside a code block (triple "backtick") should be matched according to the coding language specified. Here is the second code snippet I posted earlier but without the backslash:

b2WorldManifold worldManifold;
worldManifold.Initialize(&manifold, transformA, shapeA.m_radius,
transformB, shapeB.m_radius);

for (int32 i = 0; i < manifold.pointCount; ++i)
{
    b2Vec2 point = worldManifold.points[i];
    ...
}

Once again: I have no idea how doxygen will interpret this. Thank you for the heads up anyway.

erincatto commented 2 years ago

Fixed these, but then found out latest doxygen breaks my image format.

https://github.com/doxygen/doxygen/issues/8462

Looking for a fix.

erincatto commented 2 years ago

Fix here 0535dd1f64b8c1f0448d025bb284eb5cb67bb9b9

Still not happy with images. Lost captions. Hopefully doxygen will fix this.