From c52acf2a1fb4ac863d664f5b5f6e7cdbd4c5f7dc Mon Sep 17 00:00:00 2001
From: Jannis Harder <me@jix.one>
Date: Mon, 19 Jun 2023 11:39:37 +0200
Subject: [PATCH] docs: Make sphinx-argparse work independently of sphinx's cwd

---
 docs/source/conf.py   | 5 +++++
 docs/source/usage.rst | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/source/conf.py b/docs/source/conf.py
index ad037b8..81d249c 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,4 +1,7 @@
 #!/usr/bin/env python3
+import sys
+import os
+
 project = 'YosysHQ SBY'
 author = 'YosysHQ GmbH'
 copyright = '2023 YosysHQ GmbH'
@@ -40,3 +43,5 @@ html_theme_options = {
 
 extensions = ['sphinx.ext.autosectionlabel']
 extensions += ['sphinxarg.ext']
+
+sys.path.append(os.path.abspath(f"{__file__}/../../../sbysrc"))
diff --git a/docs/source/usage.rst b/docs/source/usage.rst
index 5a3bf79..bc8e4e9 100644
--- a/docs/source/usage.rst
+++ b/docs/source/usage.rst
@@ -6,6 +6,6 @@ one of the available CAD suites, it can be called as follows.  Note that this in
 available via `sby --help`.  For more information on installation, see :ref:`install-doc`.
 
 .. argparse::
-    :filename: ../sbysrc/sby_cmdline.py
+    :module: sby_cmdline
     :func: parser_func
     :prog: sby