- Folders for recipes are named
chapter-N/recipe-M
, whereN
is the chapter number andM
is a number, i.e.01
,02
, etc. In each chapter we restart the recipe counter. - Each recipe can have more than one example subfolder. These subfolders are
named
*example*
. Any code must reside in these subfolders.
The README.md
files that form the table of contents (main README.md
, chapter README.md
s and recipe README.md
s)
are generated from title.txt
and abstract.md
files.
This means that you should not modify README.md
files but rather only edit title.txt
and abstract.md
files.
To update the README.md
files, run python tools/generate-readmes.py
- this file updates README.md
in place.
We use 2 spaces instead of 4 spaces to reduce the printed page width. No tabs. Get the integration for EditorConfig in your favorite editor to help you keep this convention.
We use lowercase for commands, i.e.:
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
and not:
CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
It is OK to put commands on one line if it improves readability, e.g.:
list(APPEND CXX_BASIC_FLAGS "-g3" "-O1")
For line continuation we use the following style:
target_compile_options(asan-example
PUBLIC
${CXX_BASIC_FLAGS}
${_asan_flags}
)
set(_whathaveyou
item1
item2
item3
)
Start an internal variable (i.e. one that is not exposed to the user) with an underscore:
set(PUBLIC_VARIABLE "this one is exposed")
set(_temp "this one is internal")