Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx documentation for stdlib specs #859

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -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)
33 changes: 33 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

with open('../VERSION') as version_file:
version = version_file.read().strip()

project = 'stdlib'
copyright = '2024, stdlib contributors'
author = 'stdlib contributors'
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'myst_parser', # enable markdown files for sphinx
]

templates_path = ['_templates']
exclude_patterns = []



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
11 changes: 0 additions & 11 deletions doc/index.md

This file was deleted.

23 changes: 23 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. stdlib documentation master file, created by
sphinx-quickstart on Sat May 11 17:18:44 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.


.. include:: ../README.md
:parser: myst_parser.sphinx_

.. toctree::
:maxdepth: 2
:caption: Contents:

../README
specs/index


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=%~dp0
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
3 changes: 3 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
myst_parser
pydata_sphinx_theme
44 changes: 0 additions & 44 deletions doc/specs/index.md

This file was deleted.

42 changes: 42 additions & 0 deletions doc/specs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Fortran stdlib Specifications (specs)
=====================================

This is an index/directory of the specifications (specs) for each new module/feature as described in the
[workflow document](../Workflow.html).

Experimental Features & Modules
===============================

.. toctree::
:maxdepth: 1
:caption: Contents:

stdlib_ansi
stdlib_array
stdlib_ascii
stdlib_bitsets
stdlib_constants
stdlib_error
stdlib_hash_prcedures
stdlib_hashmaps
stdlib_io
stdlib_kinds
stdlib_linalg
stdlib_linalg_state_type
stdlib_logger
stdlib_math
stdlib_optval
stdlib_quadrature
stdlib_random
stdlib_selection
stdlib_sorting
stdlib_specialfunctions_gamma
stdlib_specialfunctions
stdlib_stats_distribution_exponential
stdlib_stats_distribution_uniform
stdlib_stats
stdlib_str2num
stdlib_string_type
stdlib_stringlist_type
stdlib_strings
stdlib_version
11 changes: 2 additions & 9 deletions doc/specs/stdlib_ansi.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
---
title: terminal colors
...


# The `stdlib_ansi` module

[TOC]

# `stdlib_ansi`

## Introduction

Support terminal escape sequences to produce styled and colored terminal output.
Expand Down
20 changes: 7 additions & 13 deletions doc/specs/stdlib_array.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
---
title: array
---

# The `stdlib_array` module

[TOC]

# `stdlib_array`

## Introduction

Module for index manipulation and array handling tasks.
Expand Down Expand Up @@ -45,8 +39,8 @@ Returns an array of default integer size, with a maximum length of `size(array)`

#### Examples

```fortran
{!example/array/example_trueloc.f90!}
```{literalinclude} ../../example/array/example_trueloc.f90
:language: Fortran
```


Expand Down Expand Up @@ -82,6 +76,6 @@ Returns an array of default integer size, with a maximum length of `size(array)`

#### Examples

```fortran
{!example/array/example_falseloc.f90!}
```
```{literalinclude} ../../example/array/example_falseloc.f90
:language: Fortran
```
34 changes: 14 additions & 20 deletions doc/specs/stdlib_ascii.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
---
title: ascii
---

# The `stdlib_ascii` module

[TOC]

# `stdlib_ascii`

## Introduction

The `stdlib_ascii` module provides procedures for handling and manipulating
Expand Down Expand Up @@ -50,9 +44,9 @@ The result is an intrinsic character type of the same length as `string`.

#### Example

```fortran
{!example/ascii/example_ascii_to_lower.f90!}
```
```{literalinclude} ../../example/ascii/example_ascii_to_lower.f90
:language: Fortran
```

### `to_upper`

Expand Down Expand Up @@ -82,8 +76,8 @@ The result is an intrinsic character type of the same length as `string`.

#### Example

```fortran
{!example/ascii/example_ascii_to_upper.f90!}
```{literalinclude} ../../example/ascii/example_ascii_to_upper.f90
:language: Fortran
```

### `to_title`
Expand Down Expand Up @@ -119,8 +113,8 @@ The result is an intrinsic character type of the same length as `string`.

#### Example

```fortran
{!example/ascii/example_ascii_to_title.f90!}
```{literalinclude} ../../example/ascii/example_ascii_to_title.f90
:language: Fortran
```

### `to_sentence`
Expand Down Expand Up @@ -154,8 +148,8 @@ The result is an intrinsic character type of the same length as `string`.

#### Example

```fortran
{!example/ascii/example_ascii_to_sentence.f90!}
```{literalinclude} ../../example/ascii/example_ascii_to_sentence.f90
:language: Fortran
```

### `reverse`
Expand Down Expand Up @@ -186,6 +180,6 @@ The result is an intrinsic character type of the same length as `string`.

#### Example

```fortran
{!example/ascii/example_ascii_reverse.f90!}
```
```{literalinclude} ../../example/ascii/example_ascii_reverse.f90
:language: Fortran
```
Loading
Loading