LightGBM/docs
Nikita Titov 4cbff0c8d9
[docs] fix link to multiple OpenMP issue description (#6562)
2024-07-20 11:47:09 -05:00
..
_static [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -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 [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -05: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 [docs] fix link to multiple OpenMP issue description (#6562) 2024-07-20 11:47:09 -05:00
Features.rst [ci] prevent trailing whitespace, ensure files end with newline (#6373) 2024-03-18 23:24:14 -05:00
GPU-Performance.rst [docs] reduce redirects in docs links (#6181) 2023-11-13 20:26:35 -06:00
GPU-Targets.rst [ci] prevent trailing whitespace, ensure files end with newline (#6373) 2024-03-18 23:24:14 -05:00
GPU-Tutorial.rst [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -05:00
GPU-Windows.rst [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -05:00
Installation-Guide.rst [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -05:00
Key-Events.md [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -05:00
Makefile [ci] prevent trailing whitespace, ensure files end with newline (#6373) 2024-03-18 23:24:14 -05:00
Parallel-Learning-Guide.rst [docs] reduce redirects in docs links (#6181) 2023-11-13 20:26:35 -06:00
Parameters-Tuning.rst [python-package] clarify max_depth warning and limit when it is emitted (#6402) 2024-06-04 19:46:07 -05:00
Parameters.rst [doc] fix documentation for quantized training (#6528) 2024-07-08 21:24:54 -05:00
Python-API.rst [python] rename `print_evaluation()` into `log_evaluation()` (#4604) 2021-09-16 01:26:02 +03:00
Python-Intro.rst [python-package] remove uses of deprecated NumPy random number generation APIs, require 'numpy>=1.17.0' (#6468) 2024-06-03 20:17:40 -05: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] make shell scripts stricter (#6266) 2024-04-22 19:28:51 -05:00
conf.py [ci] upgrade linters to latest version (#6472) 2024-06-02 22:33:53 -05:00
env.yml [ci] [docs] update some docs and CI dependencies (#6346) 2024-03-18 21:17:48 -05:00
gcc-Tips.rst [docs] remove outdated docs from the repo (#6552) 2024-07-18 21:12:39 -05: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