Skip to content

Commit

Permalink
Sanitize Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dsieger committed Nov 24, 2019
1 parent fb0dfea commit 679615a
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 167 deletions.
70 changes: 36 additions & 34 deletions docs/codingstyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@ The names of user-defined types such as classes, structs and enums use
`CamelCase` notation. The names of persons such as Cholesky or Delaunay are
properly capitalized as well.

~~~~{.cpp}
```cpp
class SurfaceMesh { ... };
struct Flags { ... };
enum TextureMode { ColdWarmTexture, CheckerboardTexture, OtherTexture };
~~~~
```
### Functions
Function names are written using `snake_case`. All characters are
lowercase. Separate words by underscores.
~~~~{.cpp}
```cpp
class MeshViewer
{
bool load_mesh(const char* filename);
};
~~~~
```

### Variables

Variable names use `snake_case` notation. All characters are lowercase. Separate
words with underscores. Class member variables have an underscore `_` suffix.

~~~~{.cpp}
```cpp
int global_var;

class ExampleClass
Expand All @@ -48,29 +48,29 @@ words with underscores. Class member variables have an underscore `_` suffix.
double member_variable_;
static double static_member_;
};
~~~~
```
_Exception:_ Public members of a `struct` holding just a group of variables
may omit the underscore suffix:
~~~~{.cpp}
```cpp
struct NearestNeighbor
{
Scalar dist;
SurfaceMesh::Face face;
Point nearest;
int tests;
};
~~~~
```

_Exception:_ For the sake of similarity with common mathematical notation, we
sometimes use uppercase letters, e.g., to denote matrices when solving a linear
system:

~~~~{.cpp}
```cpp
Eigen::SparseMatrix<dobule> A(n, n);
Eigen::MatrixXd B(n, 3);
~~~~
```
### File Names
Expand All @@ -89,7 +89,7 @@ The expressions following an `if, else, while, do ... while` or `for` statement
should always be enclosed in braces. The braces enclosing a block should be
placed in the same column, on separate lines.
~~~~{.cpp}
```cpp
if (foo == bar)
{
std::cout << "baz" << std::endl;
Expand All @@ -98,7 +98,7 @@ placed in the same column, on separate lines.
{
std::cout << "barbaz" << std::endl;
}
~~~~
```

### Line Length

Expand Down Expand Up @@ -151,7 +151,7 @@ could look like:
//! \param[in] use_bar toggle to switch method
//! \param[out] results filled with results from foo
//!
//! \returns true on success.
//! \return true on success.
\endverbatim

Another good practice is to document pre- and post-conditions for performing an
Expand All @@ -165,7 +165,13 @@ it implemented in this manner?

### Include Guards

Use the <tt>\#pragma once</tt> compiler directive at the beginning of each
Use the

```cpp
#pragma once
```

compiler directive at the beginning of each
header file in order to protect against multiple inclusion. Although this is not
officially part of the language this feature is supported by all major
compilers and is much more convenient than conventional header guards.
Expand All @@ -175,16 +181,14 @@ compilers and is much more convenient than conventional header guards.
Use the `pmp` namespace in order to avoid conflicts. In source files, do not add
an additional level of indentation due to the namespace:

~~~~{.cpp}
namespace pmp {
class ExampleClass
{
...
};
}
~~~~
```cpp
namespace pmp {
class ExampleClass
{
...
};
}
```

### Boolean Prefixes

Expand Down Expand Up @@ -224,32 +228,30 @@ and the corresponding `.clang-format` configuration file from the repository to
properly format your code. We also provide a convenience CMake target to run
clang-format on all source files:

$ make clang-format
```bash
make clang-format
```

This requires that the `clang-format` executable is found during CMake
configuration. The exact path to the executable can be specified using

$ cmake -DCLANG_FORMAT_EXE=<path/to/executable> ..

Look for a line like this

-- clang-format found: /usr/bin/clang-format

in the CMake configuration output.
```bash
cmake -DCLANG_FORMAT_EXE=<path/to/executable> ..
```

In case you want to preserve the special formatting of a particular code block
such as a matrix intialization add the `// clang-format off` and `//
clang-format on` directives around this block:

~~~~{.cpp}
```cpp
// clang-format off
Mat4<Scalar> m;
m(0, 0) = x[0]; m(0, 1) = x[1]; m(0, 2) = x[2]; m(0, 3) = -dot(x, eye);
m(1, 0) = y[0]; m(1, 1) = y[1]; m(1, 2) = y[2]; m(1, 3) = -dot(y, eye);
m(2, 0) = z[0]; m(2, 1) = z[1]; m(2, 2) = z[2]; m(2, 3) = -dot(z, eye);
m(3, 0) = 0.0; m(3, 1) = 0.0; m(3, 2) = 0.0; m(3, 3) = 1.0;
// clang-format on
~~~~
```
## See Also
Expand Down
48 changes: 23 additions & 25 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ Studio projects for Windows.
On the command line change to the top-level pmp-library directory, create a
build directory and run `cmake`:

$ cd pmp
$ mkdir build
$ cd build
$ cmake ..
cd pmp
mkdir build
cd build
cmake ..

The configuration procedure can be fine-tuned by specifying flags using the `-D`
option of `cmake`:

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/bin/g++
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=/usr/bin/g++

The command above would configure `CMake` to use release mode as its build type
and `/usr/bin/g++` as its C++ compiler.

In order to compile the included examples configure `CMake` with

$ cmake -DWITH_EXAMPLES=true ..
cmake -DWITH_EXAMPLES=true ..

Commonly used flags are shown below.

Expand All @@ -74,26 +74,25 @@ For additional information on using `CMake` and
customizing its configuration see
the [CMake documentation](http://cmake.org/cmake/help/documentation.html).


## Building

After successful configuration pmp-library can be build using the chosen build
system. For a Unix-like environment the default generator is Makefiles. In order
to build pmp-library just call

$ make
make

from the top-level build directory. In order to build pmp in parallel use the
`-j` option of `make`:

$ make -j
make -j

The resulting library is named <code>libpmp.so</code> and
The resulting library is named `libpmp.so` and
located in the current working directory.

In order to build the full HTML manual and reference documentation call

$ make doxygen
make doxygen

The resulting HTML documentation can be found in the `docs/html/`
sub-directory. Note: this requires [Doxygen](http://www.doxygen.nl/) to be
Expand All @@ -103,29 +102,29 @@ installed.

In order to install pmp-library just call

$ sudo make install
sudo make install

Upon installation, both the library and headers will be installed to the
directory given via `CMAKE_INSTALL_PREFIX`, which defaults to `/usr/local/` on
Unix-like systems. If you need to install to a custom location set the install
prefix during build configuration:

$ cmake -DCMAKE_INSTALL_PREFIX=<your custom path> ..
cmake -DCMAKE_INSTALL_PREFIX=<your custom path> ..

The library can be uninstalled using

$ make uninstall
make uninstall

To use the pmp-library in your own CMake-based projects simply include the
library by using `find_package(pmp)` and point CMake to the directory containing
the pmp-library CMake configuration file `pmpConfig.cmake`. This can be either
the pmp-library build directory

$ cmake -Dpmp_DIR=<path-to-pmp-build-directory>
cmake -Dpmp_DIR=<path-to-pmp-build-directory>

or the installed version

$ cmake -Dpmp_DIR=<your custom path>/lib/cmake/pmp
cmake -Dpmp_DIR=<your custom path>/lib/cmake/pmp

This way, you can simply link your own target against pmp-library

Expand All @@ -143,15 +142,14 @@ the [project template](https://github.com/pmp-library/pmp-template), see also

## Build Options


### Index Type

By default, the pmp-libray uses 32-bit unsigned integers as internal index type
to reference entities. However, if you need to process very large data sets this
might not be sufficient. In this case, you can change the index type to be
64-bit by specifying

$ cmake -DPMP_INDEX_TYPE=64
cmake -DPMP_INDEX_TYPE=64

during build configuration.

Expand All @@ -161,7 +159,7 @@ By default, the pmp-library uses `float` as `Scalar` type. In case you require
higher floating point precision you can change the `Scalar` type to `double` by
specifying

$ cmake -DPMP_SCALAR_TYPE=64
cmake -DPMP_SCALAR_TYPE=64

during build configuration.

Expand All @@ -174,12 +172,12 @@ instructions.

Next, source the environment setup script:

$ source <path_to_install_dir>/emsdk_env.sh
source <path_to_install_dir>/emsdk_env.sh

Create a build directory, run cmake, build, enjoy:

$ mkdir jsbuild
$ cd jsbuild
$ emconfigure cmake ..
$ make
$ <your-browser> mview.html
mkdir jsbuild
cd jsbuild
emconfigure cmake ..
make
<your-browser> mview.html
8 changes: 4 additions & 4 deletions docs/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

[Description of the issue]

# How to Reproduce
## How to Reproduce

1. [First Step]
2. [Second Step]
3. [and so on...]

# Expected behavior
## Expected behavior

[What do you expect to happen]

# Actual behavior
## Actual behavior

[What actually happens]

# Reproducibility
## Reproducibility

[What percentage of the time does it reproduce?]
10 changes: 5 additions & 5 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ using pmp-library.

Fetch the repository:

$ git clone --recursive https://github.com/pmp-library/pmp-library.git
git clone --recursive https://github.com/pmp-library/pmp-library.git

Configure and build:

$ cd pmp-library && mkdir build && cd build && cmake .. && make
cd pmp-library && mkdir build && cd build && cmake .. && make

Load and view a mesh:

$ ./mview ../external/pmp-data/off/bunny.off
./mview ../external/pmp-data/off/bunny.off

## Using the Project Template

Expand All @@ -26,10 +26,10 @@ applications using the pmp-library. It directly includes the pmp-library
repository as a git submodule. To get started, just clone the repository
recursively:

$ git clone --recursive https://github.com/pmp-library/pmp-template.git
git clone --recursive https://github.com/pmp-library/pmp-template.git

Configure and build:

$ cd pmp-template && mkdir build && cd build && cmake .. && make
cd pmp-template && mkdir build && cd build && cmake .. && make

This will automatically build the pmp-library and its dependecies.

0 comments on commit 679615a

Please sign in to comment.