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

部ファイル内の見出しや図表リストの接頭字に部番号を使用 #779

Merged
merged 1 commit into from
May 10, 2017
Merged
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
6 changes: 5 additions & 1 deletion lib/review/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,11 @@ def parse_metric(type, metric)

def get_chap(chapter = @chapter)
if @book.config["secnolevel"] > 0 && !chapter.number.nil? && !chapter.number.to_s.empty?
return chapter.format_number(nil)
if chapter.is_a? ReVIEW::Book::Part
return I18n.t('part_short', chapter.number)
else
return chapter.format_number(nil)
end
end
return nil
end
Expand Down
8 changes: 7 additions & 1 deletion lib/review/sec_counter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ def prefix(level, secnolevel)
end
end
elsif secnolevel >= level
prefix = @chapter.format_number(false)
prefix = ''
if @chapter.is_a? ReVIEW::Book::Part
prefix = I18n.t('part_short', @chapter.number)
else
prefix = @chapter.format_number(false)
end

0.upto(level - 2) do |i|
prefix << ".#{@counter[i]}"
end
Expand Down