layout.erb 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <%#
  2. Copyright 2008-2013 Concur Technologies, Inc.
  3. Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. not use this file except in compliance with the License. You may obtain
  5. a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  9. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  10. License for the specific language governing permissions and limitations
  11. under the License.
  12. %>
  13. <% language_tabs = current_page.data.language_tabs || [] %>
  14. <% page_content = yield %>
  15. <%
  16. if current_page.data.includes
  17. current_page.data.includes.each do |include|
  18. page_content += partial("includes/#{include}")
  19. end
  20. end
  21. %>
  22. <!doctype html>
  23. <html>
  24. <head>
  25. <meta charset="utf-8">
  26. <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
  27. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  28. <title><%= current_page.data.title || "API Documentation" %></title>
  29. <style media="screen">
  30. <%= Rouge::Themes::MonokaiSublimeSlate.render(:scope => '.highlight') %>
  31. </style>
  32. <style media="print">
  33. * {
  34. transition:none!important;
  35. }
  36. <%= Rouge::Themes::Base16::Solarized.render(:scope => '.highlight') %>
  37. </style>
  38. <%= stylesheet_link_tag :screen, media: :screen %>
  39. <%= stylesheet_link_tag :print, media: :print %>
  40. <% if current_page.data.search %>
  41. <%= javascript_include_tag "all" %>
  42. <% else %>
  43. <%= javascript_include_tag "all_nosearch" %>
  44. <% end %>
  45. <% if current_page.data.code_clipboard %>
  46. <script>
  47. $(function() { setupCodeCopy(); });
  48. </script>
  49. <% end %>
  50. </head>
  51. <body class="<%= page_classes %>" data-languages="<%=h language_tabs.map{ |lang| lang.is_a?(Hash) ? lang.keys.first : lang }.to_json %>">
  52. <a href="#" id="nav-button">
  53. <span>
  54. NAV
  55. <%= image_tag('navbar.png') %>
  56. </span>
  57. </a>
  58. <div class="toc-wrapper">
  59. <%= image_tag "logo.png", class: 'logo' %>
  60. <% if language_tabs.any? %>
  61. <div class="lang-selector">
  62. <% language_tabs.each do |lang| %>
  63. <% if lang.is_a? Hash %>
  64. <a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a>
  65. <% else %>
  66. <a href="#" data-language-name="<%= lang %>"><%= lang %></a>
  67. <% end %>
  68. <% end %>
  69. </div>
  70. <% end %>
  71. <% if current_page.data.search %>
  72. <div class="search">
  73. <input type="text" class="search" id="input-search" placeholder="Search">
  74. </div>
  75. <ul class="search-results"></ul>
  76. <% end %>
  77. <ul id="toc" class="toc-list-h1">
  78. <% toc_data(page_content).each do |h1| %>
  79. <li>
  80. <a href="#<%= h1[:id] %>" class="toc-h1 toc-link" data-title="<%= h1[:title] %>"><%= h1[:content] %></a>
  81. <% if h1[:children].length > 0 %>
  82. <ul class="toc-list-h2">
  83. <% h1[:children].each do |h2| %>
  84. <li>
  85. <a href="#<%= h2[:id] %>" class="toc-h2 toc-link" data-title="<%= h2[:title] %>"><%= h2[:content] %></a>
  86. </li>
  87. <% end %>
  88. </ul>
  89. <% end %>
  90. </li>
  91. <% end %>
  92. </ul>
  93. <% if current_page.data.toc_footers %>
  94. <ul class="toc-footer">
  95. <% current_page.data.toc_footers.each do |footer| %>
  96. <li><%= footer %></li>
  97. <% end %>
  98. </ul>
  99. <% end %>
  100. </div>
  101. <div class="page-wrapper">
  102. <div class="dark-box"></div>
  103. <div class="content">
  104. <%= page_content %>
  105. </div>
  106. <div class="dark-box">
  107. <% if language_tabs.any? %>
  108. <div class="lang-selector">
  109. <% language_tabs.each do |lang| %>
  110. <% if lang.is_a? Hash %>
  111. <a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a>
  112. <% else %>
  113. <a href="#" data-language-name="<%= lang %>"><%= lang %></a>
  114. <% end %>
  115. <% end %>
  116. </div>
  117. <% end %>
  118. </div>
  119. </div>
  120. </body>
  121. </html>