Implementation:Haosulab ManiSkill GenerateTaskDocs
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Scene_Building |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
External tool for automatically generating task documentation pages for all registered ManiSkill environments, producing categorized Markdown files with task cards, video thumbnails, and metadata tables.
Description
generate_task_docs.py is a documentation generation script that introspects the ManiSkill environment registry to produce structured documentation for all tasks. It is run as a standalone script, not as part of the simulation runtime.
The script performs the following steps:
- Module discovery -- Walks the
mani_skill/envs/tasksdirectory tree, importing all Python modules and collecting classes defined within each module. - Filtering -- Retains only classes that are registered in the
REGISTERED_ENVSregistry and have docstrings. - Categorization -- Groups tasks into categories: tabletop, humanoid, mobile_manipulation, quadruped, control, drawing. Each category has a predefined header and description.
- HTML table generation -- Creates an HTML table for each category with columns: Task (env_id), Preview (first/last frame thumbnails), Dense Reward, Success/Fail Conditions, Demos, Max Episode Steps.
- Thumbnail extraction -- For environments with
_sample_video_link, extracts first and last frames from demo videos, resizes to 256px, and saves as compressed PNGs. - Task cards -- Generates detailed task cards using class docstrings wrapped in MyST dropdown components, with reward badges and video embeds.
- Validation -- Warns about mismatches between declared reward modes and implemented reward functions.
Output is written to docs/source/tasks/{category}/index.md files.
Usage
Run as a standalone script to regenerate task documentation after adding or modifying environments:
python docs/generate_task_docs.py
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: docs/generate_task_docs.py
Signature
# Constants
TASK_CATEGORIES_TO_INCLUDE = ["tabletop", "humanoid", "mobile_manipulation", "quadruped", "control", "drawing"]
TASK_CATEGORIES_NAME_MAP = {"tabletop": "table_top_gripper"}
GENERATED_TASKS_DOCS_FOLDER = "tasks"
# Main function
def main(): ...
Invocation
python docs/generate_task_docs.py
I/O Contract
| Input | Output |
|---|---|
ManiSkill environment registry (REGISTERED_ENVS) |
Markdown documentation files in docs/source/tasks/
|
Demo video files in figures/environment_demos/ |
Thumbnail PNGs in docs/source/_static/env_thumbnails/
|
Generated documentation structure per category:
| Section | Content |
|---|---|
| Header | Category name and description |
| Task Table | HTML table with env IDs, previews, reward badges, max steps |
| Task Cards | Dropdown sections per environment with docstring and video |
Usage Examples
# Run from the repository root
# python docs/generate_task_docs.py
# The script uses these ManiSkill imports:
import mani_skill.envs
from mani_skill.utils.download_demo import DATASET_SOURCES
from mani_skill.utils.registration import REGISTERED_ENVS