Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

datacamp-light

> 编程语言
Open source

Convert any blog or website to an interactive learning platform for data science

1.4K stars0 likes0 views
WebsiteGitHub

About

Convert any blog or website to an interactive learning platform for data science

DataCamp Light

Roadmap | Docs

Table of Contents
  • Features
  • How to run the app
  • Writing the HTML block
    • Pre-Exercise Code
    • Sample Code
    • Solution
    • Submission Correctness Test (SCT)
    • Hint
    • Other Options
  • How does it work?
  • Contributing
    • Dependencies
    • Testing
      • Run tests
      • Reducers
      • Components
      • Middleware
    • DevOps
      • Formatting with Prettier
      • Code Quality: ESLint, TSLint, Stylelint
      • Commit Messages
      • Continuous Integration
      • Packages used that you might want to know about

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.
  • Check out a demo R and Python example.
  • Leverage the same Submission Correctness Tests (SCT) DataCamp uses for all their courses. For R, there's the testwhat (GitHub wiki); for Python, there's pythonwhat (GitHub wiki).

How to run the app

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

xml
<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:

javascript
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.

xml

</div>

As we can see in the example, the whole exercise is contained in a single `

…

css [data-datacamp-exercise] { visibility: hidden; }

…

git clone https://github.com/datacamp/datacamp-light.git cd datacamp-light git checkout beta npm i npm start

bash

### Dependencies

The `vendor/` folder includes minified code of some internal DataCamp packages
that are not hosted publicly right now.

### Testing

Please read these two documents before starting to implement any tests:
- [Writing tests in redux](http://redux.js.org/docs/recipes/WritingTests.html)
- [Writing tests for side effects](https://redux-observable.js.org/docs/recipes/WritingTests.html)

Test files are named as `{moduleName}.spec.js`.

#### Run tests

```bash
npm test

…


https://cdn.datacamp.com/dcl-react-dev.js.gz

Next, commits to the beta branch push a release to the staging environment:

https://cdn.datacamp.com/dcl-react-staging.js.gz

Finally, when we create a release, an update is pushed to the production environment. This should be a stable version of DataCamp Light:

https://cdn.datacamp.com/dcl-react.js.gz

Commits to this branch trigger a build that is deployed on the DataCamp Dev environment. Commits to the main branch, beta, are built and deployed to staging. When a release is created, that build is deployed to production.

Packages used that you might want to know about

  • TypeScript, of course. Make sure you install an appropriate plugin for your editor, if it doesn't ship with one.

  • redux-observable for observable middleware

  • typescript-fsa for easy, type-safe action creators

  • typescript-fsa-reducers for super-clean reducers

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言