2022-06-30 07:49:08 +02:00
|
|
|
# Build a Markdown Previewer
|
2022-06-30 05:45:31 +02:00
|
|
|
|
2022-06-30 07:49:08 +02:00
|
|
|
**Demo:** [markdown-previewer.radii.page](https://markdown-previewer.radii.page/)
|
|
|
|
|
|
|
|
**Profile:** [https://www.freecodecamp.org/radii](https://www.freecodecamp.org/radii)
|
|
|
|
|
|
|
|
**Project specification:** [Build a Markdown Previewer](https://www.freecodecamp.org/learn/front-end-development-libraries/front-end-development-libraries-projects/build-a-markdown-previewer)
|
|
|
|
|
|
|
|
**[Tests](https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js)**
|
|
|
|
|
|
|
|
## Build and deploy as:
|
|
|
|
|
|
|
|
```{bash}
|
|
|
|
cd markdown-previewer
|
|
|
|
npm install
|
|
|
|
npm run build
|
|
|
|
cd ..
|
|
|
|
DOCKER_BUILDKIT=1 docker build -t radii/markdown-previewer:latest -f ./dockerfile ./markdown-previewer/build
|
|
|
|
docker run -p 8081:80 -it radii/markdown-previewer
|
|
|
|
```
|
|
|
|
|
|
|
|
Access WebApp at [http://localhost:8081](http://localhost:8081)
|
|
|
|
|
|
|
|
Note: you may replace `8081` with any other port number where you wish to make service available.
|
|
|
|
|
|
|
|
## Run tests as:
|
|
|
|
After building, go to to `public` sub-directory and edit `index.html` file and insert bellow code snippet immediately before closing `</body>` tag:
|
|
|
|
|
|
|
|
```{html}
|
|
|
|
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
|
|
|
|
```
|
|
|
|
|
|
|
|
Than start development instance as:
|
|
|
|
|
|
|
|
```{bash}
|
|
|
|
npm start
|
|
|
|
```
|
|
|
|
You should now see a hamburger on top-left of page. Tap/click it than select test suite `Markdown Previewer`. `Run Tests` and observe results.
|