Skip to content

Commit

Permalink
Update to mkdocs-material 9.2. (#14474)
Browse files Browse the repository at this point in the history
Note: 9.2 is in beta. We might want to wait until it is official
released to merge this. Maybe we should pin our version first though...
the changes to the partial files will break us with our currently
unpinned / auto-updating publish CI.

### Changes

- [x] Pin downloaded mkdocs-material version
- [x] Merge upstream changes to partial files
- [x] Add 'new'
[status](https://squidfunk.github.io/mkdocs-material/reference/#setting-the-page-status)
to developer tips and tricks page
- [x] Add
[icons](https://squidfunk.github.io/mkdocs-material/reference/#setting-the-page-icon)
to most pages
- [x] Add an
[annotation](https://squidfunk.github.io/mkdocs-material/reference/annotations/)
- [ ] (Not done) Switch blog pages to use [built-in blog
plugin](https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/)

### Preview

![image](https://github.com/openxla/iree/assets/4010439/48f27bbd-20ac-4e6d-b106-f3b195104bd5)
![image](https://github.com/openxla/iree/assets/4010439/7b22aef3-9674-41d7-b3b7-4e33fb420572)
![image](https://github.com/openxla/iree/assets/4010439/7b59dcfb-db1d-4cf7-813a-b337a13ab2bf)
  • Loading branch information
ScottTodd authored Jul 21, 2023
1 parent 703863b commit 80e68a4
Show file tree
Hide file tree
Showing 23 changed files with 103 additions and 49 deletions.
1 change: 1 addition & 0 deletions docs/website/docs/building-from-source/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hide:
- tags
tags:
- Android
icon: simple/android
---

# Android cross-compilation
Expand Down
4 changes: 4 additions & 0 deletions docs/website/docs/building-from-source/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
icon: octicons/bookmark-16
---

# Getting started

## :octicons-download-16: Prerequisites
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/building-from-source/ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hide:
- tags
tags:
- iOS
icon: simple/apple
---

# iOS cross-compilation
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/building-from-source/riscv.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hide:
- tags
tags:
- CPU
icon: octicons/cpu-16
---

# RISC-V cross-compilation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hide:
- tags
tags:
- CPU
icon: octicons/cpu-16
---

# Running on a Bare-Metal Platform
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/deployment-configurations/cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hide:
- tags
tags:
- CPU
icon: octicons/cpu-16
---

# CPU Deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide:
tags:
- GPU
- CUDA
icon: octicons/server-16
---

# GPU Deployment using CUDA and ROCm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide:
tags:
- GPU
- Vulkan
icon: octicons/server-16
---

# GPU Deployment using Vulkan
Expand Down
13 changes: 9 additions & 4 deletions docs/website/docs/guides/developer-tips.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
status: new
icon: material/lightbulb-on
---

# IREE developer tips and tricks

The IREE compiler is built using [MLIR](https://mlir.llvm.org/), so it naturally
Expand Down Expand Up @@ -62,11 +67,11 @@ then be loaded and executed using IREE's runtime.
C source modules provide low level connection points for constrained
environments like bare metal platforms.

By default, `.vmfb` files can be opened as zip files:
By default, `.vmfb` files can be opened as zip files: (1)
{ .annotate }

<!-- TODO(scotttodd): add annotation (insiders only), qualifying "default" with
`--iree-vm-emit-polyglot-zip=true`
-->
1. Setting `--iree-vm-emit-polyglot-zip=false` will disable this feature and
decrease file size slightly

```console
$ unzip -d simple_abs_cpu ./simple_abs_cpu.vmfb
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/ml-frameworks/jax.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide:
tags:
- Python
- JAX
icon: simple/python
---

# JAX Integration
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/ml-frameworks/pytorch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide:
tags:
- Python
- PyTorch
icon: simple/pytorch
---

# PyTorch Integration
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/ml-frameworks/tensorflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide:
tags:
- Python
- TensorFlow
icon: simple/tensorflow
---

# TensorFlow Integration
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/ml-frameworks/tflite.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide:
tags:
- Python
- TensorFlow
icon: simple/tensorflow
---

# TFLite Integration
Expand Down
4 changes: 4 additions & 0 deletions docs/website/docs/reference/bindings/c-api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
icon: octicons/code-16
---

# C API bindings

## Overview
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/reference/bindings/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hide:
- tags
tags:
- Python
icon: simple/python
---

# Python bindings
Expand Down
10 changes: 10 additions & 0 deletions docs/website/docs/reference/extensions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
---
hide:
- tags
tags:
- JAX
- PyTorch
- TensorFlow
icon: octicons/gear-16
---

# Extension mechanisms

!!! Note
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags:
- JAX
- PyTorch
- TensorFlow
icon: octicons/book-16
---

# Glossary
Expand Down
4 changes: 4 additions & 0 deletions docs/website/docs/reference/mlir-dialects/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
icon: simple/llvm
---

# MLIR dialects

These pages contain automatically generated documentation for the MLIR dialects
Expand Down
4 changes: 4 additions & 0 deletions docs/website/docs/reference/optimization-options.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
icon: octicons/rocket-16
---

# Optimization options

This page documents various supported flags for optimizing IREE programs. Each
Expand Down
3 changes: 3 additions & 0 deletions docs/website/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ extra:
link: https://groups.google.com/forum/#!forum/iree-discuss
name: IREE Discuss Google Group

status:
new: Recently added

extra_css:
- assets/stylesheets/extra.css
- assets/stylesheets/openxla.css
Expand Down
6 changes: 2 additions & 4 deletions docs/website/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# TODO(scotttodd): pin versions to control how often we pull in updates?

mkdocs-material
mkdocs-redirects
mkdocs-material==9.2.0b1
mkdocs-redirects==1.2.1
80 changes: 44 additions & 36 deletions third_party/mkdocs-material/overrides/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
IN THE SOFTWARE.
-->

<!-- Determine base classes -->
<!-- Determine classes -->
{% set class = "md-header" %}
{% if "navigation.tabs.sticky" in features %}
{% set class = class ~ " md-header--lifted" %}
{% set class = class ~ " md-header--shadow md-header--lifted" %}
{% elif "navigation.tabs" not in features %}
{% set class = class ~ " md-header--shadow" %}
{% endif %}

<!-- Header -->
Expand Down Expand Up @@ -52,14 +54,15 @@
aria-label="{{ config.site_name }}"
data-md-component="logo"
>
<div class="md-header__title">
{{ config.site_name }}
</div>
<div class="md-header__title">
{{ config.site_name }}
</div>
</a>

<!-- Button to open drawer -->
<label class="md-header__button md-icon" for="__drawer">
{% include ".icons/material/menu" ~ ".svg" %}
{% set icon = config.theme.icon.menu or "material/menu" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</label>

<!-- Header title -->
Expand All @@ -78,37 +81,41 @@
</div>

<!-- Color palette -->
{% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %}
<input
class="md-option"
data-md-color-media="{{ option.media }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
data-md-color-primary="{{ option.primary | replace(' ', '-') }}"
data-md-color-accent="{{ option.accent | replace(' ', '-') }}"
{% if config.theme.palette %}
{% if not config.theme.palette is mapping %}
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %}
{% set scheme = option.scheme | d("default", true) %}
{% set primary = option.primary | d("indigo", true) %}
{% set accent = option.accent | d("indigo", true) %}
<input
class="md-option"
data-md-color-media="{{ option.media }}"
data-md-color-scheme="{{ scheme | replace(' ', '-') }}"
data-md-color-primary="{{ primary | replace(' ', '-') }}"
data-md-color-accent="{{ accent | replace(' ', '-') }}"
{% if option.toggle %}
aria-label="{{ option.toggle.name }}"
{% else %}
aria-hidden="true"
{% endif %}
type="radio"
name="__palette"
id="__palette_{{ loop.index }}"
/>
{% if option.toggle %}
aria-label="{{ option.toggle.name }}"
{% else %}
aria-hidden="true"
<label
class="md-header__button md-icon"
title="{{ option.toggle.name }}"
for="__palette_{{ loop.index0 or loop.length }}"
hidden
>
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
</label>
{% endif %}
type="radio"
name="__palette"
id="__palette_{{ loop.index }}"
/>
{% if option.toggle %}
<label
class="md-header__button md-icon"
title="{{ option.toggle.name }}"
for="__palette_{{ loop.index0 or loop.length }}"
hidden
>
{% include ".icons/" ~ option.toggle.icon ~ ".svg" %}
</label>
{% endif %}
{% endfor %}
</form>
{% endfor %}
</form>
{% endif %}
{% endif %}

<!-- Site language selector -->
Expand Down Expand Up @@ -144,7 +151,8 @@
<!-- Button to open search modal -->
{% if "material/search" in config.plugins %}
<label class="md-header__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %}
{% set icon = config.theme.icon.search or "material/magnify" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</label>

<!-- Search interface -->
Expand Down
11 changes: 6 additions & 5 deletions third_party/mkdocs-material/overrides/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
IN THE SOFTWARE.
-->

<!-- Determine class according to configuration -->
{% import "partials/nav-item.html" as item with context %}

<!-- Determine classes -->
{% set class = "md-nav md-nav--primary" %}
{% if "navigation.tabs" in features %}
{% set class = class ~ " md-nav--lifted" %}
Expand All @@ -29,7 +31,7 @@
{% set class = class ~ " md-nav--integrated" %}
{% endif %}

<!-- Main navigation -->
<!-- Navigation -->
<nav
class="{{ class }}"
aria-label="{{ lang.t('nav') }}"
Expand Down Expand Up @@ -58,12 +60,11 @@
</div>
{% endif %}

<!-- Render item list -->
<!-- Navigation list -->
<ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav %}
{% set path = "__nav_" ~ loop.index %}
{% set level = 1 %}
{% include "partials/nav-item.html" %}
{{ item.render(nav_item, path, 1) }}
{% endfor %}
</ul>
</nav>

0 comments on commit 80e68a4

Please sign in to comment.