CppCoreGuidelines
CppCoreGuidelines copied to clipboard
should ```cpp be used to quote code samples?
I see we are getting generic code formatting via 4 space indents
void foo() {}
An alternative, that give syntax-highlights, is to use "3 ticks"cpp code "3 ticks"
void foo() {}
should we update all of the samples to use this?
The last one is better and more readable.
gave it a shot colorizing P.1 in gh-pages
it colorizes when viewed on github
https://github.com/isocpp/CppCoreGuidelines/blob/gh-pages/CppCoreGuidelines.md#Rp-direct
but not on gh-pages, generated HTML confusingly says
<div class="language-cpp highlighter-rouge"><div class="highlight"><pre class="highlight"><code class="no-highlight">
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rp-direct
I wonder if we're missing something in _config.yml
there we go, http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rp-direct now shows how it looks with CSS produced by rougify style github
Still, the colors on github's own viewer look much better (they appear to come from https://github.com/primer/github-syntax-theme-generator )
I started on, but did not make much progress on a PowerShell script to find and quote all samples. If others are aware of similar scripts that we could borrow from please share.
@ChrisGuzak maybe that you could implement a custom transform following a regex ? using https://github.com/DavidWells/markdown-magic
note: color highlighting really is important to democratize the guidelines
To be fair, as-is http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html has that "Turn ON Syntax" button that colors it up. But backticks-cpp may still be a good idea