From a645d4febdcbb161e5314f35e8f9ad00a695a154 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 11 Oct 2022 13:10:50 +0200 Subject: [PATCH 1/2] Add workflow to build and check docs --- .github/workflows/docs.yml | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..e8cd6ebc3 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,56 @@ +name: "Docs" + +on: + pull_request: + branches: + - "v*.*" + - "master" + - "feature/*" + push: + branches: + - "v*.*" + - "master" + - "feature/*" + +jobs: + giza: + name: "Build Docs" + runs-on: "ubuntu-20.04" + + steps: + - name: "Checkout library" + uses: "actions/checkout@v3" + with: + path: library + fetch-depth: 2 + + - name: "Checkout docs" + uses: "actions/checkout@v3" + with: + repository: mongodb/docs-php-library + path: docs + fetch-depth: 2 + + - name: "Setup python" + uses: actions/setup-python@v4 + with: + python-version: '2.7' + + # The requirements file installs urllib3 with an incompatible version; we replace it with one that works + - name: "Install giza" + run: | + pip install -r https://raw.githubusercontent.com/mongodb/docs-tools/master/giza/requirements.txt + pip install urllib3==1.25.2 + + - name: "Sync documentation" + run: "rsync -a library/docs/ docs/source/" + + - name: "Run Giza" + run: "giza make publish" + working-directory: docs + + - name: "Upload built documentation" + uses: actions/upload-artifact@v3 + with: + name: php-library-docs.tar.gz + path: docs/build/public/master/php-library.tar.gz From 388151557a595a8968ea1da58b8c1db98376a2c6 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 11 Oct 2022 13:18:55 +0200 Subject: [PATCH 2/2] Fix docs build warnings --- docs/reference/bson.txt | 8 ++++---- docs/reference/method/MongoDBChangeStream-current.txt | 2 +- docs/reference/method/MongoDBChangeStream-key.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/bson.txt b/docs/reference/bson.txt index 2d4851a12..7ac5b6bc6 100644 --- a/docs/reference/bson.txt +++ b/docs/reference/bson.txt @@ -14,8 +14,8 @@ Overview -------- MongoDB stores data records as BSON documents. BSON is a binary representation -of :term:`JSON` documents, though it contains more data types than JSON. For the -BSON spec, see `bsonspec.org `_. +of JSON documents, though it contains more data types than JSON. For the BSON +spec, see `bsonspec.org `_. By default, the |php-library| returns BSON documents as :phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as @@ -106,7 +106,7 @@ of the PHP class in a special property within the BSON document. When deserializing a PHP variable from BSON, the encoded class name of a :php:`Persistable ` object will override any class specified in the type map, but it will not override ``"array"`` and - ``"stdClass"`` or ``"object"``. This is discussed in the + ``"stdClass"`` or ``"object"``. This is discussed in the :php:`persistence specification ` but it bears repeating. @@ -121,7 +121,7 @@ Consider the following class definition: private $id; private $name; private $createdAt; - + public function __construct($name) { $this->id = new MongoDB\BSON\ObjectId; diff --git a/docs/reference/method/MongoDBChangeStream-current.txt b/docs/reference/method/MongoDBChangeStream-current.txt index 8057dbaa2..a85786073 100644 --- a/docs/reference/method/MongoDBChangeStream-current.txt +++ b/docs/reference/method/MongoDBChangeStream-current.txt @@ -103,4 +103,4 @@ See Also - :ref:`Tailable Cursor Iteration ` - :manual:`Change Streams ` documentation in the MongoDB manual - :manual:`Change Events ` documentation in the - MongoDB manual \ No newline at end of file + MongoDB manual diff --git a/docs/reference/method/MongoDBChangeStream-key.txt b/docs/reference/method/MongoDBChangeStream-key.txt index 6225c11f6..de4754b4f 100644 --- a/docs/reference/method/MongoDBChangeStream-key.txt +++ b/docs/reference/method/MongoDBChangeStream-key.txt @@ -73,4 +73,4 @@ See Also - :phpmethod:`MongoDB\\Database::watch()` - :php:`Iterator::key() ` - :ref:`Tailable Cursor Iteration ` -- :manual:`Change Streams ` documentation in the MongoDB manual \ No newline at end of file +- :manual:`Change Streams ` documentation in the MongoDB manual