<commit_before><h1 align="center">DataCamp Light<sup>Beta</sup></h1>
<p align="center">
  <a href="https://github.com/datacamp/datacamp-light/projects/1">Roadmap</a>
</p>
<p align="center">
  <a href="https://codecov.io/gh/datacamp/datacamp-light"><img src="https://codecov.io/gh/datacamp/datacamp-light/branch/beta/graph/badge.svg" /></a>
</p>

*This is is the all-new DataCamp Light. To access the old
version, click [here](https://github.com/datacamp/datacamp-light/tree/master)*

[![DataCamp Light banner](https://assets.datacamp.com/img/github/datacamp-light/bannerv3.1.png "Banner")](https://cdn.datacamp.com/dcl-react/standalone-example.html)

<details>
<summary><strong>Table of Contents</strong></summary>

<!-- TOC is automatically updated on the pre-commit hook -->

<!-- toc -->

- [Features](#features)
  * [We're in beta!](#were-in-beta)
- [How to run the app](#how-to-run-the-app)
  * [Writing the HTML block](#writing-the-html-block)
  * [Pre-Exercise Code](#pre-exercise-code)
  * [Sample Code](#sample-code)
  * [Solution](#solution)
  * [Submission Correctness Test (SCT)](#submission-correctness-test-sct)
  * [Hint](#hint)
- [How does it work?](#how-does-it-work)
- [Contributing](#contributing)
  * [Dependencies](#dependencies)
  * [Testing](#testing)
    + [Run tests](#run-tests)
    + [Reducers](#reducers)
    + [Components](#components)
    + [Middleware](#middleware)
  * [DevOps](#devops)
    + [Formatting with Prettier](#formatting-with-prettier)
    + [Code Quality: ESLint, TSLint, Stylelint](#code-quality-eslint-tslint-stylelint)
    + [Commit Messages](#commit-messages)
    + [Continuous Integration](#continuous-integration)
    + [Packages used that you might want to know about](#packages-used-that-you-might-want-to-know-about)

<!-- tocstop -->

</details>

--------------------------------------------------------------------------------






## Features

* Convert any website or blog to an interactive learning platform.
* Works for both R and Python. Sessions are maintained on DataCamp's servers.
* Convert existing markdown documents to an interactive course using [the
  tutorial package](https://github.com/datacamp/tutorial).
* Check out a [demo R and Python
  example](https://cdn.datacamp.com/dcl-react/standalone-example.html).
* Leverage the same Submission Correctness Tests (SCT) DataCamp uses for all
  their courses. For R, there's the
  [testwhat](https://github.com/datacamp/testwhat) ([GitHub
  wiki](https://github.com/datacamp/testwhat/wiki)); for Python, there's
  [pythonwhat](https://github.com/datacamp/pythonwhat) ([GitHub
  wiki](https://github.com/datacamp/pythonwhat/wiki)).



### We're in beta!

We're still building this rewrite of DataCamp Light.
Feel free to try it out and if you encounter problems or just have a great idea,
just [create an issue](https://github.com/datacamp/datacamp-light/issues/new).
Your feedback is appreciated!

When you do, please add the *beta* label so we know which version you're talking about.






## How to run the app
Add the script to your HTML page (there is an example in
`examples/standalone-example.html`):

```html
<script type="text/javascript" src="//cdn.datacamp.com/dcl-react.js.gz"></script>
```

That's it! If your app adds DataCamp Light exercises after the initial page load
(for example, in React apps), call the following function to initialize those
new exercises:

```js
initAddedDCLightExercises();
```

**You can also use the JavaScript library in a stackoverflow.com answer by
including the exercise and script tag as a snippet.**



### Writing the HTML block

After including the JavaScript library, you can start writing HTML blocks in the
format below. These will be dynamically converted to exercises.

```html
<div data-datacamp-exercise data-lang="r"><commit_msg>:pencil: docs(README): update links, remove beta notice<commit_after><h1 align="center">DataCamp Light</h1>
<p align="center">
  <a href="https://github.com/datacamp/datacamp-light/projects/1">Roadmap</a>
</p>
<p align="center">
  <a href="https://codecov.io/gh/datacamp/datacamp-light"><img src="https://codecov.io/gh/datacamp/datacamp-light/branch/beta/graph/badge.svg" /></a>
</p>

*This is is the all-new DataCamp Light. To access the old
version, click [here](https://github.com/datacamp/datacamp-light/tree/d0c7ae4afc50b590bbf34bfffaba8fb1a0d929f5)*

[![DataCamp Light banner](https://assets.datacamp.com/img/github/datacamp-light/bannerv3.1.png "Banner")](https://cdn.datacamp.com/dcl-react-prod/index.html)

<details>
<summary><strong>Table of Contents</strong></summary>

<!-- TOC is automatically updated on the pre-commit hook -->

<!-- toc -->

- [Features](#features)
- [How to run the app](#how-to-run-the-app)
  * [Writing the HTML block](#writing-the-html-block)
  * [Pre-Exercise Code](#pre-exercise-code)
  * [Sample Code](#sample-code)
  * [Solution](#solution)
  * [Submission Correctness Test (SCT)](#submission-correctness-test-sct)
  * [Hint](#hint)
- [How does it work?](#how-does-it-work)
- [Contributing](#contributing)
  * [Dependencies](#dependencies)
  * [Testing](#testing)
    + [Run tests](#run-tests)
    + [Reducers](#reducers)
    + [Components](#components)
    + [Middleware](#middleware)
  * [DevOps](#devops)
    + [Formatting with Prettier](#formatting-with-prettier)
    + [Code Quality: ESLint, TSLint, Stylelint](#code-quality-eslint-tslint-stylelint)
    + [Commit Messages](#commit-messages)
    + [Continuous Integration](#continuous-integration)
    + [Packages used that you might want to know about](#packages-used-that-you-might-want-to-know-about)

<!-- tocstop -->

</details>

--------------------------------------------------------------------------------






## Features

* Convert any website or blog to an interactive learning platform.
* Works for both R and Python. Sessions are maintained on DataCamp's servers.
* Convert existing markdown documents to an interactive course using [the
  tutorial package](https://github.com/datacamp/tutorial).
* Check out a [demo R and Python
  example](https://cdn.datacamp.com/dcl-react/standalone-example.html).
* Leverage the same Submission Correctness Tests (SCT) DataCamp uses for all
  their courses. For R, there's the
  [testwhat](https://github.com/datacamp/testwhat) ([GitHub
  wiki](https://github.com/datacamp/testwhat/wiki)); for Python, there's
  [pythonwhat](https://github.com/datacamp/pythonwhat) ([GitHub
  wiki](https://github.com/datacamp/pythonwhat/wiki)).






## How to run the app
Add the script to your HTML page (there is an example in
`examples/standalone-example.html`):

```html
<script type="text/javascript" src="//cdn.datacamp.com/dcl-react.js.gz"></script>
```

That's it! If your app adds DataCamp Light exercises after the initial page load
(for example, in React apps), call the following function to initialize those
new exercises:

```js
initAddedDCLightExercises();
```

**You can also use the JavaScript library in a stackoverflow.com answer by
including the exercise and script tag as a snippet.**



### Writing the HTML block

After including the JavaScript library, you can start writing HTML blocks in the
format below. These will be dynamically converted to exercises.

```html
<div data-datacamp-exercise data-lang="r">
{'fraction_non_alphanumeric': 0.1679042904290429, 'fraction_numerical': 0.0037128712871287127, 'mean_word_length': 4.068292682926829, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 25, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1234066', 'n_tokens_mistral': 2410, 'n_tokens_neox': 2253, 'n_words': 608}