Skip to main content

Sphinx extension to handle Visual Basic Domain.

Project description

sphinx-vb-domain

Overview

Sphinx extension to handle Visual Basic function directive, and also create the directives from document comments in VB source code.

Installation

pip

pip install sphinx-vb-domain

rye

rye add --dev sphinx-vb-domain

Usage

conf.py

Add it to extensions.

# conf.py

extensions = [
    'sphinx_vb_domain',
]

Function directive

For example.

.. vb:function:: Private Function getId(ByVal name As String, ByVal age As Integer) As Integer
   :module: Module1

   A simple private function.

   :param name: Name
   :type name: String
   :param age: Age
   :type age: Integer
   :returns: Id
   :rtype: Integer

   Remarks here.

Autodoc

To creade document from VB document comments, following config is needed.

# conf.py

vb_autodoc_paths = [
    ('vb-src-dir', 'page-path', 'page-title'),
]
  • vb-src-dir
    • Path to directory contains VB source, relative from conf.py (e.g. '../../macros').
  • page-path
    • Path to reST file tobe created, relative from Sphinx source directory (e.g. 'modules' will create 'modules.rst').
  • page-title
    • Title (level-1 headline) added to e.g. modules.rst.

Then, run sphinx-build with -D vb_autodoc=1 parameter.

In modules.rst, Module (level-2 headline) is created per vb files in src dir, and function directives under the Modules.

Known issues

  • Function directive always rendered in Japanese like follows.
    Private Function getId(ByVal name As String, ByVal age As Integer) As Integer
    
        A simple private function.
    
        パラメータ: ・name (String) -- Name
                    ・age (Integer) -- Age
        戻り値: Id
        戻り値の型: Integer
    
        Remarks here.
    
    • You can change doc_field_types definition of VBFunction class.

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

sphinx_vb_domain-0.2.2.tar.gz (815.5 kB view details)

Uploaded Source

Built Distribution

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

sphinx_vb_domain-0.2.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_vb_domain-0.2.2.tar.gz.

File metadata

  • Download URL: sphinx_vb_domain-0.2.2.tar.gz
  • Upload date:
  • Size: 815.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for sphinx_vb_domain-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f421241d1bd1551f36309fb97152ed4c701cb7176580a6a63d2c0ef706f358af
MD5 427cdc397f16d723cb7ec795af155899
BLAKE2b-256 a0884c91ea85e8a3621a549440cc9243300d7cb803852ec786616a72a9c97157

See more details on using hashes here.

File details

Details for the file sphinx_vb_domain-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_vb_domain-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e50cfd35c23d506d0c4c5bc313bc299f68295172ae83fc4bf653f2820d6b7eb
MD5 6580334366b93b80b6110d6e7fb439d8
BLAKE2b-256 58b07497d53f502351d8fd5841f7276f59af182cb9e7de84777490448a117746

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