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

Doc impr: auto generate url to Python's website for lib API #2

Open
litlighilit opened this issue Jun 11, 2024 · 1 comment
Open

Doc impr: auto generate url to Python's website for lib API #2

litlighilit opened this issue Jun 11, 2024 · 1 comment
Labels
doc Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed idea Creative Idea sugar syntax sugar, e.g. macros

Comments

@litlighilit
Copy link
Member

litlighilit commented Jun 11, 2024

original draft:

when defined(nimdoc):
  macro pydoc*(decl) =
    let symId = _getName decl
    let sym = symId.strVal
    let moduleName = _getModuleName()
    let url = "https://docs.python.org/<PyMajor>.<PyMinor>/library/" & moduleName & '#' & moduleName & '.' & sym
    var nDecl = decl
    nDecl._addDocUrl url
    result = nDecl
else:
  template pydoc*(decl) = decl

Note: symbols that begins with underscore is seudo operator (not impl here).

@litlighilit litlighilit added help wanted Extra attention is needed doc Improvements or additions to documentation idea Creative Idea enhancement New feature or request labels Jun 11, 2024
@litlighilit litlighilit added the sugar syntax sugar, e.g. macros label Jun 20, 2024
@litlighilit
Copy link
Member Author

Also, maybe helps to support pydoc.help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed idea Creative Idea sugar syntax sugar, e.g. macros
Projects
None yet
Development

No branches or pull requests

1 participant