Skip to main content

DEFAULT_DIFF_TEMPLATE

Constant DEFAULT_DIFF_TEMPLATE 

Source
pub const DEFAULT_DIFF_TEMPLATE: &str = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n  <title>{% if site_title %}Documentation diff \u{2014} {{ site_title }}{% else %}Documentation diff{% endif %}</title>\n  <script>(function(){try{\n  var s=localStorage.getItem(\'doc-theme\');\n  var t=s||(matchMedia(\'(prefers-color-scheme: light)\').matches?\'light\':\'dark\');\n  document.documentElement.setAttribute(\'data-theme\',t);\n  var w=parseInt(localStorage.getItem(\'doc-left-rail-width\'),10);\n  if(w>=180&&w<=560)document.documentElement.style.setProperty(\'--left-rail-width\',w+\'px\');\n}catch(e){}})();</script>\n  <link rel=\"stylesheet\" href=\"{{ base | safe }}/docgen.css\" />\n  <link rel=\"stylesheet\" href=\"{{ base | safe }}/code.css\" />\n  <link rel=\"stylesheet\" href=\"{{ base | safe }}/diff.css\" />\n</head>\n<body class=\"docgen-app docgen-diff-app\">\n  <a class=\"docgen-skip-link\" href=\"#docgen-main\">Skip to content</a>\n  <header class=\"docgen-topbar\">\n    <a class=\"docgen-topbar__brand\" href=\"{{ base | safe }}/\">\n      <span class=\"docgen-brand-mark\" aria-hidden=\"true\"></span>\n      <span class=\"docgen-brand-name\">{% if site_title %}{{ site_title }}{% else %}Docs{% endif %}</span>\n    </a>\n    <div class=\"docgen-topbar__main\">\n      {% if search_enabled %}\n      <button class=\"docgen-search-trigger\" data-docgen-search>\n        <svg class=\"docgen-search-trigger__icon\" viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"M21 21l-4.3-4.3\"/></svg>\n        <span class=\"docgen-search-trigger__label\">Search pages, headings, Rust refs\u{2026}</span>\n        <kbd class=\"docgen-kbd\">\u{2318}K</kbd>\n      </button>\n      {% endif %}\n      <div class=\"docgen-topbar__actions\">\n        <div class=\"docgen-btn-strip\" role=\"group\" aria-label=\"Layout\">\n          <a class=\"docgen-ctl--diff icon-only is-active\" href=\"{{ base | safe }}/diff\" aria-label=\"Show documentation diff\" title=\"Show documentation diff\">\n            <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 4v16M18 4v16\"/><path d=\"M9 8h6M9 16h6M12 5v6M12 13v6\"/></svg>\n          </a>\n        </div>\n        <div class=\"docgen-theme-toggle\" x-data=\"docgenThemeToggle\" role=\"tablist\" aria-label=\"Theme\">\n          <button type=\"button\" class=\"docgen-theme-toggle__btn\" :class=\"{ \'is-active\': theme===\'dark\' }\" :aria-pressed=\"theme===\'dark\'\" @click=\"set(\'dark\')\" aria-label=\"Dark\">\n            <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z\"/></svg>\n          </button>\n          <button type=\"button\" class=\"docgen-theme-toggle__btn\" :class=\"{ \'is-active\': theme===\'light\' }\" :aria-pressed=\"theme===\'light\'\" @click=\"set(\'light\')\" aria-label=\"Light\">\n            <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\"/></svg>\n          </button>\n        </div>\n      </div>\n    </div>\n  </header>\n  <!-- Full-bleed: the diff page is its own workspace (timeline rail + file tree +\n       diff view), so it takes the whole area under the topbar \u{2014} no doc sidebar,\n       no content padding, no max-width. Matches the original .diff-page shell. -->\n  <main class=\"docgen-diff-main\" id=\"docgen-main\" tabindex=\"-1\">\n    <div id=\"docgen-diff-root\"></div>\n  </main>\n  <!-- island infra: bootstrap defines the registry; theme-toggle self-registers; Alpine starts last -->\n  <script>window.DOCGEN_BASE = {{ base | tojson | safe }};</script>\n  <script src=\"{{ base | safe }}/bootstrap.js\"></script>\n  <script src=\"{{ base | safe }}/islands/theme-toggle.js\"></script>\n  <script src=\"{{ base | safe }}/islands/diff.js\"></script>\n  {% if search_enabled %}<script src=\"{{ base | safe }}/search.js\" defer></script>{% endif %}\n  <script src=\"{{ base | safe }}/vendor/alpine/alpine.min.js\" defer></script>\n</body>\n</html>\n";
Expand description

The built-in /diff/ workspace shell template, embedded at compile time. The page is a mount point (#docgen-diff-root) hydrated by islands/diff.js from the build-time timeline.json + revisions/<id>.json payloads.