lib/jazzy/config.rb in jazzy-0.7.3 vs lib/jazzy/config.rb in jazzy-0.7.4
- old
+ new
@@ -244,10 +244,15 @@
command_line: '--github-file-prefix PREFIX',
description: 'GitHub URL file prefix of this project (e.g. '\
'https://github.com/realm/realm-cocoa/tree/v0.87.1)'
# ──────── Doc generation options ────────
+ config_attr :disable_search,
+ command_line: '--disable-search',
+ description: ['Avoid generating a search index. '\
+ 'Search is available in some themes.'],
+ default: false
config_attr :skip_documentation,
command_line: '--skip-documentation',
description: 'Will skip the documentation generation phase.',
default: false
@@ -292,10 +297,18 @@
parse: ->(t) do
return expand_path(t) unless t == 'apple' || t == 'fullwidth'
Pathname(__FILE__).parent + 'themes' + t
end
+ config_attr :use_safe_filenames,
+ command_line: '--use-safe-filenames',
+ description: 'Replace unsafe characters in filenames with an encoded '\
+ 'representation. This will reduce human readability of '\
+ 'some URLs, but may be necessary for projects that '\
+ 'expose filename-unfriendly functions such as /(_:_:)',
+ default: false
+
config_attr :template_directory,
command_line: ['-t', '--template-directory DIRPATH'],
description: 'DEPRECATED: Use --theme instead.',
parse: ->(_) do
raise '--template-directory (-t) is deprecated: use --theme instead.'
@@ -329,11 +342,12 @@
PodspecDocumenter.apply_config_defaults(config.podspec, config)
if config.root_url
config.dash_url ||= URI.join(
config.root_url,
- "docsets/#{config.module_name}.xml")
+ "docsets/#{config.module_name}.xml",
+ )
end
config
end
@@ -412,10 +426,10 @@
end
def read_config_file(file)
case File.extname(file)
when '.json' then JSON.parse(File.read(file))
- when '.yaml', '.yml' then YAML.load(File.read(file))
+ when '.yaml', '.yml' then YAML.safe_load(File.read(file))
else raise "Config file must be .yaml or .json, but got #{file.inspect}"
end
end
def print_config_file_help