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 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