diff --git a/environment.yml b/environment.yml index dcc7aa5280b2c..0beb16ec0f1c8 100644 --- a/environment.yml +++ b/environment.yml @@ -114,6 +114,7 @@ dependencies: - pyyaml - requests - pygments # Code highlighting + - myst-parser - pip: - adbc-driver-postgresql>=0.10.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index f5da7f70ccdba..22d936e221df8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -84,6 +84,7 @@ feedparser pyyaml requests pygments +myst-parser adbc-driver-postgresql>=0.10.0 adbc-driver-sqlite>=0.8.0 typing_extensions; python_version<"3.11" diff --git a/web/pandas/pdeps/Makefile b/web/pandas/pdeps/Makefile new file mode 100644 index 0000000000000..d4bb2cbb9eddb --- /dev/null +++ b/web/pandas/pdeps/Makefile @@ -0,0 +1,20 @@ +# 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 + +# 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) diff --git a/web/pandas/pdeps/_static/.gitignore b/web/pandas/pdeps/_static/.gitignore new file mode 100644 index 0000000000000..5e7d2734cfc60 --- /dev/null +++ b/web/pandas/pdeps/_static/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/web/pandas/pdeps/_templates/layout.html b/web/pandas/pdeps/_templates/layout.html new file mode 100644 index 0000000000000..88ca346d06477 --- /dev/null +++ b/web/pandas/pdeps/_templates/layout.html @@ -0,0 +1,17 @@ +{% extends "pydata_sphinx_theme/layout.html" %} +{% block docs_navbar %} +
+ +
+{% endblock %} diff --git a/web/pandas/pdeps/conf.py b/web/pandas/pdeps/conf.py new file mode 100644 index 0000000000000..09ee61a252b0e --- /dev/null +++ b/web/pandas/pdeps/conf.py @@ -0,0 +1,65 @@ +# 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 +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = "Pandas Enhancement Proposals" +copyright = "2023, Pandas" +author = "Pandas" + + +# -- 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 = ["myst_parser"] + +# 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 = "pydata_sphinx_theme" + +html_context = { + # always force light theme + "default_mode": "light" +} + +html_theme_options = { + # remove the breadcrumbs + "article_header_start": [], +} + +# 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 = [ + "pandas.css", +] diff --git a/web/pandas/pdeps/index.rst b/web/pandas/pdeps/index.rst new file mode 100644 index 0000000000000..0760b156494e8 --- /dev/null +++ b/web/pandas/pdeps/index.rst @@ -0,0 +1,7 @@ +Index of Pandas Enhancement Proposals +===================================== + +.. toctree:: + + 0001-purpose-and-guidelines.md + 0004-consistent-to-datetime-parsing.md diff --git a/web/pandas/pdeps/make.bat b/web/pandas/pdeps/make.bat new file mode 100644 index 0000000000000..954237b9b9f2b --- /dev/null +++ b/web/pandas/pdeps/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 + +%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.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/web/pandas/static/css/pandas.css b/web/pandas/static/css/pandas.css index ec9a4bd502dd1..7430dfefd1226 100644 --- a/web/pandas/static/css/pandas.css +++ b/web/pandas/static/css/pandas.css @@ -1,3 +1,7 @@ +html { + --pst-color-primary: #130654 !important; +} + body { padding-top: 5em; color: #444; diff --git a/web/pandas_web.py b/web/pandas_web.py index aac07433f2712..d9a6f1ca71717 100755 --- a/web/pandas_web.py +++ b/web/pandas_web.py @@ -414,6 +414,8 @@ def get_source_files(source_path: str) -> typing.Generator[str, None, None]: """ for root, dirs, fnames in os.walk(source_path): root_rel_path = os.path.relpath(root, source_path) + if root_rel_path.startswith("pdeps"): + continue for fname in fnames: yield os.path.join(root_rel_path, fname) @@ -484,6 +486,18 @@ def main( os.path.join(source_path, fname), os.path.join(target_path, dirname) ) + # build the PDEPs and copy them to the correct location + pdep_source = os.path.join(source_path, "pdeps") + pdep_build = os.path.join(source_path, "pdeps", "_build") + shutil.copy( + os.path.join(source_path, "static", "css", "pandas.css"), + os.path.join(pdep_source, "_static", "pandas.css"), + ) + os.system(f"sphinx-build -M html {pdep_source} {pdep_build}") + shutil.copytree( + os.path.join(pdep_build, "html"), os.path.join(target_path, "pdeps") + ) + if __name__ == "__main__": parser = argparse.ArgumentParser(description="Documentation builder.")