Create a Web Component using LitElement and Typescript that can render markdown. The component should be able to render the markdown client side, or send the markdown to an API endpoint to be rendered.
- Ability to render markdown client side - given a plain text string or file of markdown, make it possible to render it as HTML.
- Ability to call http service to render markdown - use an API that is capable of rendering markdown as an alternative to using local rendering
- Make an option for all links in the rendered markdown to open in a new tab - markdown includes links, so make sure that those open in a new tab
- Publish the component to
npm
- Create a separate project with the Angluar or Vue CLI in the "consumer" sub-folder and use your newly published package in it
- Document web component API / usage
Use 3rd party libraries as needed.
You can run the provided markdown serivce with either of the following methods:
- Docker Compose
- in the
markdown-server
folder rundocker-compose up
- Manually
- install nodejs/npm (node 10 is known working, other versions untested)
- be in the
markdown-server
folder - run
npm install
- run
npm start
The API is very simple, a POST request with markdown text body to /markdown
will return html text
There is an example http request in markdown-server/example-requests
- The web component does not need to support IE11, just latest versions of modern browsers
Your output for this assessment should be code committed to the git bundle provided to you where you found this readme