LightGBM/docs
James Lamb 6330d6269c
[ci] enable ruff-format on some files, add pre-commit config (#6308)
2024-02-14 22:17:35 -06:00
..
_static [ci] Update version of Azure REST API (#5172) 2022-04-24 10:44:40 -05:00
logo [R-package] Add R logo (fixes #3331, #3332) (#3336) 2020-08-29 23:09:26 -05:00
.linkcheckerrc [docs] fix broken links (#6161) 2023-11-06 11:59:01 -06:00
Advanced-Topics.rst Treat position bias via GAM in LambdaMART (#5929) 2023-09-04 17:05:46 +08:00
C-API.rst [ci][docs] generate docs for C API (#2059) 2019-05-05 14:54:37 +03:00
Development-Guide.rst Decouple Boosting Types (fixes #3128) (#4827) 2022-12-28 14:09:11 +08:00
Experiments.rst [docs] reduce redirects in docs links (#6181) 2023-11-13 20:26:35 -06:00
FAQ.rst [ci] [docs] add Oliver to CODEOWNERS (#6247) 2023-12-22 09:21:36 -06:00
Features.rst [docs] reduce redirects in docs links (#6181) 2023-11-13 20:26:35 -06:00
GPU-Performance.rst [docs] reduce redirects in docs links (#6181) 2023-11-13 20:26:35 -06:00
GPU-Targets.rst [docs] Fix small typo and grammar in docs (#6245) 2023-12-21 12:59:55 -06:00
GPU-Tutorial.rst [docs] Fix small typo and grammar in docs (#6245) 2023-12-21 12:59:55 -06:00
GPU-Windows.rst [cmake] [c++] require CMake 3.18+ (#6260) 2024-01-08 22:49:18 -06:00
Installation-Guide.rst [cmake] [c++] require CMake 3.18+ (#6260) 2024-01-08 22:49:18 -06:00
Key-Events.md [docs] updated Microsoft GitHub URL (#2152) 2019-05-08 13:51:28 +08:00
Makefile [docs] fixed building at Python 2.x (#997) 2017-10-30 11:44:08 +08:00
Parallel-Learning-Guide.rst [docs] reduce redirects in docs links (#6181) 2023-11-13 20:26:35 -06:00
Parameters-Tuning.rst [python] remove `early_stopping_rounds` argument of `train()` and `cv()` functions (#4908) 2021-12-26 17:20:49 +03:00
Parameters.rst [docs] remove links to Laurae++ site (#6193) 2023-11-30 19:07:33 -06:00
Python-API.rst [python] rename `print_evaluation()` into `log_evaluation()` (#4604) 2021-09-16 01:26:02 +03:00
Python-Intro.rst [python] remove `early_stopping_rounds` argument of `train()` and `cv()` functions (#4908) 2021-12-26 17:20:49 +03:00
Quick-Start.rst [docs] Fix small typo and grammar in docs (#6245) 2023-12-21 12:59:55 -06:00
README.rst [docs] remove unnecessary interactivity in 'docker run' instructions (#5692) 2023-01-31 13:11:07 -06:00
build-docs.sh [ci] ensure shell script exit codes are in range 0-255 (#6305) 2024-02-09 22:42:00 -06:00
conf.py [ci] enable ruff-format on some files, add pre-commit config (#6308) 2024-02-14 22:17:35 -06:00
env.yml [R-package] [ci] switch vignettes from 'rmarkdown' to 'markdown' (#6258) 2024-01-08 21:26:33 -06:00
gcc-Tips.rst [docs] fix broken links (#6161) 2023-11-06 11:59:01 -06:00
index.rst Update index.rst (#4029) 2021-03-10 09:32:46 -06:00
make.bat [ci][docs] fix broken links (#3176) 2020-06-22 11:36:15 -05:00

README.rst

Documentation
=============

Documentation for LightGBM is generated using `Sphinx <https://www.sphinx-doc.org/>`__
and `Breathe <https://breathe.readthedocs.io/>`__, which works on top of `Doxygen <https://www.doxygen.nl/index.html>`__ output.

List of parameters and their descriptions in `Parameters.rst <./Parameters.rst>`__
is generated automatically from comments in `config file <https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/config.h>`__
by `this script <https://github.com/microsoft/LightGBM/blob/master/helpers/parameter_generator.py>`__.

After each commit on ``master``, documentation is updated and published to `Read the Docs <https://lightgbm.readthedocs.io/>`__.

Build
-----

It is not necessary to re-build this documentation while modifying LightGBM's source code.
The HTML files generated using ``Sphinx`` are not checked into source control.
However, you may want to build them locally during development to test changes.

Docker
^^^^^^

The most reliable way to build the documentation locally is with Docker, using `the same images Read the Docs uses <https://hub.docker.com/r/readthedocs/build>`_.

Run the following from the root of this repository to pull the relevant image and run a container locally.

.. code:: sh

    docker run \
        --rm \
        --user=0 \
        -v $(pwd):/opt/LightGBM \
        --env C_API=true \
        --env CONDA=/opt/miniforge \
        --env READTHEDOCS=true \
        --workdir=/opt/LightGBM/docs \
        --entrypoint="" \
        readthedocs/build:ubuntu-20.04-2021.09.23 \
        /bin/bash build-docs.sh

When that code completes, open ``docs/_build/html/index.html`` in your browser.

.. note::

    The navigation in these locally-built docs does not link to the local copy of the R documentation. To view the local version of the R docs, open ``docs/_build/html/R/index.html`` in your browser.

Without Docker
^^^^^^^^^^^^^^

You can build the documentation locally without Docker. Just install Doxygen and run in ``docs`` folder

.. code:: sh

    pip install breathe sphinx 'sphinx_rtd_theme>=0.5'
    make html

Note that this will not build the R documentation.
Consider using common R utilities for documentation generation, if you need it.
Or use the Docker-based approach described above to build the R documentation locally.

Optionally, you may also install ``scikit-learn`` and get richer documentation for the classes in ``Scikit-learn API``.

If you faced any problems with Doxygen installation or you simply do not need documentation for C code, it is possible to build the documentation without it:

.. code:: sh

    pip install sphinx 'sphinx_rtd_theme>=0.5'
    export C_API=NO || set C_API=NO
    make html