Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/airtai/nbdev-mkdocs
Extension to nbdev for generating docs with Material for Mkdocs
https://github.com/airtai/nbdev-mkdocs
mkdocs mkdocs-material nbdev
Last synced: 3 months ago
JSON representation
Extension to nbdev for generating docs with Material for Mkdocs
- Host: GitHub
- URL: https://github.com/airtai/nbdev-mkdocs
- Owner: airtai
- License: apache-2.0
- Created: 2022-10-03T14:55:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T10:28:09.000Z (11 months ago)
- Last Synced: 2024-04-28T02:39:44.374Z (8 months ago)
- Topics: mkdocs, mkdocs-material, nbdev
- Language: Jupyter Notebook
- Homepage: https://nbdev-mkdocs.airt.ai
- Size: 9.41 MB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Material for nbdev
![](https://raw.githubusercontent.com/airtai/nbdev-mkdocs/main/nbs/images/nbdev_mkdocs_banner_img.png)
------------------------------------------------------------------------
**Documentation**: https://nbdev-mkdocs.airt.ai
**Source Code**: https://github.com/airtai/nbdev-mkdocs
------------------------------------------------------------------------
## Getting Started
![PyPI](https://img.shields.io/pypi/v/nbdev-mkdocs.png) ![PyPI -
Downloads](https://img.shields.io/pypi/dm/nbdev-mkdocs.png) ![PyPI -
Python Version](https://img.shields.io/pypi/pyversions/nbdev-mkdocs.png)![GitHub Workflow
Status](https://img.shields.io/github/actions/workflow/status/airtai/nbdev-mkdocs/test.yaml)![CodeQL](https://github.com/airtai/nbdev-mkdocs/actions/workflows/codeql.yml/badge.svg)
![Dependency
Review](https://github.com/airtai/nbdev-mkdocs/actions/workflows/dependency-review.yml/badge.svg)![GitHub](https://img.shields.io/github/license/airtai/nbdev-mkdocs.png)
------------------------------------------------------------------------
**Material for nbdev** is a
nbdev extension
that allows you to use
Material
for MkDocs to generate documentation for nbdev projects.The key features are:
- **Material style documentation**: Effortlessly create material style
documentation for your nbdev projects with Material for MkDocs, a
theme that provides a sleek and modern design for your documentation.
- **Auto generate docstrings**: Instantly generate docstrings for your
Python code using
docstring-gen
library, a tool that automatically generates docstrings for your
functions and classes using Codex.
- **Create stunning social media share images**: Boost your project’s
visibility by creating striking social share images using DALL-E.
- **Customizability**: Add guides, release notes, customise the
navigation menu and configure the Material for MkDocs easily to suit
your project needs. With this documentation tool, you have more
control over the look and feel of your documentation, allowing you to
create a unique and personalized experience for your users.### Workflow
Here’s a quick comparison of Quarto and Material for nbdev development
workflows:Quarto workflow
Material for nbdev workflow
Install:
``` shell
$ pip install notebook nbdev
$ nbdev_install_quarto
```Install:
``` shell
$ pip install notebook nbdev
$ nbdev_install_quarto
$ pip install nbdev-mkdocs
```Setup:
``` shell
$ nbdev_new
$ nbdev_install_hooks
$ vi settings.ini
$ pip install -e '.[dev]'
```Setup:
``` shell
$ nbdev_new
$ nbdev_install_hooks
$ vi settings.ini
$ pip install -e '.[dev]'
$ nbdev_mkdocs new
$ vi mkdocs/mkdocs.yml
```Development:
``` shell
# Edit files
$ nbdev_preview
```Development:
``` shell
# Edit files
$ nbdev_mkdocs preview
```Commit changes:
``` shell
$ nbdev_prepare
$ git commit -am “Commit message”
$ git push
```Commit changes:
``` shell
$ nbdev_mkdocs prepare
$ git commit -am “Commit message”
$ git push
```### Quick start
The following quick start guide will walk you through installing and
configuring nbdev-mkdocs for an existing nbdev project. It also assumes
you’ve already initialized your project with nbdev and installed all of
the required libraries.For detailed installation instructions and configuration options, please
see the
User
Guide.### Install
nbdev-mkdocs is published as a Python package and can be installed with
pip:``` shell
pip install nbdev-mkdocs
```Note that `nbdev-mkdocs` must be installed in the same Python
environment as nbdev.If the installation was successful, you should now have the
**nbdev-mkdocs** installed on your system. Run the below command from
the terminal to see the full list of available commands:``` shell
nbdev_mkdocs --help
```
Usage: nbdev_mkdocs [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy │
│ it or customize the installation. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ delete-pre-release-docs Deletes deployed pre-release documentation │
│ versions. │
│ docs Prepares files in 'mkdocs/docs' and then runs │
│ 'mkdocs build' command on them. │
│ docstring Command for adding docstrings to classes and │
│ methods that don't have one using docstring-gen │
│ library. │
│ new Creates files in 'mkdocs' subdirectory needed for │
│ other 'nbdev_mkdocs' subcommands. │
│ prepare Runs tests and prepares files in 'mkdocs/docs' and │
│ then runs 'mkdocs build' command on them. │
│ preview Prepares files in 'mkdocs/docs' and then runs │
│ 'mkdocs serve' command on them. │
│ readme Updates the README.md file from the 'readme_nb' │
│ notebook. Unless explicitly changed in the │
│ settings.ini file, the 'readme_nb' points to the │
│ 'index.ipynb' notebook in the 'nbs_path' directory. │
│ social-image Command for generating a custom social share image. │
╰──────────────────────────────────────────────────────────────────────────────╯#### Setup
After installing nbdev-mkdocs, bootstrap your project documentation by
executing the following command from the project’s root directory:``` shell
nbdev_mkdocs new
```Using information from the project’s settings.ini file, the above
command creates files and directories required to build the
documentation and saves it in the **mkdocs** subdirectory.Note: You should only run the **nbdev_mkdocs new** command once for the
project to initialise the files required for building Material for
MkDocs documentation.#### Preview changes
nbdev_mkdocs lets you preview your changes as you write your
documentation. Execute the following command from the project root
directory to start a local server, and preview your documentation:**Note**: If you haven’t already installed your library locally, run
`pip install -e '.[dev]'` command before running the
`nbdev_mkdocs prepare` command.``` shell
nbdev_mkdocs preview
```#### Prepare changes
To prepare your changes for Git push, we recommend executing the
following commands:First, run the `nbdev_mkdocs prepare` command in the terminal. This
command exports the library, runs tests, and cleans the notebooks.``` shell
nbdev_mkdocs prepare
```Then, run the `nbdev_mkdocs readme` command to update the README.md file
from the ‘readme_nb’ notebook. By default, ‘readme_nb’ points to
‘index.ipynb’ notebook in the ‘nbs_path’ unless modified in the
settings.ini file.This command does everything the ‘nbdev_readme’ command does, plus it
generates symbol references that are compatible with ‘Material for
nbdev’.``` shell
nbdev_mkdocs readme
```Finally, double-check your settings.ini file to ensure that it has all
of the correct information. Then commit and push your additions to
GitHub:``` shell
git commit -am'Commit Message'
git push
```## Copyright
Copyright © 2022 onwards airt technologies ltd, Inc.
## License
This project is licensed under the terms of the [Apache License
2.0](https://github.com/airtai/nbdev-mkdocs/blob/main/LICENSE)