user guide: add warning when viewing markdown source file directly
This commit is contained in:
1 parent
b39fd80d8c
commit
4fd822fb95
2 files changed
+20
No files matched your search
@@ -59,6 +59,8 @@ class Generator
|
||||
line = @lines.slice!(0)
|
||||
if line =~ /^```(.*)$/
|
||||
@sections.last.append(gather_code_section($1))
|
||||
elsif line.chomp == "${remove}"
|
||||
remove_section
|
||||
elsif line =~ /^(#+)(>)?\s*(.*)$/
|
||||
level_text, new_page_text, title_text = $1, $2, $3
|
||||
level = $1.size
|
||||
@@ -196,6 +198,15 @@ class Generator
|
||||
end
|
||||
end
|
||||
|
||||
def remove_section
|
||||
loop do
|
||||
line = @lines.slice!(0)
|
||||
if line.chomp == "${/remove}"
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_next_section_number(level)
|
||||
if @current_section_number.size == level - 1
|
||||
@current_section_number << 1
|
||||
|
||||
Reference in new issue
Block a user