|  | 
|  | 1 | +# -*- coding: utf-8 -*- | 
|  | 2 | +import os | 
|  | 3 | +import sys | 
|  | 4 | + | 
|  | 5 | +import tlcpack_sphinx_addon | 
|  | 6 | + | 
|  | 7 | +# -- General configuration ------------------------------------------------ | 
|  | 8 | + | 
|  | 9 | +sys.path.insert(0, os.path.abspath("../python")) | 
|  | 10 | +sys.path.insert(0, os.path.abspath("../")) | 
|  | 11 | +autodoc_mock_imports = ["torch"] | 
|  | 12 | + | 
|  | 13 | +# General information about the project. | 
|  | 14 | +project = "web-llm" | 
|  | 15 | +author = "WebLLM Contributors" | 
|  | 16 | +copyright = "2023, %s" % author | 
|  | 17 | + | 
|  | 18 | +# Version information. | 
|  | 19 | + | 
|  | 20 | +version = "0.2.77" | 
|  | 21 | +release = "0.2.77" | 
|  | 22 | + | 
|  | 23 | +extensions = [ | 
|  | 24 | +    "sphinx_tabs.tabs", | 
|  | 25 | +    "sphinx_toolbox.collapse", | 
|  | 26 | +    "sphinxcontrib.httpdomain", | 
|  | 27 | +    "sphinx.ext.autodoc", | 
|  | 28 | +    "sphinx.ext.napoleon", | 
|  | 29 | +    "sphinx_reredirects", | 
|  | 30 | +] | 
|  | 31 | + | 
|  | 32 | +redirects = {"get_started/try_out": "../index.html#getting-started"} | 
|  | 33 | + | 
|  | 34 | +source_suffix = [".rst"] | 
|  | 35 | + | 
|  | 36 | +language = "en" | 
|  | 37 | + | 
|  | 38 | +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | 
|  | 39 | + | 
|  | 40 | +# The name of the Pygments (syntax highlighting) style to use. | 
|  | 41 | +pygments_style = "sphinx" | 
|  | 42 | + | 
|  | 43 | +# A list of ignored prefixes for module index sorting. | 
|  | 44 | +# If true, `todo` and `todoList` produce output, else they produce nothing. | 
|  | 45 | +todo_include_todos = False | 
|  | 46 | + | 
|  | 47 | +# -- Options for HTML output ---------------------------------------------- | 
|  | 48 | + | 
|  | 49 | +# The theme is set by the make target | 
|  | 50 | +import sphinx_rtd_theme | 
|  | 51 | + | 
|  | 52 | +html_theme = "sphinx_rtd_theme" | 
|  | 53 | +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | 
|  | 54 | + | 
|  | 55 | +templates_path = [] | 
|  | 56 | + | 
|  | 57 | +html_static_path = [] | 
|  | 58 | + | 
|  | 59 | +footer_copyright = "© 2023 MLC LLM" | 
|  | 60 | +footer_note = " " | 
|  | 61 | + | 
|  | 62 | +html_logo = "_static/img/mlc-logo-with-text-landscape.svg" | 
|  | 63 | + | 
|  | 64 | +html_theme_options = { | 
|  | 65 | +    "logo_only": True, | 
|  | 66 | +} | 
|  | 67 | + | 
|  | 68 | +header_links = [ | 
|  | 69 | +    ("Home", "https://webllm.mlc.ai/"), | 
|  | 70 | +    ("GitHub", "https://github.com/mlc-ai/web-llm"), | 
|  | 71 | +    ("Discord", "https://discord.gg/9Xpy2HGBuD"), | 
|  | 72 | +] | 
|  | 73 | + | 
|  | 74 | +header_dropdown = { | 
|  | 75 | +    "name": "Other Resources", | 
|  | 76 | +    "items": [ | 
|  | 77 | +        ("WebLLM Chat", "https://chat.webllm.ai/"), | 
|  | 78 | +        ("MLC Course", "https://mlc.ai/"), | 
|  | 79 | +        ("MLC Blog", "https://blog.mlc.ai/"), | 
|  | 80 | +        ("MLC LLM", "https://llm.mlc.ai/"), | 
|  | 81 | +    ], | 
|  | 82 | +} | 
|  | 83 | + | 
|  | 84 | +html_context = { | 
|  | 85 | +    "footer_copyright": footer_copyright, | 
|  | 86 | +    "footer_note": footer_note, | 
|  | 87 | +    "header_links": header_links, | 
|  | 88 | +    "header_dropdown": header_dropdown, | 
|  | 89 | +    "display_github": True, | 
|  | 90 | +    "github_user": "mlc-ai", | 
|  | 91 | +    "github_repo": "web-llm", | 
|  | 92 | +    "github_version": "main/docs/", | 
|  | 93 | +    "theme_vcs_pageview_mode": "edit", | 
|  | 94 | +    # "header_logo": "/path/to/logo", | 
|  | 95 | +    # "header_logo_link": "", | 
|  | 96 | +    # "version_selecter": "", | 
|  | 97 | +} | 
|  | 98 | + | 
|  | 99 | + | 
|  | 100 | +# add additional overrides | 
|  | 101 | +templates_path += [tlcpack_sphinx_addon.get_templates_path()] | 
|  | 102 | +html_static_path += [tlcpack_sphinx_addon.get_static_path()] | 
0 commit comments