Creating a Dotto

To create a new Dotto and add it into the DataMotto, first, you should clone the project and run the package locally by

devtools::load_all()

Then you can create your Dotto from the command line with:

create_Dotto(title = "Your Title", lang = "r")

It creates a Dotto folder under posts/Dotto/ path with an Rmd template, which uses a DataMotto::Dotto as its output format and includes title, description, author, tech, date, categories, applications, cover_image, and slug in its YAML front-matter:

---
title: "Your Title"
description: |
  A short description of the Dotto.
author:
  - name: "First Last"
    occupation: NULL
    affiliation: NULL
    url: NULL
    img: NULL
    lang: r
tech:
  - lang: r
    pkgs: NULL
date:
  created: "2021-05-08"
  last_updated: "2021-05-08"
categories: NULL
applications: NULL
cover_image: NULL
slug: "your-title"
output: DataMotto::Dotto
---

For the author field, the lang specifies each author contributed to what programming language part of the Dotto. The tech field shows how many languages are being covered in the Dotto and for each language, what are the key packages/libraries are used. To mention more than one package name, everyone can use the pkgs: ["pkg1", "pkg2", ...] format. For adding one more language, duplicate the lang and pkgs fields as follows:

tech:
  - lang: r
    pkgs: ["ggplot2", "dplyr"]
  - lang: python
    pkgs: ["pands"]

The cover_image field is one of the images created by the Dotto, located under `*_files/figure-html/your_favorite_img.png", or an external link that will be shown in the social network sharing card.

The slug is created automatically from the title, and we suggest you not change it manually. In case you want to change, you only need to change your working directory into the Dotto folder, change the title and run:

DataMotto::update_Dotto()

In the bottom of the YAML, we have a use_Dotto() helper function that set-up the Dotto functionalities and styles the output page. Do not remove this code!

```{r DataMotto, eval=F}
DataMotto::use_Dotto()
```

Then we can focus on completing each Dots. The Dot and part parameters select what Dot and which part of the Dot we are working on.

<!-- Dot 1, lang: r ------------------------------------------------>

```{block, Dot = 1, part = "Instruction", lang = "r"}

```

```{r, Dot = 1, part = "Code", echo = T, eval = F}

```

```{r, Dot = 1, part = "Result", echo = F, eval = T}

```

Adding a new Dot:

For adding a new Dot, e.g., the second one, you only need to duplicate the whole Dot template and change the Dot = 2 as follows:

<!-- Dot 1, lang: r ------------------------------------------------>

```{block, Dot = 1, part = "Instruction", lang = "r"}

```

```{r, Dot = 1, part = "Code", echo = T, eval = F}

```

```{r, Dot = 1, part = "Result", echo = F, eval = T}

```
<!-- Dot 2, lang: r ------------------------------------------------>

```{block, Dot = 2, part = "Instruction", lang = "r"}

```

```{r, Dot = 2, part = "Code", echo = T, eval = F}

```

```{r, Dot = 2, part = "Result", echo = F, eval = T}

```

Adding a new language to an existing Dotto

For adding a new language, you should duplicate each chunk and change the engine and code scripts and keep the new chunk close to the old one. For example, for adding Python and Julia, we should write:
<!-- Dot 1, lang: r, python ------------------------------------------------>

```{block, Dot = 1, part = "Instruction", lang = "r"}

```
```{block, Dot = 1, part = "Instruction", lang = "python"}

```

```{r, Dot = 1, part = "Code", echo = T, eval = F}

```
```{python, Dot = 1, part = "Code", echo = T, eval = F}

```

```{r, Dot = 1, part = "Result", echo = F, eval = T}

```
```{python, Dot = 1, part = "Result", echo = F, eval = T}

```