Norwegian Digital Learning Arena (NDLA) (Norwegian: Nasjonal digital læringsarena) is a joint county enterprise offering open digital learning assets for upper secondary education. In addition to being a compilation of open educational resources (OER), NDLA provides a range of other online tools for sharing and cooperation.
Article converter is an api for getting a extended html version of the content attribute provided by Article API. The service has two endpoints:
Returns an extended and transformed json structure based on the one provided by Article API
Returns the content attribute from Article API transformed to plain html and wrapped in a HTML document (useful for testing)
The service mainly converts
<embed> tags in the content attribute to appropriate html tags. For some embed tags fetching additional data from other api's is required.
To properly display the converted html some script from ndla-article-scripts is required. See ndla-frontend for examples.
- Node.JS ~10
- npm ~6
- Yarn ~1.1
- Docker (optional)
All dependencies are defined in
package.json and are managed with yarn/npm. To
initially install all dependencies and when the list dependency has changed,
Start development server
Start node server with hot reloading middleware listening on port 3000.
$ yarn start
To use a different api set the
NDLA_API_URL environment variable.
To use article-converter in local ndla-frontend you have to run graphql-api and ndla-frontend locally with special commands.
Test framework: jest.
$ yarn test
Do you tdd?
$ yarn tdd
Prettier is used for automatic code formatting.
Eslint is used for linting.
Rules are configured in
./eslintrc and extends esling-config-ndla.
# GTG? Checks code formating, linting and runs unit tests: yarn check-all
# Run with NODE_ENV=production: npm yarn start-prod
# Docker stuff ./build.sh