<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style id="hljs-theme-dark">
      {{ lib.hljs_theme_dark | safe }}
    </style>
    <style id="hljs-theme-light" disabled>
      {{ lib.hljs_theme_light | safe }}
    </style>
    <script id="hljs-script" type="application/json">
      {{ lib.hljs_script | safe }}
    </script>
    <title>{{ title }} - mdwatch</title>
    <style>
      {{ style | safe }}
    </style>
  </head>
  <body>
    <button class="theme-toggle" onclick="toggleTheme()" title="Toggle theme">
      <svg
        xmlns="http://www.w3.org/2000/svg"
        fill="currentColor"
        viewBox="0 0 24 24"
        stroke-width="1"
        stroke="currentColor"
        class="size-6"
      >
        <path
          stroke-linecap="round"
          stroke-linejoin="round"
          d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"
        />
      </svg>
    </button>
    <article id="content">{{content | safe}}</article>

    <script id="injected-script" type="application/json">
      {{ script | safe }}
    </script>

    <script>
      const code = document.getElementById("injected-script").textContent;
      (0, eval)(code);
      const hljsCode = document.getElementById("hljs-script").textContent;
      (0, eval)(hljsCode);
    </script>
  </body>
</html>
