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

Add module docstring to c stub #16

Open
pazzarpj opened this issue Sep 17, 2020 · 2 comments
Open

Add module docstring to c stub #16

pazzarpj opened this issue Sep 17, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@pazzarpj
Copy link
Owner

Porting the python docstring over to the c stub output is handy for maintaining even more documentation synchronization.

Eg.

"""
This module is developed for adding new functionality to upython
   We want tabs
"""

Should translate to

/*
This module is developed for adding new functionality to upython
   We want tabs
*/

There could be a case for adding ustubby generic output to the generated file so that the source is not lost

/*
This module is developed for adding new functionality to upython
    We want tabs

    This file was auto-generated using uStubby.
    Please see https://github.com/pazzarpj/micropython-ustubby
*/
@pazzarpj pazzarpj added the enhancement New feature or request label Sep 17, 2020
@IhorNehrutsa
Copy link
Contributor

Your first comment corresponds to the commit
Put Python module description to C code

TODO: Put the module description from the C code into the target compiled micropython module.
DESCRIPTION in sourse stub module.py -> uStubby -> DESCRIPTION in module.c ->micropython make -> DESCRIPTION in target module.DOC

The target compiled module should have a 'DESCRIPTION' like stub modules from the zip with using the help() command:

>>> import module_description_1
>>> help(module_description_1)
Help on module module_description_1:

NAME
    module_description_1 - This is one-line description of module.

FUNCTIONS
    example() -> None
        no matter here

FILE
    d:\owl\sova\python_source_code\esp32_server\ustubby\module_description_1.py

and

>>> import module_description_2
>>> help(module_description_2)
Help on module module_description_2:

NAME
    module_description_2

DESCRIPTION
    This is multi-line description of module.
    This is multi-line description of module.

FUNCTIONS
    example() -> None
        no matter here
        no matter here

FILE
    d:\owl\sova\python_source_code\esp32_server\ustubby\module_description_2.py

module_description.zip

@pazzarpj
Copy link
Owner Author

Hi Ihor,
I'm not sure how to compile the help into the c extension.
The original intent of this module was to use the type annotated python and run something like OpenAPI across it to generate the documentation for the modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants