Skip to main content

A tool to convert Google-style docstrings to TSX format for Next.js documentation

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Google Docstring to TSX Converter

A tool that converts Python package docstrings to TSX files for Next.js documentation, with a focus on generating beautiful, interactive documentation.

License

This software is licensed under a custom license agreement. The Albumentations Team and their official contributors have free access to use this software for their projects. All other users must obtain a paid license.

For licensing inquiries, please contact: Vladimir Iglovikov (iglovikov@gmail.com)

See the LICENSE file for full details.

Features

  • Converts Google-style docstrings to TSX format with modern UI components
  • Preserves type information and parameter descriptions with syntax highlighting
  • Maintains the original package structure in the output
  • Generates source code with toggle functionality for each class/function
  • Supports both class and function documentation
  • Creates a table of contents for easy navigation
  • Handles module-level docstrings
  • Preserves code examples and formatting
  • Supports complex type definitions with interactive display
  • Generates responsive, dark-themed documentation

Installation

pip install docstring2tsx

Usage

python -m src.docstring2tsx.__main__ --package-name PACKAGE_NAME --output-dir OUTPUT_DIR

or:

docstring2tsx --package-name PACKAGE_NAME --output-dir OUTPUT_DIR

This will:

  1. Import the specified package
  2. Extract docstrings from all classes, functions, and modules
  3. Convert them to TSX format with modern UI components
  4. Create a directory structure matching the package
  5. Write TSX files for each module with proper routing

Output Structure

The tool creates a directory structure that matches the input package:

output_dir/
  module1/
    page.tsx
  module2/
    submodule/
      page.tsx

Each page.tsx file contains:

  • Module name and description in a styled container
  • Table of contents with links to classes and functions
  • Interactive source code display with toggle functionality
  • Parameter descriptions with type information
  • Return values and exceptions with proper formatting
  • Code examples with syntax highlighting
  • References and links to related documentation

Development

# Install dependencies
pip install -e .

# Run tests
pytest

# Run pre-commit hooks
pre-commit run --all-files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docstring2tsx-0.0.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docstring2tsx-0.0.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file docstring2tsx-0.0.1.tar.gz.

File metadata

  • Download URL: docstring2tsx-0.0.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for docstring2tsx-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9e24c03f9071e0ffd05e5e0854999d95caf980b59dc66666714ae2cc8ead3ce3
MD5 1bef2b5c2fbbcaf43f6a05445b54eb1b
BLAKE2b-256 703ee1e2f03d9107875156b6c01383a96742b799e5422e9b1310208decabfe2b

See more details on using hashes here.

File details

Details for the file docstring2tsx-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: docstring2tsx-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for docstring2tsx-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e51e3989156249dbdc5b1b9ebcf085a89a036e4d87ed0093c2e225cd506087f3
MD5 315cd8c651f56665a64e65fdfdb7a935
BLAKE2b-256 a252bf69254413a5b0147bcee11741c4dfac0ca5d0e13eb4ebee5497f5f5822c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page