Skip to content

Commit

Permalink
[Doc] Use tlcpack theme (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh119 authored Jan 20, 2024
1 parent faf00b8 commit c3f093a
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 40 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/build-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ on:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
test_linux:
name: Deploy Docs
Expand All @@ -24,12 +36,19 @@ jobs:
run: |
python -m pip install -r docs/requirements.txt
- name: Deploying on GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bulid Documentation
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
./scripts/gh_deploy_doc.sh
cd docs
make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/_build/html'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

72 changes: 64 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import os
import sys

import tlcpack_sphinx_addon
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
Expand All @@ -8,23 +12,75 @@

project = 'FlashInfer'
author = "FlashInfer Contributors"
copyright = '2023-2024, {}'.format(author)
footer_copyright = '2023-2024, {}'.format(author)

version = "0.0.1"
release = "0.0.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []
extensions = [
"sphinx_tabs.tabs",
"sphinx_toolbox.collapse",
"sphinxcontrib.httpdomain",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_reredirects",
]

source_suffix = [".rst"]

language = "en"

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Options for HTML output ----------------------------------------------

# The theme is set by the make target
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

templates_path = []

html_static_path = []

footer_note = " "

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
html_theme_options = {
"logo_only": True,
}

header_links = [
("Home", "https://flashinfer.ai"),
("Github", "https://github.com/flashinfer-ai/flashinfer"),
("Discussions", "https://github.com/orgs/flashinfer-ai/discussions"),
]

html_context = {
"footer_copyright": footer_copyright,
"footer_note": footer_note,
"header_links": header_links,
"display_github": True,
"github_user": "flashinfer-ai",
"github_repo": "flashinfer",
"github_version": "main/docs/",
"theme_vcs_pageview_mode": "edit",
# "header_logo": "/path/to/logo",
# "header_logo_link": "",
# "version_selecter": "",
}

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
# add additional overrides
templates_path += [tlcpack_sphinx_addon.get_templates_path()]
html_static_path += [tlcpack_sphinx_addon.get_static_path()]

html_theme = 'sphinxdoc'
html_static_path = ['_static']
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
sphinx-tabs == 3.4.1
sphinx-rtd-theme
sphinx == 5.2.3
sphinx-toolbox == 3.4.0
tlcpack-sphinx-addon==0.2.2
sphinxcontrib_httpdomain==1.8.1
sphinxcontrib-napoleon==0.7
sphinx-reredirects==0.1.2

25 changes: 0 additions & 25 deletions scripts/gh_deploy_doc.sh

This file was deleted.

0 comments on commit c3f093a

Please sign in to comment.