From 05c301a064c1e2038c14bcbf2aad302b99916512 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Wed, 18 Feb 2026 08:27:47 -0800 Subject: [PATCH] update go doc Signed-off-by: Nikolaj Bjorner --- .github/workflows/docs.yml | 3 ++- doc/mk_api_doc.py | 21 ++++++--------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5450d0ca0..987268215 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -93,11 +93,12 @@ jobs: which clang++ npm run build:wasm - - name: Generate JS Documentation (from doc directory) + - name: Generate JS and Go Documentation (from doc directory) working-directory: doc run: | eval $(opam env) python3 mk_api_doc.py --js --go --output-dir=api --mld --z3py-package-path=../build-x64/python/z3 --build=../build-x64 + python3 mk_go_doc.py - name: Deploy to z3prover.github.io uses: peaceiris/actions-gh-pages@v4 diff --git a/doc/mk_api_doc.py b/doc/mk_api_doc.py index ae3d6c931..50d0656a5 100644 --- a/doc/mk_api_doc.py +++ b/doc/mk_api_doc.py @@ -507,22 +507,13 @@ try: # Add links to the README readme_path = os.path.join(go_api_abs_path, 'README.md') if os.path.exists(readme_path): - # Copy README as index documentation - readme_html_path = os.path.join(go_output_dir, 'README.html') + # Copy README as documentation + readme_md_path = os.path.join(go_output_dir, 'README.md') try: - # Try to convert markdown to HTML if markdown module is available - with open(readme_path, 'r') as rf: - readme_content = rf.read() - with open(readme_html_path, 'w') as wf: - wf.write('\n\n\n') - wf.write('Z3 Go API - README\n') - wf.write('\n') - wf.write('\n\n
\n')
-                            wf.write(readme_content)
-                            wf.write('
\n\n\n') - f.write('
  • README - Getting Started
  • \n') + shutil.copy(readme_path, readme_md_path) + f.write('
  • README - Getting Started
  • \n') except Exception as e: - print(f"Warning: Could not process README.md: {e}") + print(f"Warning: Could not copy README.md: {e}") # Add module descriptions f.write('
  • z3.go - Core types (Context, Config, Symbol, Sort, Expr, FuncDecl)
  • \n') @@ -548,7 +539,7 @@ try: f.write('\n') f.write('

    Installation

    \n') - f.write('

    See README for build instructions.

    \n') + f.write('

    See README for build instructions.

    \n') f.write('

    Go back to main API documentation.

    \n') f.write('\n\n')