Code Monkey home page Code Monkey logo

vba's Introduction

mkdocstrings

ci documentation pypi version conda version gitpod gitter

Automatic documentation from sources, for MkDocs. Come have a chat or ask questions on our Gitter channel.


Features - Installation - Quick usage

mkdocstrings_gif1

Features

  • Language-agnostic: just like MkDocs, mkdocstrings is written in Python but is language-agnostic. It means you can use it with any programming language, as long as there is a handler for it. We currently have handlers for the Crystal, Python, and VBA languages, as well as for shell scripts/libraries. Maybe you'd like to add another one to the list? ๐Ÿ˜‰

  • Multiple themes support: each handler can offer multiple themes. Currently, we offer the :star: Material theme โญ as well as basic support for the ReadTheDocs and MkDocs themes for the Python handler.

  • Cross-references across pages: mkdocstrings makes it possible to reference headings in other Markdown files with the classic Markdown linking syntax: [identifier][] or [title][identifier] -- and you don't need to remember which exact page this object was on. This works for any heading that's produced by a mkdocstrings language handler, and you can opt to include any Markdown heading into the global referencing scheme.

    Note: in versions prior to 0.15 all Markdown headers were included, but now you need to opt in.

  • Cross-references across sites: similarly to Sphinx's intersphinx extension, mkdocstrings can reference API items from other libraries, given they provide an inventory and you load that inventory in your MkDocs configuration.

  • Inline injection in Markdown: instead of generating Markdown files, mkdocstrings allows you to inject documentation anywhere in your Markdown contents. The syntax is simple: ::: identifier followed by a 4-spaces indented YAML block. The identifier and YAML configuration will be passed to the appropriate handler to collect and render documentation.

  • Global and local configuration: each handler can be configured globally in mkdocs.yml, and locally for each "autodoc" instruction.

  • Reasonable defaults: you should be able to just drop the plugin in your configuration and enjoy your auto-generated docs.

Used by

mkdocstrings is used by well-known companies, projects and scientific teams: Ansible, Apache, Google, Jitsi, Microsoft, Prefect, Pydantic, and more...

Installation

With pip:

pip install mkdocstrings

You can install support for specific languages using extras, for example:

pip install 'mkdocstrings[crystal,python]'

See the available language handlers.

With conda:

conda install -c conda-forge mkdocstrings

Quick usage

In mkdocs.yml:

site_name: "My Library"

theme:
  name: "material"

plugins:
- search
- mkdocstrings

In one of your markdown files:

# Reference

::: my_library.my_module.my_class

See the Usage section of the docs for more examples!

vba's People

Contributors

malankriel avatar pawamoy avatar rudolfbyker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

pawamoy

vba's Issues

Fix publish.yml

publish.yml is still pointing to the private Pypi from the AutoActuary organization. This should change to the public Pypi before we make a new release.

Can't find 'templates' folder for handler 'vba'

When trying to compile VBA docs on
VirtualActuary/MiscVBAFunctions@3a54f77

cd docs
python -m pip install -r requirements.txt
mkdocs build

We run into the following error on the mkdocstrings-vba side:

PS C:\Users\simon\devel\MiscVBAFunctions\docs> mkdocs build
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: C:\Users\simon\devel\MiscVBAFunctions\docs\dist
ERROR    -  Error reading page 'MiscVBAFunctions\Modules\Casing.md': Can't find 'templates' folder for handler 'vba'
Traceback (most recent call last):
  File "C:\Users\simon\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\simon\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\simon\anaconda3\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\__main__.py", line 192, in build_command
    build.build(config.load_config(**kwargs), dirty=not clean)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\commands\build.py", line 292, in build
    _populate_page(file.page, config, files, dirty)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\commands\build.py", line 174, in _populate_page
    page.render(config, files)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\structure\pages.py", line 175, in render
    self.content = md.convert(self.markdown)
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\core.py", line 264, in convert
    root = self.parser.parseDocument(self.lines).getroot()
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\blockparser.py", line 90, in parseDocument
    self.parseChunk(self.root, '\n'.join(lines))
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\blockparser.py", line 105, in parseChunk
    self.parseBlocks(parent, text.split('\n\n'))
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\blockparser.py", line 123, in parseBlocks
    if processor.run(parent, blocks) is not False:
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\extension.py", line 120, in run
    html, handler, data = self._process_block(identifier, block, heading_level)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\extension.py", line 177, in _process_block
    handler = self._handlers.get_handler(handler_name, handler_config)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\handlers\base.py", line 473, in get_handler
    self._handlers[name] = module.get_handler(
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings_handlers\vba\handler.py", line 74, in get_handler
    renderer=VbaRenderer("vba", theme, custom_templates),
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\handlers\base.py", line 100, in __init__
    themes_dir = self.get_templates_dir(handler)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\handlers\base.py", line 183, in get_templates_dir
    raise FileNotFoundError(f"Can't find 'templates' folder for handler '{handler}'")
FileNotFoundError: Can't find 'templates' folder for handler 'vba'

Create and publish docs

Ideally, and obviously, the handler would have docs built with MkDocs ๐Ÿ™‚
Then we can publish it at https://mkdocstrings.github.io/vba and list the handler in mkdocstrings docs.

If you're not interested or don't have the capacity, which is totally fine, I can simply point at the GitHub repository ๐Ÿ™‚ Let me know!

BaseCollector and BaseRenderer are deprecated

I was going to release mkdocstrings 0.23.0, and fortunately before doing so I wanted to update the docs to mention the VBA handler, and I noticed that it is still using the deprecated BaseCollector and BaseRenderer classes, that mkdocstrings 0.23.0 finally removes.

I can try and send a PR that merges both the collector and renderer into the handler ๐Ÿ™‚

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.