user guide: add warning when viewing markdown source file directly
This commit is contained in:
parent
b39fd80d8c
commit
4fd822fb95
@ -24,6 +24,15 @@ custom build operations as well.
|
|||||||
|
|
||||||
Rscons is written in Ruby, and is inspired by [SCons](https://scons.org/) and [waf](https://waf.io/).
|
Rscons is written in Ruby, and is inspired by [SCons](https://scons.org/) and [waf](https://waf.io/).
|
||||||
|
|
||||||
|
${remove}
|
||||||
|
WARNING: This user guide is meant to be preprocessed and rendered by a custom
|
||||||
|
script.
|
||||||
|
The markdown source file is not intended to be viewed directly and will not
|
||||||
|
include all intended content.
|
||||||
|
Visit [https://holtrop.github.io/rscons/index.html](https://holtrop.github.io/rscons/index.html)
|
||||||
|
to view the properly rendered version.
|
||||||
|
${/remove}
|
||||||
|
|
||||||
## Design Principles
|
## Design Principles
|
||||||
|
|
||||||
### Build Correctness
|
### Build Correctness
|
||||||
|
@ -59,6 +59,8 @@ class Generator
|
|||||||
line = @lines.slice!(0)
|
line = @lines.slice!(0)
|
||||||
if line =~ /^```(.*)$/
|
if line =~ /^```(.*)$/
|
||||||
@sections.last.append(gather_code_section($1))
|
@sections.last.append(gather_code_section($1))
|
||||||
|
elsif line.chomp == "${remove}"
|
||||||
|
remove_section
|
||||||
elsif line =~ /^(#+)(>)?\s*(.*)$/
|
elsif line =~ /^(#+)(>)?\s*(.*)$/
|
||||||
level_text, new_page_text, title_text = $1, $2, $3
|
level_text, new_page_text, title_text = $1, $2, $3
|
||||||
level = $1.size
|
level = $1.size
|
||||||
@ -196,6 +198,15 @@ class Generator
|
|||||||
end
|
end
|
||||||
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)
|
def get_next_section_number(level)
|
||||||
if @current_section_number.size == level - 1
|
if @current_section_number.size == level - 1
|
||||||
@current_section_number << 1
|
@current_section_number << 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user