From 5104b82cff28ab1b5afc9496ddda804634397df5 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Mon, 8 Jan 2024 16:06:00 +0000 Subject: [PATCH] doc: Fix indentation and rendering of RST code blocks --- doc/contributing/source/coding-style.rst | 102 +++++++++++------------ doc/manual/source/callbacks.rst | 8 +- doc/manual/source/events.rst | 2 +- doc/manual/source/working-with-cmake.rst | 14 ++-- 4 files changed, 63 insertions(+), 63 deletions(-) diff --git a/doc/contributing/source/coding-style.rst b/doc/contributing/source/coding-style.rst index 11d7ac61018..4a087615318 100644 --- a/doc/contributing/source/coding-style.rst +++ b/doc/contributing/source/coding-style.rst @@ -1159,44 +1159,44 @@ expressions in if statements and variable declarations. For instance, the following code: - .. sourcecode:: cpp +.. sourcecode:: cpp - bool IsPositive(int n) - { - if (n > 0) - { - return true; - } - else - { - return false; - } - } + bool IsPositive(int n) + { + if (n > 0) + { + return true; + } + else + { + return false; + } + } - void ProcessNumber(int n) - { - if (IsPositive(n) == true) - { - ... - } - } + void ProcessNumber(int n) + { + if (IsPositive(n) == true) + { + ... + } + } can be rewritten as: - .. sourcecode:: cpp +.. sourcecode:: cpp - bool IsPositive(int n) - { - return n > 0; - } + bool IsPositive(int n) + { + return n > 0; + } - void ProcessNumber(int n) - { - if (IsPositive(n)) - { - ... - } - } + void ProcessNumber(int n) + { + if (IsPositive(n)) + { + ... + } + } Smart pointer boolean comparisons ================================= @@ -1608,23 +1608,23 @@ add the following configuration to ``.vscode/settings.json``: .. sourcecode:: json - { - "editor.formatOnPaste": true, - "editor.formatOnSave": true, - "editor.formatOnType": true, - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - "editor.codeActionsOnSave": { - "source.organizeImports": "explicit", - }, - }, - "black-formatter.args": [ - "--config", - "pyproject.toml", - ], - "isort.check": true, - "isort.args": [ - "--sp", - "pyproject.toml", - ], - } + { + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + }, + }, + "black-formatter.args": [ + "--config", + "pyproject.toml", + ], + "isort.check": true, + "isort.args": [ + "--sp", + "pyproject.toml", + ], + } diff --git a/doc/manual/source/callbacks.rst b/doc/manual/source/callbacks.rst index 33a68f5905a..94cd33d7046 100644 --- a/doc/manual/source/callbacks.rst +++ b/doc/manual/source/callbacks.rst @@ -511,8 +511,8 @@ with one or more bound arguments:: template class SpecificFunctor : public Functor - { - public: + { + public: SpecificFunctor(T* p, int (T::*_pmi)(ARG arg), BOUND_ARG boundArg) { m_p = p; @@ -524,11 +524,11 @@ with one or more bound arguments:: { (*m_p.*m_pmi)(m_boundArg, arg); } - private: + private: void (T::*m_pmi)(ARG arg); T* m_p; BOUND_ARG m_boundArg; - }; + }; You can see that when the specific functor is created, the bound argument is saved in the functor / callback object itself. When the ``operator()`` is invoked with diff --git a/doc/manual/source/events.rst b/doc/manual/source/events.rst index 26a95711e2e..dabdca215b7 100644 --- a/doc/manual/source/events.rst +++ b/doc/manual/source/events.rst @@ -219,7 +219,7 @@ or by using a command line argument .. sourcecode:: terminal - $ ./ns3 run "... -–SimulatorImplementationType=ns3::DistributedSimulatorImpl" + $ ./ns3 run "... --SimulatorImplementationType=ns3::DistributedSimulatorImpl" In addition to the basic simulator engines there is a general facility used to build "adapters" which provide small behavior modifications to one of diff --git a/doc/manual/source/working-with-cmake.rst b/doc/manual/source/working-with-cmake.rst index 9ff5d22d686..9527c0ca4c7 100644 --- a/doc/manual/source/working-with-cmake.rst +++ b/doc/manual/source/working-with-cmake.rst @@ -73,13 +73,13 @@ print the configuration options: ~$ cd ns-3-dev ~/ns-3-dev$ ./ns3 configure --help usage: ns3 configure [-h] [-d {debug,release,optimized}] [-G G] - [--cxx-standard CXX_STANDARD] [--enable-asserts] - [--disable-asserts] [--enable-examples] - [--disable-examples] [--enable-logs] - [--disable-logs] [--enable-tests] - [--disable-tests] [--enable-verbose] - [--disable-verbose] - ... + [--cxx-standard CXX_STANDARD] [--enable-asserts] + [--disable-asserts] [--enable-examples] + [--disable-examples] [--enable-logs] + [--disable-logs] [--enable-tests] + [--disable-tests] [--enable-verbose] + [--disable-verbose] + ... positional arguments: configure