{"id":23969,"library":"linuxdoc","title":"Linuxdoc","description":"Sphinx-doc extensions and tools to extract documentation from C/C++ source file comments, including kernel-doc support. Current version 20240924. Released as needed, no fixed cadence.","status":"active","version":"20240924","language":"python","source_language":"en","source_url":"https://github.com/return42/linuxdoc","tags":["sphinx","documentation","c","c++","kernel-doc"],"install":[{"cmd":"pip install linuxdoc","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for building documentation with Sphinx extensions.","package":"sphinx","optional":false}],"imports":[{"note":"KernelDocDirective is in the kernel_doc submodule, not top-level.","wrong":"from linuxdoc import KernelDocDirective","symbol":"KernelDocDirective","correct":"from linuxdoc.kernel_doc import KernelDocDirective"},{"note":"Direct extension used in conf.py.","symbol":"linuxdoc_extension","correct":"from linuxdoc import linuxdoc_extension"}],"quickstart":{"code":"# conf.py\nfrom linuxdoc import linuxdoc_extension\nextensions = ['linuxdoc.linuxdoc_extension']\n# Also register kernel-doc directive\nfrom linuxdoc.kernel_doc import KernelDocDirective\ndef setup(app):\n    app.add_directive('kernel-doc', KernelDocDirective)\n","lang":"python","description":"Minimal conf.py setup to enable linuxdoc extension and kernel-doc directive."},"warnings":[{"fix":"Use `from linuxdoc.kernel_doc import KernelDocDirective`.","message":"As of version 20240924, the import path for KernelDocDirective is `linuxdoc.kernel_doc.KernelDocDirective`; importing from top-level `linuxdoc.KernelDocDirective` fails.","severity":"gotcha","affected_versions":">=2024"},{"fix":"Ensure source files use kernel-doc style comments (e.g., /** ... */).","message":"The extension is meant for C/C++ kernel-doc comments; it may not work with other comment styles.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Sphinx version that matches linuxdoc's requirements (see setup.py/requirements).","message":"Linuxdoc requires Sphinx; incompatible Sphinx versions may cause failures. Check compatibility with your Sphinx version.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install linuxdoc` in your active environment.","cause":"Package not installed or wrong Python environment.","error":"ModuleNotFoundError: No module named 'linuxdoc'"},{"fix":"Add `app.add_directive('kernel-doc', KernelDocDirective)` in setup function after importing.","cause":"KernelDocDirective not registered in Sphinx conf.py.","error":"WARNING: unknown directive type 'kernel-doc'"},{"fix":"Use `from linuxdoc.kernel_doc import KernelDocDirective`.","cause":"Incorrect import; KernelDocDirective is in submodule.","error":"Exception occurred: AttributeError: module 'linuxdoc' has no attribute 'KernelDocDirective'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}