Convert any blog or website to an interactive learning platform for data science
Convert any blog or website to an interactive learning platform for data science
Add the script to your HTML page (there is an example in
examples/standalone-example.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:
initAddedDCLightExercises();You can also use the JavaScript library in a stackoverflow.com answer by including the exercise and script tag as a snippet.
After including the JavaScript library, you can start writing HTML blocks in the format below. These will be dynamically converted to exercises.
</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
### 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.gzNext, commits to the beta branch
push a release to the staging environment:
https://cdn.datacamp.com/dcl-react-staging.js.gzFinally, 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.gzCommits 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.
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
No open issues yet, or sync has not completed.