⚙️ An extensible and easy-to-use markdown transpiler!
What most transpilers do :
This tool will read markdown files and transform them into the appropriate file type. In order to achieve such a task, three interfaces each play a different role in the process:
MarkdownParser
, used to transform markdown files into HTML or componentsImportsCreator
, used to generate the appropriate import section inside the <script>
tagFileCreator
, used to wrap the parsed content and define the <script>
sectionThe MarkdownTranspiler
will take an implementation from each of these interfaces and output the resulting file. Some implementations are already offered to you, but you can always provide your own!
yarn add --dev @gabio/markdown-transpiler
or
npm install --save-dev @gabio/markdown-transpiler
A usage example can be found here.
MarkdownParser
As stated above, you can provide your own version of any parts of the transpiler. However, the most common interface to be implemented is the MarkdownParser
. Here is an example for transpiling to a Svelte component library.
For other interfaces, you can look at the source code for a good idea on how they can be implemented.
Generated using TypeDoc