Skip to content

Commit

Permalink
Add copy code to clipboard
Browse files Browse the repository at this point in the history
Add code based on mmistakes/minimal-mistakes#2812 with some custom changes:

Add the option to not creating the copy button by using a “nocopy” class

Remove bash prompt symbol when copying instructions, so they can be directly pasted into a terminal

Update javascript packages

Tested on Chrome, Safari, Opera, Firefox

Change some three back-ticks by one when inlining
  • Loading branch information
carlesfernandez committed Feb 9, 2021
1 parent d3555b7 commit a51f908
Show file tree
Hide file tree
Showing 30 changed files with 1,642 additions and 327 deletions.
6 changes: 3 additions & 3 deletions _design-forces/08-portability.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ In case of using compiled programming languages, software libraries and executab
* **Build system generators**, which automatically generate _build files_ from human-written configuration files. Popular examples of those tools are the [GNU Build System](https://en.wikipedia.org/wiki/GNU_Build_System) (also known as Autotools), [CMake](https://cmake.org) and [SCons](https://scons.org).
* **Build automation tools**, which automatically build executable programs and libraries from the source code with the aid of _build files_ that contains _rules_ describing targets, components and dependencies. Example are [GNU Make](https://www.gnu.org/software/make/), Unix’s [make](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html), [Ninja](https://ninja-build.org) and [others](https://en.wikipedia.org/wiki/List_of_build_automation_software).
* **Compilers**, which are programs that convert instructions into a machine-code or lower-level form so that they can be read and executed by a computer. In general, it is desirable to be able to build the source code with different compilers, since  it improves the overall quality of code by providing different checks and alerts. Examples of compilers are:
* the [GNU Compiler Collection](https://gcc.gnu.org), which provides front ends for C (```gcc```), C++ (```g++```), Fortran (```gfortran```), Java (```gcj```) and other languages;
* the [LLVM](https://llvm.org) project, which provides front-ends for C / Objective-C (```clang```) and C++ (```clang++```), while other external projects allow the compilation of Ruby, Python, Haskell, Java, D, PHP, Pure, Lua, and a number of other languages.
* Those included in [Microsoft Visual Studio](https://www.visualstudio.com/), such as the Microsoft C++ Compiler (MSVC) provided by [Microsoft Visual C++](https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B); ```vbc.exe```, the Visual Basic .NET compiler; and ```csc.exe```, the C# compiler, among others;
* the [GNU Compiler Collection](https://gcc.gnu.org), which provides front ends for C (`gcc`), C++ (`g++`), Fortran (`gfortran`), Java (`gcj`) and other languages;
* the [LLVM](https://llvm.org) project, which provides front-ends for C / Objective-C (`clang`) and C++ (`clang++`), while other external projects allow the compilation of Ruby, Python, Haskell, Java, D, PHP, Pure, Lua, and a number of other languages.
* Those included in [Microsoft Visual Studio](https://www.visualstudio.com/), such as the Microsoft C++ Compiler (MSVC) provided by [Microsoft Visual C++](https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B); `vbc.exe`, the Visual Basic .NET compiler; and `csc.exe`, the C# compiler, among others;
* [other compilers](https://en.wikipedia.org/wiki/List_of_compilers).
* In case of targeting embedded platforms, it is desirable the availability of cross-compilers, which are compilers capable of creating executable code for a platform other than the one on which the compiler is running. Examples are GCC and the .NET Framework compiler.

Expand Down
1 change: 1 addition & 0 deletions _docs/02-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ int main(int argc, char** argv)
return 0;
}
```
{: class="nocopy"}
GNSS-SDR's `main` method processes the command line flags, if any, provided by the user, and initializes the logging library. Then, it records the starting time and instantiates a smart pointer to a `ControlThread` object. Its constructor reads the configuration file, creates a control queue and creates a flow graph according to the configuration. Then, the program's main method calls the `run()` method of the instantiated object, an action that connects the flow graph and starts running it. After that, and until a `stop` message generated by some processing block is received, it reads control messages sent by the receiver's modules through a safe-thread queue and processes them. Finally, when a `stop` message is actually received, the main method reports the execution time, does some clean up and exits the program. The destructor of the `ControlThread` object, which deallocates memory, is automatically executed at the end of the method.
Expand Down
11 changes: 7 additions & 4 deletions _docs/04-control-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ related to _SignalSource_ should look like this:
SignalSource.parameter1=value1
SignalSource.parameter2=value2
```
{: class="nocopy"}

The name of these parameters can be anything but one reserved word: `implementation`.
This parameter indicates in its value the name of the class that has to be instantiated by the factory
Expand All @@ -69,9 +70,10 @@ SignalConditioner.implementation=Pass_Through ; THIS IS ANOTHER COMMENT

In this way, a full GNSS receiver can be uniquely defined in one text file in INI format.

```bash
```console
$ gnss-sdr --config_file=/path/to/my_receiver.conf
```
{: class="nocopy"}

GNSS-SDR allows the user to define a custom GNSS receiver, including its architecture (number of bands, channels per band and targeted signal) and the specific algorithms and parameters for each of the processing blocks through a single configuration file (a simple text file in [INI](https://en.wikipedia.org/wiki/INI_file) format). Thus, **each configuration file defines a different GNSS receiver**. Some examples of such files are available at [gnss-sdr/conf](https://github.com/gnss-sdr/gnss-sdr/tree/master/conf).
{: .notice--info}
Expand All @@ -98,8 +100,6 @@ _A Factory encapsulates the complexity of the instantiation of processing blocks
This scheme is known as the [Factory Method](https://en.wikipedia.org/wiki/Factory_method_pattern) design pattern[^Fernandez10]. As shown in the figure above, this pattern encapsulates the processes involved in the creation of objects by defining an interface for creating an object, but letting subclasses decide which class to instantiate.




## The GNSS Flow Graph
The [`GNSSFlowgraph`](https://github.com/gnss-sdr/gnss-sdr/blob/master/src/core/receiver/gnss_flowgraph.h) class is responsible for preparing the graph of blocks according to the
configuration, running it, modifying it during run-time and stopping it.
Expand Down Expand Up @@ -138,12 +138,14 @@ As we saw in the [Overview]({{ "/docs/overview/" | relative_url }}), the `main`
```cpp
auto control_thread = std::make_unique<ControlThread>();
```
{: class="nocopy"}

The constructor of this objects reads the commandline flag provided by the user when executing the receiver which points to the text file containing the configuration, as shown above:

```bash
```console
$ gnss-sdr --config_file=/path/to/my_receiver.conf
```
{: class="nocopy"}

Then, when the `run()` method of the `control_thread` object is called, a member of class [`GNSSFlowgraph`](https://github.com/gnss-sdr/gnss-sdr/blob/master/src/core/receiver/gnss_flowgraph.h) connects the flow graph, starts the flow of data from sources to sinks, and keeps processing messages from a control queue until the receiver stops.

Expand Down Expand Up @@ -174,6 +176,7 @@ int ControlThread::run()
return 0;
}
```
{: class="nocopy"}
Hence, the object of class [`GNSSFlowgraph`](https://github.com/gnss-sdr/gnss-sdr/blob/master/src/core/receiver/gnss_flowgraph.h) will parse the configuration file and will ask the Block Factory for the corresponding [_Signal Source_]({{ "/docs/sp-blocks/signal-source/" | relative_url }}), [_Signal Conditioner_]({{ "/docs/sp-blocks/signal-conditioner/" | relative_url }}), [_Channels_]({{ "/docs/sp-blocks/channels/" | relative_url }}) (each one with its own [_Acquisition_]({{ "/docs/sp-blocks/acquisition/" | relative_url }}), [_Tracking_]({{ "/docs/sp-blocks/tracking/" | relative_url }}) and [_Telemetry Decoder_]({{ "/docs/sp-blocks/telemetry-decoder/" | relative_url }})), one [_Observables_]({{ "/docs/sp-blocks/observables/" | relative_url }}) block (collecting the processing results from all Channels), and a [_PVT_]({{ "/docs/sp-blocks/pvt/" | relative_url }}) block (acting as a signal sink):
Expand Down
13 changes: 7 additions & 6 deletions _geniuss-place/02-contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,33 @@ The required software can be installed through [RubyGems](https://rubygems.org/)

Install [Jekyll](https://jekyllrb.com/):

```bash
```console
$ sudo gem install jekyll
```

More information at [Jekyll's installation page](https://jekyllrb.com/docs/installation/). Then, install [Bundler](https://bundler.io/), a tool for managing the required dependencies:

```bash
```console
$ sudo gem install bundler
```

Clone your forked repository of this website and install the required dependencies:

```bash
```console
$ git clone https://github.com/YOUR_USERNAME/geniuss-place/
$ cd geniuss-place
$ bundler install
```

After all gems are installed, the following command will deploy the website and run a local server at http://127.0.0.1:4000/

```bash
```console
$ bundle exec jekyll serve -w --config _config.yml,_config.dev.yml
```

You should see something as:

```
```console
Configuration file: _config.yml
Configuration file: _config.dev.yml
Source: /path_to_cloned_repo/geniuss-place
Expand All @@ -120,13 +120,14 @@ Configuration file: _config.dev.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
```
{: class="nocopy"}

Just point your browser to that [local direction](http://127.0.0.1:4000/) in order to enjoy this website without the need of Internet connection. Some features such as comments might not work.

{% capture protip %}
**Pro Tip**: if you want to modify JavaScript (under `assets/js`), you will need to install [Node.js](https://nodejs.org/en/), `cd` to the root of your project, and run `$ npm install` to get all the dependencies. If all gone well, then running `npm run build:js` will compress/concatenate `_main.js` and all plugin scripts into `main.min.js`. Thus, upon a change on JavaScript content, run:

```bash
```console
$ npm run build:js
```

Expand Down
Loading

0 comments on commit a51f908

Please sign in to comment.