defaults.py 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. from mkdocs.config import config_options
  2. # NOTE: The order here is important. During validation some config options
  3. # depend on others. So, if config option A depends on B, then A should be
  4. # listed higher in the schema.
  5. # Once we drop Python 2.6 support, this could be an OrderedDict, however, it
  6. # isn't really needed either as we always sequentially process the schema other
  7. # than at initialisation when we grab the full set of keys for convenience.
  8. DEFAULT_SCHEMA = (
  9. # Reserved for internal use, stores the mkdocs.yml config file.
  10. ('config_file_path', config_options.Type(str)),
  11. # The title to use for the documentation
  12. ('site_name', config_options.Type(str, required=True)),
  13. # Defines the structure of the navigation.
  14. ('nav', config_options.Nav()),
  15. # TODO: remove this when the `pages` config setting is fully deprecated.
  16. ('pages', config_options.Nav()),
  17. # The full URL to where the documentation will be hosted
  18. ('site_url', config_options.URL()),
  19. # A description for the documentation project that will be added to the
  20. # HTML meta tags.
  21. ('site_description', config_options.Type(str)),
  22. # The name of the author to add to the HTML meta tags
  23. ('site_author', config_options.Type(str)),
  24. # The MkDocs theme for the documentation.
  25. ('theme', config_options.Theme(default='mkdocs')),
  26. # The directory containing the documentation markdown.
  27. ('docs_dir', config_options.Dir(default='docs', exists=True)),
  28. # The directory where the site will be built to
  29. ('site_dir', config_options.SiteDir(default='site')),
  30. # A copyright notice to add to the footer of documentation.
  31. ('copyright', config_options.Type(str)),
  32. # set of values for Google analytics containing the account IO and domain,
  33. # this should look like, ['UA-27795084-5', 'mkdocs.org']
  34. ('google_analytics', config_options.Type(list, length=2)),
  35. # The address on which to serve the live reloading docs server.
  36. ('dev_addr', config_options.IpAddress(default='127.0.0.1:8000')),
  37. # If `True`, use `<page_name>/index.hmtl` style files with hyperlinks to
  38. # the directory.If `False`, use `<page_name>.html style file with
  39. # hyperlinks to the file.
  40. # True generates nicer URLs, but False is useful if browsing the output on
  41. # a filesystem.
  42. ('use_directory_urls', config_options.Type(bool, default=True)),
  43. # Specify a link to the project source repo to be included
  44. # in the documentation pages.
  45. ('repo_url', config_options.RepoURL()),
  46. # A name to use for the link to the project source repo.
  47. # Default, If repo_url is unset then None, otherwise
  48. # "GitHub", "Bitbucket" or "GitLab" for known url or Hostname
  49. # for unknown urls.
  50. ('repo_name', config_options.Type(str)),
  51. # Specify a URI to the docs dir in the project source repo, relative to the
  52. # repo_url. When set, a link directly to the page in the source repo will
  53. # be added to the generated HTML. If repo_url is not set also, this option
  54. # is ignored.
  55. ('edit_uri', config_options.Type(str)),
  56. # Specify which css or javascript files from the docs directory should be
  57. # additionally included in the site.
  58. ('extra_css', config_options.Type(list, default=[])),
  59. ('extra_javascript', config_options.Type(list, default=[])),
  60. # Similar to the above, but each template (HTML or XML) will be build with
  61. # Jinja2 and the global context.
  62. ('extra_templates', config_options.Type(list, default=[])),
  63. # PyMarkdown extension names.
  64. ('markdown_extensions', config_options.MarkdownExtensions(
  65. builtins=['toc', 'tables', 'fenced_code'],
  66. configkey='mdx_configs', default=[])),
  67. # PyMarkdown Extension Configs. For internal use only.
  68. ('mdx_configs', config_options.Private()),
  69. # enabling strict mode causes MkDocs to stop the build when a problem is
  70. # encountered rather than display an error.
  71. ('strict', config_options.Type(bool, default=False)),
  72. # the remote branch to commit to when using gh-deploy
  73. ('remote_branch', config_options.Type(
  74. str, default='gh-pages')),
  75. # the remote name to push to when using gh-deploy
  76. ('remote_name', config_options.Type(str, default='origin')),
  77. # extra is a mapping/dictionary of data that is passed to the template.
  78. # This allows template authors to require extra configuration that not
  79. # relevant to all themes and doesn't need to be explicitly supported by
  80. # MkDocs itself. A good example here would be including the current
  81. # project version.
  82. ('extra', config_options.SubConfig()),
  83. # a list of plugins. Each item may contain a string name or a key value pair.
  84. # A key value pair should be the string name (as the key) and a dict of config
  85. # options (as the value).
  86. ('plugins', config_options.Plugins(default=['search'])),
  87. )