From d26c6012572c13b4f476b538d40731503d539ffd Mon Sep 17 00:00:00 2001 From: Wu Zhenyu Date: Sat, 2 Sep 2023 23:04:44 +0800 Subject: [PATCH] :heavy_plus_sign: Use sphinxcontrib-autofile for documents --- docs/api/pkgbuild-language-server.md | 9 ++++----- docs/conf.py | 2 +- docs/requirements.txt | 2 +- scripts/generate-api.md.pl | 10 ---------- 4 files changed, 6 insertions(+), 17 deletions(-) delete mode 100755 scripts/generate-api.md.pl diff --git a/docs/api/pkgbuild-language-server.md b/docs/api/pkgbuild-language-server.md index dfa5eda..3a16c23 100644 --- a/docs/api/pkgbuild-language-server.md +++ b/docs/api/pkgbuild-language-server.md @@ -1,8 +1,7 @@ # pkgbuild-language-server -````{eval-rst} -```{eval-sh} -cd .. -scripts/generate-api.md.pl src/*/*.py +```{autofile} ../../src/*/*.py +--- +module: +--- ``` -```` diff --git a/docs/conf.py b/docs/conf.py index 9dff5d7..3dedfd4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,8 +33,8 @@ "sphinx.ext.viewcode", "sphinx.ext.githubpages", "myst_parser", + "sphinxcontrib.autofile", "sphinxcontrib.requirements_txt", - "sphinxcontrib.eval", ] myst_heading_anchors = 3 diff --git a/docs/requirements.txt b/docs/requirements.txt index b92bc38..dc36ad4 100755 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,5 +2,5 @@ -e . myst-parser -sphinxcontrib-eval +sphinxcontrib-autofile sphinxcontrib-requirements-txt diff --git a/scripts/generate-api.md.pl b/scripts/generate-api.md.pl deleted file mode 100755 index f5a6281..0000000 --- a/scripts/generate-api.md.pl +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env -S perl -n -$. = 1 unless $#ARGV == $oldargc; -$oldargc = $#ARGV; -next unless $. == 1; -$_ = $ARGV; -s=src/=.. automodule:: =; -s=\.py$=\n :members:\n=; -s=/__init__==; -s=/=.=g; -print;