justinmeiners / efficient-programming-with-components

Course notes for Alexander Stepanov's teachings on design and usage of C++ STL.
https://www.jmeiners.com/efficient-programming-with-components/
74 stars 6 forks source link

fix item numbering in chapter 8 #27

Closed aharrison24 closed 2 years ago

aharrison24 commented 2 years ago

Currently the numbered list in chapter 8 has the incorrect number against the 4th entry, because the markdown processor interprets it as a new list and starts the numbering at 1 again.

There doesn't seem to be any trivial way of marking up the list so that it starts at 4. discount doesn't seem to accept the {:start="4"} syntax that you can use with some other markdown processors.

This PR resorts to using some inline HTML to solve the problem. I suspect that might be unpalatable, so please feel free to summarily reject it! :-)

A different way of achieving more or less the same effect would be to use inline HTML to generate the list entry manually, like this:

&emsp;<span>4.</span> `free`: manually release/free a pair.</br>

It works... but it's probably less robust to changes in the CSS.

🤷

justinmeiners commented 2 years ago

You're right that all these solutions sound terrible. I think I found the hack I prefer:

&nbsp;&nbsp;&nbsp;4. `free`: 
aharrison24 commented 2 years ago

Ah OK, the span tags don't actually add anything in this case do they. That'll teach me for cargo-culting code without taking the time to actually engage my brain.

One &emsp; or 3x &nbsp; looks like the least worst options!

justinmeiners commented 2 years ago

I didn't know about &emsp;. I'll give that a try.