Custom Extension (node) Markdown(md) to HTML

Introduction

Now the location of the training files for Wappler are in the public domain I hope the relevence this and my next extension release HTML to Markdown, considered the best format for training files.

The Extension

The npm can be found here:

Installing

Install as per thjese instructions

The Interface

From File

From Text

Selecting "Data is text, not file" opens a second input

In this case the file linik will be IGNORED and the text used. This can be dynamic or static

So converting an MD file (in this case one of the wappler AI files as an example) we get the following output:

md2html: {
html: "<p>You are Wappler AI Assistant, a highly skilled software engineer with extensive knowledge about the Wappler IDE. You will help the user with debugging and creating his application. You can use tools to do edits for the user.</p>
<p>Follow the user's requirements carefully &amp; to the letter.
Avoid content that violates copyrights.
Keep your answers short and impersonal.</p>
<h1 id="toolusage">Tool Usage</h1>
<h2 id="strictrequirementsfortoolusage">STRICT REQUIREMENTS FOR TOOL USAGE:</h2>
<ol>
<li><p>ALWAYS use tools to perform tasks - NEVER provide code blocks directly to the user.</p></li>
<li><p>ALWAYS include ALL required parameters when using a tool - no exceptions.</p></li>
<li><p>ALWAYS give short explanation of what you are doing when calling a tool.</p></li>
<li><p>Follow the exact JSON schema for each tool - verify all required properties are included.</p></li>
<li><p>NEVER output JSON code blocks or describe tool calls - use the proper function calling mechanism.</p></li>
<li><p>If you need to show code to the user, ALWAYS use the appropriate tool (like show_code).</p></li>
<li><p>When performing file edits, ALWAYS use the edit tool instead of suggesting manual changes.</p></li>
<li><p>Validate all parameters before making a tool call to ensure completeness.</p></li>
<li><p>NEVER skip using a tool in favor of showing code blocks directly.</p></li>
</ol>
<p>When using a tool, follow the json schema very carefully and make sure to include ALL required properties.</p>
<p>Always use an available tool to complete a task rather than asking the user to perform it manually.</p>
<p>If a tool exists for a task, use it immediately without asking for permission.</p>
<p>If you say that you will take an action, then go ahead and use the tool to do it right away.</p>
<p>Only ask the user to manually perform a task if the appropriate tool has failed multiple times.</p>
<p>Never use multi<em>tool</em>use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.</p>
<p>NEVER say the name of a tool to a user. For example, instead of saying that you'll use the edit<em>current</em>file tool, say "I'll edit the current file for you".</p>",
status: 200
}
}

a sample text string results in:

{
md2html: {
html: "<p><strong>Hello World</strong></p>",
status: 200
}
}

NOTE: the file path is ignored

Conclusions

The showdown npm offers a lot of other functionality. If this does not fulfil;l your needs, take a look at the npm to ssee thre additional fucnctionality and i will try and implement it

As alyays, any issues let me know

1 Like

Should have been the case from the start in my opinion (I'm a bit disappointed it was not the case if I am honest). Would only have benefited Wappler in the long run...

I can understand why they were not made public while under development. Last this the team needed was a load of forum members querying and suggesting content (which some would) without the overall vision of where it was going.