From 36857d9250cf28c3560d25dd9b71bdf3ac95b57b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 4 Oct 2017 11:46:42 +0200 Subject: [PATCH] Remove valid values for Bool from docs --- doc/help/settings.asciidoc | 265 ------------------------------ qutebrowser/config/configfiles.py | 2 +- qutebrowser/config/configtypes.py | 6 +- scripts/dev/src2asciidoc.py | 2 +- 4 files changed, 6 insertions(+), 269 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 7aee1d66e..f65f42fbc 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -280,11 +280,6 @@ Always restore open sites when qutebrowser is reopened. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[backend]] @@ -1304,11 +1299,6 @@ Move on to the next part when there's only one possible completion left. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[completion.scrollbar.padding]] @@ -1347,11 +1337,6 @@ Shrink the completion to be smaller than the configured size if there are no scr Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[completion.timestamp_format]] @@ -1395,11 +1380,6 @@ An application cache acts like an HTTP cache in some sense. For documents that u Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ This setting is only available with the QtWebKit backend. @@ -1448,11 +1428,6 @@ Note this option needs a restart with QtWebEngine on Qt < 5.9. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.default_encoding]] @@ -1471,11 +1446,6 @@ This needs to be enabled for `:inspector` to work and also adds an _Inspect_ ent Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ This setting is only available with the QtWebKit backend. @@ -1486,11 +1456,6 @@ Try to pre-fetch DNS entries to speed up browsing. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ This setting is only available with the QtWebKit backend. @@ -1502,11 +1467,6 @@ This will flatten all the frames to become one scrollable page. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ This setting is only available with the QtWebKit backend. @@ -1548,11 +1508,6 @@ When this is set to true, qutebrowser asks websites to not track your identity. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.headers.referer]] @@ -1586,11 +1541,6 @@ Whether host blocking is enabled. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.host_blocking.lists]] @@ -1633,11 +1583,6 @@ Enable or disable hyperlink auditing (``). Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.images]] @@ -1646,11 +1591,6 @@ Whether images are automatically loaded in web pages. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.javascript.alert]] @@ -1659,11 +1599,6 @@ Show javascript alerts. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.javascript.can_access_clipboard]] @@ -1673,11 +1608,6 @@ With QtWebEngine, writing the clipboard as response to a user interaction is alw Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.javascript.can_close_tabs]] @@ -1686,11 +1616,6 @@ Whether JavaScript can close tabs. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ This setting is only available with the QtWebKit backend. @@ -1701,11 +1626,6 @@ Whether JavaScript can open new tabs without user interaction. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.javascript.enabled]] @@ -1714,11 +1634,6 @@ Enables or disables JavaScript. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.javascript.log]] @@ -1742,11 +1657,6 @@ Use the standard JavaScript modal dialog for `alert()` and `confirm()` Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.javascript.prompt]] @@ -1755,11 +1665,6 @@ Show javascript prompts. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.local_content_can_access_file_urls]] @@ -1768,11 +1673,6 @@ Whether locally loaded documents are allowed to access other local urls. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.local_content_can_access_remote_urls]] @@ -1781,11 +1681,6 @@ Whether locally loaded documents are allowed to access remote urls. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.local_storage]] @@ -1794,11 +1689,6 @@ Whether support for HTML 5 local storage and Web SQL is enabled. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.media_capture]] @@ -1847,11 +1737,6 @@ Note that the files can still be downloaded by clicking the download button in t Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ This setting is only available with the QtWebKit backend. @@ -1862,11 +1747,6 @@ Enables or disables plugins in Web pages. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.print_element_backgrounds]] @@ -1875,11 +1755,6 @@ Whether the background color and images are also drawn when the page is printed. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ On QtWebEngine, this setting requires Qt 5.8 or newer. @@ -1890,11 +1765,6 @@ Open new windows in private browsing mode which does not record visited pages. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[content.proxy]] @@ -1917,11 +1787,6 @@ Send DNS requests over the configured proxy. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ This setting is only available with the QtWebKit backend. @@ -1954,11 +1819,6 @@ Enables or disables WebGL. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[content.xss_auditing]] @@ -1968,11 +1828,6 @@ Suspicious scripts will be blocked and reported in the inspector's JavaScript co Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[downloads.location.directory]] @@ -1991,11 +1846,6 @@ If set to false, `downloads.location.directory` will be used. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[downloads.location.remember]] @@ -2004,11 +1854,6 @@ Remember the last used download directory. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[downloads.location.suggestion]] @@ -2270,11 +2115,6 @@ This is needed for QtWebEngine to work with Nouveau drivers. This setting requir Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ This setting is only available with the QtWebEngine backend. @@ -2347,11 +2187,6 @@ Hide unmatched hints in rapid mode. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[hints.min_chars]] @@ -2412,11 +2247,6 @@ Ignored for number hints. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[hints.uppercase]] @@ -2425,11 +2255,6 @@ Make chars in hint strings uppercase. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[history_gap_interval]] @@ -2475,11 +2300,6 @@ Leave insert mode if a non-editable element is clicked. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[input.insert_mode.auto_load]] @@ -2488,11 +2308,6 @@ Automatically enter insert mode if an editable element is focused after loading Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[input.insert_mode.plugins]] @@ -2501,11 +2316,6 @@ Switch to insert mode when clicking flash and other plugins. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[input.links_included_in_focus_chain]] @@ -2514,11 +2324,6 @@ Include hyperlinks in the keyboard focus chain when tabbing. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[input.partial_timeout]] @@ -2537,11 +2342,6 @@ This disables the context menu. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[input.spatial_navigation]] @@ -2551,11 +2351,6 @@ Spatial navigation consists in the ability to navigate between focusable element Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[keyhint.blacklist]] @@ -2590,11 +2385,6 @@ Show messages in unfocused windows. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[new_instance_open_target]] @@ -2637,11 +2427,6 @@ Show a filebrowser in upload/download prompts. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[prompt.radius]] @@ -2668,11 +2453,6 @@ Show a scrollbar. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[scrolling.smooth]] @@ -2682,11 +2462,6 @@ Note smooth scrolling does not work with the `:scroll-px` command. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[session_default_name]] @@ -2704,11 +2479,6 @@ Hide the statusbar unless a message is shown. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[statusbar.padding]] @@ -2743,11 +2513,6 @@ Open new tabs (middleclick/ctrl+click) in the background. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[tabs.close_mouse_button]] @@ -2779,11 +2544,6 @@ Show favicons in the tab bar. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[tabs.indicator_padding]] @@ -2821,11 +2581,6 @@ Switch between tabs using the mouse wheel. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[tabs.new_position.related]] @@ -2929,11 +2684,6 @@ Open a new window for every tab. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[tabs.title.alignment]] @@ -3001,11 +2751,6 @@ Whether to wrap when changing tabs. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[true]+ [[url.auto_search]] @@ -3090,11 +2835,6 @@ Hide the window decoration when using wayland (requires restart) Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ [[window.title_format]] @@ -3164,11 +2904,6 @@ Whether the zoom factor on a frame applies only to the text or to all content. Type: <> -Valid values: - - * +true+ - * +false+ - Default: +pass:[false]+ This setting is only available with the QtWebKit backend. diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index 8f174b869..c23e616a0 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -264,7 +264,7 @@ def write_config_py(filename, options, bindings): f.write('# Type: {}\n'.format(opt.typ.get_name())) valid_values = opt.typ.get_valid_values() - if valid_values is not None: + if valid_values is not None and valid_values.generate_docs: f.write("# Valid values:\n") for val in valid_values: try: diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index afe9eb372..aac320cbb 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -78,13 +78,15 @@ class ValidValues: Attributes: values: A list with the allowed untransformed values. descriptions: A dict with value/desc mappings. + generate_docs: Whether to show the values in the docs. """ - def __init__(self, *values): + def __init__(self, *values, generate_docs=True): if not values: raise ValueError("ValidValues with no values makes no sense!") self.descriptions = {} self.values = [] + self.generate_docs = generate_docs for value in values: if isinstance(value, str): # Value without description @@ -608,7 +610,7 @@ class Bool(BaseType): def __init__(self, none_ok=False): super().__init__(none_ok) - self.valid_values = ValidValues('true', 'false') + self.valid_values = ValidValues('true', 'false', generate_docs=False) def to_py(self, value): self._basic_py_validation(value, bool) diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py index f12d6601b..8ea6b7c30 100755 --- a/scripts/dev/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -421,7 +421,7 @@ def _generate_setting_option(f, opt): f.write("\n") valid_values = opt.typ.get_valid_values() - if valid_values is not None: + if valid_values is not None and valid_values.generate_docs: f.write("Valid values:\n") f.write("\n") for val in valid_values: