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:
---
: "Your Title"
title: |
description
A short description of the Dotto.:
author- name: "First Last"
: NULL
occupation: NULL
affiliation: NULL
url: NULL
img: r
lang:
tech- lang: r
: NULL
pkgs:
date: "2021-05-08"
created: "2021-05-08"
last_updated: NULL
categories: NULL
applications: NULL
cover_image: "your-title"
slug: DataMotto::Dotto
output---
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
: ["ggplot2", "dplyr"]
pkgs- lang: python
: ["pands"] pkgs
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}
```
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}
```
<!-- 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}
```