Skip to content

Instantly share code, notes, and snippets.

@chambbj
Created February 21, 2025 20:40
Show Gist options
  • Select an option

  • Save chambbj/7a31fda731a7d125b6772f98a104e52e to your computer and use it in GitHub Desktop.

Select an option

Save chambbj/7a31fda731a7d125b6772f98a104e52e to your computer and use it in GitHub Desktop.

Revisions

  1. chambbj created this gist Feb 21, 2025.
    20 changes: 20 additions & 0 deletions environment.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    name: gdal-docs
    channels:
    - conda-forge
    dependencies:
    - doxygen
    - gdal
    - pip
    - pip:
    - breathe
    - numpy
    - recommonmark
    - sphinx
    - sphinx-bootstrap-theme
    - sphinx-markdown-tables
    - sphinx-rtd-theme
    - sphinxcontrib-bibtex
    - sphinxcontrib-jquery
    - sphinxcontrib-spelling
    - pyenchant
    - myst_nb
    56 changes: 56 additions & 0 deletions terminal.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    Short of going through and providing a full Windows config for the Cmake configuration, I was able to get the following to work.

    After cloning GDAL, change to the doc directory.

    ```console
    cd /path/to/gdal/doc
    ```

    Next step does assume that Python is installed.

    ```console
    python source\build_driver_summary.py source\drivers\raster raster_driver_summary source\drivers\raster\driver_summary.rst
    python source\build_driver_summary.py source\drivers\vector vector_driver_summary source\drivers\vector\driver_summary.rst
    ```

    Now we will setup the suggested GDAL doc environment. I have lightly modified the `environment.yml`, see the update in this gist.

    ```console
    mamba env create -f environment.yml
    mamba activate gdal-docs
    ```

    Now, we will manually run some Doxygen commands for now.

    ```console
    mkdir build\xml
    (
    type Doxyfile
    echo GENERATE_HTML=NO
    echo GENERATE_XML=YES
    echo XML_OUTPUT=build\xml
    echo XML_PROGRAMLISTING=NO
    ) | doxygen -

    mkdir build\html_extra\doxygen
    (
    type Doxyfile
    echo HTML_OUTPUT=build\html_extra\doxygen
    echo INLINE_INHERITED_MEMB=YES
    ) | doxygen -
    ```

    Jump over to a PowerShell terminal and run this to replace ndash with `--`.

    ```PowerShell
    cd /path/to/gdal/doc
    Get-ChildItem "build\xml\*.xml" | ForEach-Object {
    (Get-Content $_.FullName) -replace '<ndash/>', '--' | Set-Content $_.FullName
    }
    ```

    Back in the miniforge terminal, run this command to actually build the docs. I did get quite a few warnings, but it did build for the most part, likely enough to feel comfortable with the tutorial additions. You can navigate to the `build\html\index.html` and open it in a browser to preview the work.

    ```console
    sphinx-build -M html source build --keep-going -j auto -W
    ```