{% extends "base.jinja.html" %}

{% block head_css %}
  {{ super() }}
  <link rel="stylesheet" href="{{ view_object.render_static_url('html2pdf4doc.css') }}"/>
{% endblock head_css %}

{% block head_scripts %}
  <script src="{{ view_object.render_static_url('viewtype_menu.js') }}"></script>
  <script src="{{ view_object.render_static_url('resizable_bar.js') }}"></script>
  <script src="{{ view_object.render_static_url('toc_highlighting.js') }}"></script>

  {%- if view_object.project_config.is_activated_mathjax() -%}
  <script id="MathJax-script" async src="{{ view_object.render_static_url('mathjax/tex-mml-chtml.js') }}"></script>
  {%- endif -%}
  {%- if view_object.project_config.is_activated_rapidoc() -%}
  <script src="{{ view_object.render_static_url('rapidoc/rapidoc-min.js') }}"></script>
  {%- endif -%}
  {%- if view_object.project_config.is_activated_mermaid() -%}
    <script src="{{ view_object.render_static_url('mermaid/mermaid.min.js') }}"></script>
    <script type="module">
      mermaid.initialize({ startOnLoad: true });
    </script>
  {%- endif -%}
  {%- if view_object.project_config.is_activated_html2pdf() -%}
  <script
  defer
    {# data-debug-mode='false' #}
    data-preloader='true'
    data-preloader-target='[html2pdf-preloader]'
    data-preloader-background='#F2F5F9'
    data-forced-page-break-selectors=''
    data-page-break-after-selectors='.pdf-toc .free_text'
    data-page-break-before-selectors='H2'
    data-no-break-selectors='sdoc-section-title sdoc-meta sdoc-node-title .pdf-toc-row'
    data-no-hanging-selectors='sdoc-section-title sdoc-anchor sdoc-meta .admonition-title sdoc-node-title sdoc-node-field-label strong:only-child'
  src="{{ view_object.render_static_url('html2pdf4doc.min.js') }}"></script>
  {%- endif -%}

  {{ super() }}
{% endblock head_scripts %}
{% block title %}{{ view_object.document.title }} - {{ view_object.get_page_title() }}{% endblock title %}
{% block viewtype %}{{ "html2pdf" }}{% endblock viewtype %}

{% block layout_nav %}
  {% include "_shared/nav.jinja.html" %}
{% endblock layout_nav %}

{% block tree_content %}
  {% include "screens/document/_shared/resizable_bar_with_project_tree.jinja" %}
{% endblock tree_content %}

{% block toc_content %}
  {% include "screens/document/_shared/resizable_bar_with_toc.jinja" %}
{% endblock toc_content %}

{%- set header_items = [
      "screens/document/_shared/frame_header_document_title.jinja",
      "screens/document/_shared/viewtype_menu.jinja"
    ]
-%}

{% block header_content %}
  {%- with
      header__items=header_items
  -%}
    {% include "components/header/index.jinja" %}
  {%- endwith -%}
{% endblock header_content %}

{% block main_content %}
  {% include "screens/document/pdf/main.jinja" %}
{% endblock main_content %}
