Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkdocs: General DocSite improvements. #400

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/user/features/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: Advanced Features
7 changes: 6 additions & 1 deletion docs/user/gen_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
"""Python script used to automatically generate API Reference documentation.

Used in conjunction with mkdocs to generate static markdown files for each
file inside the edk2toollib package for ReadTheDocs hosting.
"""
import mkdocs_gen_files
import glob
import os

import mkdocs_gen_files


def main():
"""Entry into script that is executed."""
Expand Down Expand Up @@ -52,5 +54,8 @@ def main():
edit_path = os.path.join('..', 'edk2toollib', edit_path)
mkdocs_gen_files.set_edit_path(filename, edit_path)

with mkdocs_gen_files.open("api/.pages", "w") as f:
print("title: API Reference", file=f)


main()
5 changes: 5 additions & 0 deletions docs/user/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
hide:
- navigation
- toc
---
# Our Philosophy

Edk2 Pytool Library (edk2toollib) is a Tianocore maintained project consisting
Expand Down
2 changes: 1 addition & 1 deletion edk2toollib/database/edk2_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class Edk2DB:
with Edk2DB(Path("path/to/db.db"), edk2path) as db:
db.register(Parser1(), Parser2(), Parser3())
db.parse()

db.connection.execute("SELECT * FROM ?", table)
```
"""
def __init__(self: 'Edk2DB', db_path: str, pathobj: Edk2Path = None, **kwargs: dict[str,Any]) -> 'Edk2DB':
"""Initializes the database.
Expand Down
28 changes: 17 additions & 11 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ copyright: Copyright (c) Microsoft. All rights reserved
site_description: edk2toollib package documentation

theme:
name: readthedocs
name: material
features:
- navigation.tabs
- navigation.indexes
palette:
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode

docs_dir: docs/user

Expand Down Expand Up @@ -41,7 +53,7 @@ markdown_extensions:
- pymdownx.critic
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.magiclink
Expand All @@ -64,12 +76,6 @@ watch:
- 'edk2toollib/'

nav:
- Our Philosophy: index.md
- Advanced Features:
- Edk2 Database: features/edk2_db.md
- ANSI Logging: features/logging.ansi_handler.md
- Get Host Info: features/utility_functions.GetHostInfo.md
- Windows Firmware Policy: features/windows_firmware_policy.md
- Build Objects: features/build_objects.md
- API Reference:
- ... | flat | api/**/*.md
- Home: index.md
- ... | features/**/*.md
- ... | api/**/*.md