HTML to Pug Converter

This example demonstrates how to convert HTML code to Pug template syntax. The conversion is processed by a SvelteKit server route at api/convert-to-pug, which uses the html2pug library on the server side.

Server Route Implementation

HTML Input

<div class="container">
  <div class="row">
    <div class="col-md-6">
      <h1>Hello World</h1>
      <p>This is a paragraph</p>
    </div>
  </div>
</div>

Pug Output