From e4984e8f33d7ba15462b1f63efdbb3d7e1bed8ad Mon Sep 17 00:00:00 2001 From: Florian Dupuy Date: Thu, 30 May 2024 17:31:59 +0200 Subject: [PATCH] Add docs folder Signed-off-by: Florian Dupuy --- docs/.readthedocs.yaml | 13 ++++ docs/Makefile | 27 +++++++ docs/README.md | 13 ++++ docs/_static/favicon.ico | Bin 0 -> 2017 bytes docs/_static/logos/logo_lfe_powsybl.svg | 76 +++++++++++++++++++ docs/conf.py | 97 ++++++++++++++++++++++++ docs/index.md | 16 ++++ docs/make.bat | 35 +++++++++ docs/requirements.txt | 4 + 9 files changed, 281 insertions(+) create mode 100644 docs/.readthedocs.yaml create mode 100644 docs/Makefile create mode 100644 docs/README.md create mode 100644 docs/_static/favicon.ico create mode 100644 docs/_static/logos/logo_lfe_powsybl.svg create mode 100644 docs/conf.py create mode 100644 docs/index.md create mode 100644 docs/make.bat create mode 100644 docs/requirements.txt diff --git a/docs/.readthedocs.yaml b/docs/.readthedocs.yaml new file mode 100644 index 0000000..934aaac --- /dev/null +++ b/docs/.readthedocs.yaml @@ -0,0 +1,13 @@ +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3.9" + +sphinx: + configuration: docs/conf.py + +python: + install: + - requirements: docs/requirements.txt \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..4d15385 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,27 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + + +clean: + @echo "Removing $(SOURCEDIR)/reference/api" + @rm -rf "$(SOURCEDIR)/reference/api" + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..c1dc08c --- /dev/null +++ b/docs/README.md @@ -0,0 +1,13 @@ +# README + +These are the documentation sources for //TODOaddRepositoryName features. + +Please keep them up to date with your developments. +They are published on powsybl.readthedocs.io/ and pull requests are built and previewed automatically. + +To build the docs locally, run the following commands: +~~~bash +pip install -r docs/requirements.txt +sphinx-build -a docs ./build-docs +~~~ +Then open `build-docs/index.html` in your browser. diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2ea6b5c3fedc3d8a94789d101b6385e240bfe681 GIT binary patch literal 2017 zcmV<72Oju|P)EX>4Tx04R}tkvmAkKpe)uKBOWQK|6>#WT;LS#21cQg(6f4wL+^7CYQdTNkfw2 z;wZQl9DFQR9bBAsb#N5~!3T(wqm!bGl=#1-&?3fz<9>X1-^bl|fWKa5su>&uRLwF{ ziMWu-t_q=71Tly(dNCz2Q=b#XBs|C0J$!tC`-NgjguFvE0V2XsE=K#8E}nDBquP zS>e3JSuIyt^Pc>L;heUz%ypVWNMI355FtQD6(y8mAx5i4iis5M$36T5j$b5~Os*0b zITlcX3d!+<|H1EW&HTi;n-q=%9WS>1F${!ufkw@?zmILZaRLOMfh(=$uhfB=Ptt2G zEqVm>Yy%h9Elu77E_Z0RY(00006VoOIv0RI600RN!9r;`8x010qNS#tmY z4c7nw4c7reD4Tcy000McNlirueSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00p^8L_t(o!?jmyP*i0Ye!g?gp0mqdKwuXz5OgCH5y;UL zl^hBa3V&GBOjc9IlsRQTtI2-Ul;%%=bQ#AGr^^s%Iu?$DgQJotcu5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ha?6r5_j3tBua8gzRChZ?7q_}tj<&qnD;!I+dAp01G z3ez{RLE_S*buY!-lm>+qxqTVNWS?&=4SVk*$q>0IjjX6GSwxw5!DLAjb`B162a^Wr zvI>JUia6o9;6iO}NqK$!O#oeO!diKMuD+d`OKVi3XQL_~p#laq%wfxc2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..3242bd2 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,97 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys + +# Path to python sources, for doc generation on readthedocs +source_path = os.path.abspath('..') +sys.path.insert(0, source_path) +print(f'appended {source_path}') + + +# -- Project information ----------------------------------------------------- + +project = 'TODO add project name' +copyright = '2024, RTE (http://www.rte-france.com)' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.viewcode', + 'sphinx.ext.doctest', + 'sphinx.ext.napoleon', + 'sphinx.ext.todo', + 'sphinx.ext.intersphinx', + 'sphinx_tabs.tabs', + 'myst_parser'] +myst_enable_extensions = [ + "amsmath", + "colon_fence", + "dollarmath", + "attrs_inline" +] +myst_heading_anchors = 6 + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "furo" + +html_title = 'TODO add project name' +html_short_title = 'TODO add project name' + +html_logo = '_static/logos/logo_lfe_powsybl.svg' +html_favicon = "_static/favicon.ico" + +html_context = { + "sidebar_logo_href": "https://powsybl.readthedocs.org" +} + +html_theme_options = { + # the following 3 lines enable edit button + "source_repository": "https://github.com/powsybl/TODO-addrepositoryname/", + "source_branch": "main", + "source_directory": "docs/", +} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] +html_css_files = ['styles/styles.css'] + +todo_include_todos = True + +# Links to external documentations : python 3 and pandas +intersphinx_mapping = { +} +intersphinx_disabled_reftypes = ["*"] + +# Generate one file per method +autosummary_generate = True diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..2b9454c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,16 @@ +```{toctree} +--- +caption: Contents of this website +maxdepth: 2 +hidden: true +--- + +``` + +# pypowsybl-jupyter +Widgets for [pypowsybl](https://github.com/powsybl/pypowsybl) in the Jupyter notebook. + +## Getting started + +## User guide + diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..96ed709 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..bbadfbf --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +sphinx==7.1.2 +sphinx-tabs +furo==2024.1.29 +myst-parser \ No newline at end of file