Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EOL warnings #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions data/bitclust/catalog/ja_JP.UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,7 @@ module %s
%sモジュール
object %s
%sオブジェクト
This reference manual is for a version of Ruby that is no longer maintained.
このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。
Latest version
最新版URL
6 changes: 6 additions & 0 deletions data/bitclust/template/layout
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<link rel="search" type="application/opensearchdescription+xml" title="<%= _('Ruby %s Reference Manual', ruby_version()) %>" href="<%=h opensearchdescription_url() %>">
</head>
<body>
<% if eol?() %>
<p class="eol-warning">
<%= _('This reference manual is for a version of Ruby that is no longer maintained.') %>
<a href="https://www.ruby-lang.org/ja/documentation/"><%= _('Latest version') %></a>
</p>
<% end %>
<%= yield %>
<div id="footer">
<a rel="license" href="https://creativecommons.org/licenses/by/3.0/">
Expand Down
6 changes: 6 additions & 0 deletions lib/bitclust/screen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ def meta_description
%Q(<meta name="description" content="">)
end

MINIMUM_SUPPORTED_RUBY_VERSION = '3.1'

def eol?
/\A\d(\.\d)+\z/ =~ ruby_version && ruby_version < MINIMUM_SUPPORTED_RUBY_VERSION
end

private

def default_encoding
Expand Down
11 changes: 11 additions & 0 deletions theme/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,17 @@ hr {
right: 10px;
}

.eol-warning {
background-color: #aa3333;
color: white;
padding: 0.4em;
}

.eol-warning a {
color: white;
text-decoration: underline;
}

@media only screen and (max-width:425px) {
table.entries tr {
display: block;
Expand Down