From 4f5db6d08d33431761a7108e40c7691f5ecc0a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jules=20Ch=C3=A9ron?= Date: Sun, 9 Oct 2022 17:44:58 +0200 Subject: [PATCH] Add styling & fix docstrings --- docs/_static/style.css | 54 +++++++++++++++++++++++++++------ docs/getting_started.rst | 1 - docs/index.rst | 28 ++++++++++++----- pint/facets/context/registry.py | 2 +- pint/facets/system/__init__.py | 2 +- 5 files changed, 67 insertions(+), 20 deletions(-) diff --git a/docs/_static/style.css b/docs/_static/style.css index d528fd683..b2bc297d6 100644 --- a/docs/_static/style.css +++ b/docs/_static/style.css @@ -1,9 +1,45 @@ -/* Main index page overview cards */ - -.sd-card-img-top { - width: 33% !important; - display: block; - margin-left: auto; - margin-right: auto; - margin-top: 10px; - } +@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap'); + +body { + font-family: 'Open Sans', sans-serif; +} + +h1 { + font-family: "Lato", sans-serif; +} + +pre, code { + font-size: 100%; + line-height: 155%; +} + +/* Main page overview cards */ + +.sd-card { + border-radius: 0; + padding: 30px 10px 20px 10px; + margin: 10px 0px; +} + +.sd-card .sd-card-header { + text-align: center; +} + +.sd-card .sd-card-header .sd-card-text { + margin: 0px; +} + +.sd-card .sd-card-img-top { + height: 52px; + width: 52px; + margin-left: auto; + margin-right: auto; +} + +.sd-card .sd-card-header { + border: none; + color: #150458 !important; + font-size: var(--pst-font-size-h5); + font-weight: bold; + padding: 2.5rem 0rem 0.5rem 0rem; +} diff --git a/docs/getting_started.rst b/docs/getting_started.rst index aa9eb4874..cae31c686 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -46,6 +46,5 @@ That's all! You can check that Pint is correctly installed by starting up python :hidden: user/overview - .. user/getting user/tutorial user/faq diff --git a/docs/index.rst b/docs/index.rst index 5eb8d5520..9a65f433c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,39 +13,51 @@ Pint: makes units easy .. grid:: 1 1 2 2 :gutter: 2 - .. grid-item-card:: Getting started + .. grid-item-card:: :img-top: _static/index_getting_started.svg :link: getting_started :link-type: doc - New to *pint*? Check out the getting started guides. They contain an - introduction to *pint's* main concepts and links to additional tutorials. + Getting Started + ^^^^^^^^^^^^^^^ - .. grid-item-card:: User guide + New to Pint? Check out the getting started guides. They contain an + introduction to Pint's main concepts and links to additional tutorials. + + .. grid-item-card:: :img-top: _static/index_user_guide.svg :link: user/index :link-type: doc + User Guide + ^^^^^^^^^^ + The user guide provides in-depth information on the - key concepts of pint with useful background information and explanation. + key concepts of Pint with useful background information and explanation. - .. grid-item-card:: API reference + .. grid-item-card:: :img-top: _static/index_api.svg :link: api :link-type: doc + API reference + ^^^^^^^^^^^^^ + The reference guide contains a detailed description of the pint API. The reference describes how the methods work and which parameters can be used. It assumes that you have an understanding of the key concepts. - .. grid-item-card:: Developer guide + .. grid-item-card:: :img-top: _static/index_contribute.svg :link: dev/contributing :link-type: doc + Developer guide + ^^^^^^^^^^^^^^^ + Saw a typo in the documentation? Want to improve existing functionalities? The contributing guidelines will guide you through the process of improving - pint. + Pint. .. toctree:: diff --git a/pint/facets/context/registry.py b/pint/facets/context/registry.py index 95ecf1466..4290e3e0f 100644 --- a/pint/facets/context/registry.py +++ b/pint/facets/context/registry.py @@ -317,7 +317,7 @@ def with_context(self, name, **kwargs) -> Callable[[F], F]: """Decorator to wrap a function call in a Pint context. Use it to ensure that a certain context is active when - calling a function:: + calling a function. Parameters ---------- diff --git a/pint/facets/system/__init__.py b/pint/facets/system/__init__.py index 3e0450733..e95098bd9 100644 --- a/pint/facets/system/__init__.py +++ b/pint/facets/system/__init__.py @@ -14,4 +14,4 @@ from .objects import System from .registry import SystemRegistry -__all__ = [SystemDefinition, System, SystemRegistry] +__all__ = ["SystemDefinition", "System", "SystemRegistry"]