V
V
vasIvas2017-09-01 12:54:12
JavaScript
vasIvas, 2017-09-01 12:54:12

How does markdown work in frameworks?

I’ll immediately clarify what specifically interests me in angular4 +, but I’m sure that the logic of work will be approximately the same for all frameworks, so I added React.
The question is this.. In a clean version, I will load the .md file and then parse it, replacing the markdown syntax with html. Then I just add the resulting html to the home tree and see the result immediately.
The only thing, in the case of using the code on the page, I need to distort the library to highlight the code.
It was all simple. But when it comes to frameworks, my thoughts run wild. they scatter not because I can’t figure out how to do it, but because it’s too difficult for me. That's why I ask those who clearly understand the process of converting .md into something that I can see in an application written in angular, to describe it.
the thing is that if you go the simplest way and convert .md into templates for angular, you will have to load a compiler into applications that will look next to aot compiled code, like the fifth leg of a dog.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-09-01
@boratsagdiev

The principle is simple: connect the library for converting markdown, throw something into it, get html at the output, paste it where you need it (component state or something else).
I am not familiar with angular, but there are modules like https://github.com/Hypercubed/angular-marked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question