layout.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {% extends "!layout.html" %}
  2. {% block extrahead %}
  3. <meta name="description" content="Small, safe and fast formatting library">
  4. <meta name="keywords" content="C++, formatting, printf, string, library">
  5. <meta name="author" content="Victor Zverovich">
  6. <link rel="stylesheet" href="_static/fmt.css">
  7. {# Google Analytics #}
  8. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-20116650-4"></script>
  9. <script>
  10. window.dataLayer = window.dataLayer || [];
  11. function gtag(){dataLayer.push(arguments);}
  12. gtag('js', new Date());
  13. gtag('config', 'UA-20116650-4');
  14. </script>
  15. {% endblock %}
  16. {%- macro searchform(classes, button) %}
  17. <form class="{{classes}}" role="search" action="{{ pathto('search') }}"
  18. method="get">
  19. <div class="form-group">
  20. <input type="text" name="q" class="form-control"
  21. {{ 'placeholder="Search"' if not button }} >
  22. </div>
  23. <input type="hidden" name="check_keywords" value="yes" />
  24. <input type="hidden" name="area" value="default" />
  25. {% if button %}
  26. <input type="submit" class="btn btn-default" value="search">
  27. {% endif %}
  28. </form>
  29. {%- endmacro %}
  30. {% block header %}
  31. <nav class="navbar navbar-inverse">
  32. <div class="tb-container">
  33. <div class="row">
  34. <div class="navbar-content">
  35. {# Brand and toggle get grouped for better mobile display #}
  36. <div class="navbar-header">
  37. <button type="button" class="navbar-toggle collapsed"
  38. data-toggle="collapse" data-target=".navbar-collapse">
  39. <span class="sr-only">Toggle navigation</span>
  40. <span class="icon-bar"></span>
  41. <span class="icon-bar"></span>
  42. <span class="icon-bar"></span>
  43. </button>
  44. <a class="navbar-brand" href="index.html">{fmt}</a>
  45. </div>
  46. {# Collect the nav links, forms, and other content for toggling #}
  47. <div class="collapse navbar-collapse">
  48. <ul class="nav navbar-nav">
  49. <li class="dropdown">
  50. <a href="#" class="dropdown-toggle" data-toggle="dropdown"
  51. role="button" aria-expanded="false">{{ version }}
  52. <span class="caret"></span></a>
  53. <ul class="dropdown-menu" role="menu">
  54. {% for v in versions.split(',') %}
  55. <li><a href="https://fmt.dev/{{v}}">{{v}}</a></li>
  56. {% endfor %}
  57. </ul>
  58. </li>
  59. {% for name in ['Contents', 'Usage', 'API', 'Syntax'] %}
  60. {% if pagename == name.lower() %}
  61. <li class="active"><a href="{{name.lower()}}.html">{{name}}
  62. <span class="sr-only">(current)</span></a></li>
  63. {%else%}
  64. <li><a href="{{name.lower()}}.html">{{name}}</a></li>
  65. {%endif%}
  66. {% endfor %}
  67. </ul>
  68. {% if pagename != 'search' %}
  69. {{ searchform('navbar-form navbar-right', False) }}
  70. {%endif%}
  71. </div> {# /.navbar-collapse #}
  72. </div> {# /.col-md-offset-2 #}
  73. </div> {# /.row #}
  74. </div> {# /.tb-container #}
  75. </nav>
  76. {% if pagename == "index" %}
  77. {% set download_url = 'https://github.com/fmtlib/fmt/releases/download' %}
  78. <div class="jumbotron">
  79. <div class="tb-container">
  80. <h1>{fmt}</h1>
  81. <p class="lead">A modern formatting library</p>
  82. <div class="btn-group" role="group">
  83. {% set name = 'fmt' if version.split('.')[0]|int >= 3 else 'cppformat' %}
  84. <a class="btn btn-success"
  85. href="{{download_url}}/{{version}}/{{name}}-{{version}}.zip">
  86. <span class="glyphicon glyphicon-download"></span> Download
  87. </a>
  88. <button type="button" class="btn btn-success dropdown-toggle"
  89. data-toggle="dropdown"><span class="caret"></span></button>
  90. <ul class="dropdown-menu">
  91. {% for v in versions.split(',') %}
  92. {% set name = 'fmt' if v.split('.')[0]|int >= 3 else 'cppformat' %}
  93. <li><a href="{{download_url}}/{{v}}/{{name}}-{{v}}.zip">Version {{v}}
  94. </a></li>
  95. {% endfor %}
  96. </ul>
  97. </div>
  98. </div>
  99. </div>
  100. {% endif %}
  101. {% endblock %}
  102. {# Disable relbars. #}
  103. {% block relbar1 %}
  104. {% endblock %}
  105. {% block relbar2 %}
  106. {% endblock %}
  107. {% block content %}
  108. <div class="tb-container">
  109. <div class="row">
  110. {# Sidebar is currently disabled.
  111. <div class="bs-sidebar">
  112. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  113. <div class="sphinxsidebarwrapper">
  114. {%- block sidebarlogo %}
  115. {%- if logo %}
  116. <p class="logo"><a href="{{ pathto(master_doc) }}">
  117. <img class="logo" src="{{ pathto('_static/' + logo, 1) }}"
  118. alt="Logo"/>
  119. </a></p>
  120. {%- endif %}
  121. {%- endblock %}
  122. {%- for sidebartemplate in sidebars %}
  123. {%- include sidebartemplate %}
  124. {%- endfor %}
  125. </div>
  126. </div>
  127. </div>
  128. #}
  129. <div class="content">
  130. {% block body %} {% endblock %}
  131. </div>
  132. </div>
  133. </div>
  134. {% endblock %}
  135. {% block footer %}
  136. {{ super() }}
  137. {# Placed at the end of the document so the pages load faster. #}
  138. <script src="_static/bootstrap.min.js"></script>
  139. {% endblock %}