rust: re-add guide entries

pull/1072/head
Jasper van Merle 6 years ago
parent 79adb7ebd3
commit c25865b339

@ -17,7 +17,9 @@ module Docs
PRIMITIVE_SLUG = /\A(\w+)\/(primitive)\./ PRIMITIVE_SLUG = /\A(\w+)\/(primitive)\./
def get_type def get_type
if slug.start_with?('reference') if slug.start_with?('book')
'Guide'
elsif slug.start_with?('reference')
'Reference' 'Reference'
elsif slug == 'error-index' elsif slug == 'error-index'
'Compiler Errors' 'Compiler Errors'

@ -19,12 +19,13 @@ module Docs
html_filters.push 'rust/entries', 'rust/clean_html' html_filters.push 'rust/entries', 'rust/clean_html'
options[:only_patterns] = [ options[:only_patterns] = [
/\Abook\//,
/\Areference\//, /\Areference\//,
/\Acollections\//, /\Acollections\//,
/\Astd\// ] /\Astd\// ]
options[:skip] = %w(book/README.html) options[:skip] = %w(book/README.html book/ffi.html)
options[:skip_patterns] = [/(?<!\.html)\z/, /\/print\.html/] options[:skip_patterns] = [/(?<!\.html)\z/, /\/print\.html/, /\Abook\/second-edition\//]
options[:fix_urls] = ->(url) do options[:fix_urls] = ->(url) do
url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html' url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html'

Loading…
Cancel
Save