Skip to content

Commit

Permalink
fix some api.rst underline too short
Browse files Browse the repository at this point in the history
 add script and instructions to readme

 fixup formatting

 fixup yaml workflow file

 modify generate docs script and format a bit better

add manually format api.rst for sections

 latest docs generated
  • Loading branch information
bitkarrot committed Dec 10, 2024
1 parent 646d442 commit fa839e2
Show file tree
Hide file tree
Showing 22 changed files with 509 additions and 2,816 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/python-api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.9.x'

- name: "Install dependencies"
run: |
Expand All @@ -24,11 +24,11 @@ jobs:
- name: "Build Python API documentation"
run: |
cd ./bdk-python/
bash ./scripts/build-linux-x86_64.sh
python scripts/generate_docs.py
sphinx-build -b html docs/ docs/_build/html
- name: "Upload Python website"
uses: actions/upload-artifact@v4
with:
name: artifact-python-api-docs
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/docs/_build/html/
# - name: "Upload Python website"
# uses: actions/upload-artifact@v4
# with:
# name: artifact-python-api-docs
# path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/docs/_build/html/
15 changes: 15 additions & 0 deletions bdk-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ python setup.py --verbose bdist_wheel
```shell
pip install ./dist/bdkpython-<yourversion>.whl
```

## generate the docs

```shell
python3 scripts/generate_docs.py
sphinx-build -b html docs/ docs/_build/html
```

To rebuild, run the following. be sure to keep the conf.py and index.rst

```shell
rm -rf docs/_build/html
python3 scripts/generate_docs.py
sphinx-build -b html docs/ docs/_build/html
```
2 changes: 1 addition & 1 deletion bdk-python/docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2e1e3dc39064c1de4564a7de697f9f15
config: 5fb7a54e8266e4003565896ce90c2a2e
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified bdk-python/docs/_build/html/.doctrees/api.doctree
Binary file not shown.
Binary file modified bdk-python/docs/_build/html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified bdk-python/docs/_build/html/.doctrees/index.doctree
Binary file not shown.
326 changes: 223 additions & 103 deletions bdk-python/docs/_build/html/_modules/bdkpython/bdk.html

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions bdk-python/docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; Bitcoin Dev Kit Python documentation</title>
<title>Overview: module code &mdash; BDK Python 0.1.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../_static/documentation_options.js?v=01f34227"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
Expand All @@ -29,7 +29,7 @@


<a href="../index.html" class="icon icon-home">
Bitcoin Dev Kit Python
BDK Python
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
Expand All @@ -41,7 +41,10 @@
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api.html">BDK Python API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api.html#api-reference">API Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api.html#bdk-module">Bdk Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api.html#bitcoin-module">Bitcoin Module</a></li>
</ul>

</div>
Expand All @@ -50,7 +53,7 @@

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Bitcoin Dev Kit Python</a>
<a href="../index.html">BDK Python</a>
</nav>

<div class="wy-nav-content">
Expand Down
157 changes: 25 additions & 132 deletions bdk-python/docs/_build/html/_sources/api.rst.txt
Original file line number Diff line number Diff line change
@@ -1,138 +1,31 @@
API Reference
============
BDK Python API Reference
=====================

.. currentmodule:: bdkpython
This document describes the Python API for the Bitcoin Development Kit (BDK).

Core Types
---------
Bdk Module
==========
Bitcoin Module
==============

Amount and Fees
~~~~~~~~~~~~~~
.. autoclass:: Amount
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: FeeRate
:members:
:undoc-members:
:show-inheritance:

Addresses and Scripts
~~~~~~~~~~~~~~~~~~~
.. autoclass:: Address
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: Script
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: OutPoint
:members:
:undoc-members:
:show-inheritance:

Descriptors
~~~~~~~~~~
.. autoclass:: Descriptor
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: DescriptorPublicKey
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: DescriptorSecretKey
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: DerivationPath
:members:
:undoc-members:
:show-inheritance:

Wallet Operations
---------------

Transaction Building
~~~~~~~~~~~~~~~~~~
.. autoclass:: TxBuilder
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: BumpFeeTxBuilder
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: TxBuilderResult
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: Psbt
:members:
:undoc-members:
:show-inheritance:

Blockchain Clients
~~~~~~~~~~~~~~~~
.. autoclass:: Blockchain
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: ElectrumClient
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: EsploraClient
:members:
:undoc-members:
:show-inheritance:

Wallet
~~~~~~
.. autoclass:: Wallet
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: WalletSync
:members:
:undoc-members:
:show-inheritance:

Utilities
Examples
--------
.. autoclass:: Mnemonic
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: Network
:members:
:undoc-members:
:show-inheritance:

Exceptions
---------
.. autoexception:: InternalError
:members:
:show-inheritance:

.. autoexception:: FeeRateError
:members:
:show-inheritance:
Basic Wallet Usage
~~~~~~~~~~~~~~~~

.. autoexception:: ParseAmountError
:members:
:show-inheritance:
.. code-block:: python
from bdkpython import *
# Create a new wallet
descriptor = "wpkh(...)" # Your descriptor here
wallet = Wallet(descriptor, network=Network.TESTNET)
# Sync wallet
blockchain = Blockchain("https://blockstream.info/testnet/api")
wallet.sync(blockchain)
# Get balance
balance = wallet.get_balance()
print(f"Confirmed balance: {balance.confirmed}")
7 changes: 3 additions & 4 deletions bdk-python/docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Welcome to Bitcoin Dev Kit Python's documentation!
=============================================
Welcome to BDK Python's documentation!
========================================

.. toctree::
:maxdepth: 10
:maxdepth: 2
:caption: Contents:

api
examples

Indices and tables
==================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '',
VERSION: '0.1.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
Loading

0 comments on commit fa839e2

Please sign in to comment.