Skip to content

Commit

Permalink
[Documentation] Replace recommonmark by myst-parser (#65664)
Browse files Browse the repository at this point in the history
Recommonmark has been deprecated, then archived last year. This was
tracked by: llvm/llvm-iwg#30

See https://github.com/readthedocs/recommonmark

This patch migrates all our doc to use myst

Additional details for bot maintainers: https://discourse.llvm.org/t/maintenance-required-on-sphinx-build-bots/73612
  • Loading branch information
cor3ntin committed Sep 25, 2023
1 parent 92a394e commit b7ff032
Show file tree
Hide file tree
Showing 44 changed files with 173 additions and 225 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/release-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@ jobs:
release_version=$(echo "${{ github.ref_name }}" | sed 's/llvmorg-//g')
echo "release-version=$release_version" >> "$GITHUB_OUTPUT"
- name: Checkout LLVM
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
doxygen \
graphviz \
python3-github \
python3-recommonmark \
python3-sphinx \
ninja-build \
texlive-font-utils
pip3 install --user sphinx-markdown-tables
- name: Checkout LLVM
uses: actions/checkout@v4
pip3 install --user -r ./llvm/docs/requirements.txt
- name: Create Release
run: |
Expand Down
23 changes: 4 additions & 19 deletions clang/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,11 @@
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = {
".rst": "restructuredtext",
}

try:
import recommonmark
except ImportError:
# manpages do not use any .md sources
if not tags.has("builder-man"):
raise
else:
import sphinx

if sphinx.version_info >= (3, 0):
# This requires 0.5 or later.
extensions.append("recommonmark")
else:
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
source_suffix[".md"] = "markdown"
import sphinx

if sphinx.version_info >= (3, 0):
extensions.append("myst_parser")

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/Aliasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Aliasing in Fortran

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Introduction
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/ArrayComposition.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Array Composition

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

This note attempts to describe the motivation for and design of an
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/BijectiveInternalNameUniquing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Bijective Internal Name Uniquing

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

FIR has a flat namespace. No two objects may have the same name at the module
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/C++17.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# C++14/17 features used in f18

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

The C++ dialect used in this project constitutes a subset of the
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/C++style.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Flang C++ Style Guide

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

This document captures the style guide rules that are followed in the Flang codebase.
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/Calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Representation of Fortran function calls

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Procedure reference implementation protocol
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/Character.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Implementation of `CHARACTER` types in f18

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Kinds and Character Sets
Expand Down
4 changes: 2 additions & 2 deletions flang/docs/ComplexOperations.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Complex Operations

```eval_rst
.. contents::
```{eval-rst}
.. toctree::
:local:
```

Expand Down
7 changes: 4 additions & 3 deletions flang/docs/ControlFlowGraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Control Flow Graph

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Concept
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/DesignGuideline.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
-->
# Design Guideline

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```
## Documenting the design

Expand Down
7 changes: 4 additions & 3 deletions flang/docs/DoConcurrent.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# `DO CONCURRENT` isn't necessarily concurrent

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

A variant form of Fortran's primary looping construct was
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/Extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Fortran Extensions supported by Flang

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

As a general principle, this compiler will accept by default and
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/FIRArrayOperations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Design: FIR Array operations

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## General
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/FlangDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Flang drivers

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

There are two main drivers in Flang:
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/FortranFeatureHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# A Fortran feature history cheat sheet

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Original IBM 704 FORTRAN
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/FortranForCProgrammers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Fortran For C Programmers

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

This note is limited to essential information about Fortran so that
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/FortranIR.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Design: Fortran IR

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Introduction
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/FortranLLVMTestSuite.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Fortran Tests in the LLVM Test Suite

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

The [LLVM Test Suite](https://github.com/llvm/llvm-test-suite) is a
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/GettingInvolved.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
-->
# Getting Involved

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

The Flang Project welcomes contributions of all kinds.
Expand Down
10 changes: 6 additions & 4 deletions flang/docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Getting Started

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

## Building flang
Expand Down Expand Up @@ -443,7 +444,8 @@ system to create HTML pages which would be hosted on the webpage of flang and
updated periodically.
If you would like to generate and view the HTML locally:
- Install [Sphinx](http://sphinx-doc.org/), including the [sphinx-markdown-tables](https://pypi.org/project/sphinx-markdown-tables/) extension.
- Install [Sphinx](http://sphinx-doc.org/), and the required extensions
using `pip install --user -r ~/llvm-projects/docs/requirements.txt`
- Pass `-DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF` to the cmake command.
```bash
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/IORuntimeInternals.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Fortran I/O Runtime Library Internal Design

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

This note is meant to be an overview of the design of the *implementation*
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/ImplementingASemanticCheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
-->
# How to implement a Sematic Check in Flang

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

I recently added a semantic check to the Flang compiler front end. This document
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/IntrinsicTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Implementation of `Intrinsic` types in f18

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

Intrinsic types are integer, real, complex, character, and logical.
Expand Down
7 changes: 4 additions & 3 deletions flang/docs/Intrinsics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# A categorization of standard (2018) and extended Fortran intrinsic procedures

```eval_rst
.. contents::
:local:
```{contents}
---
local:
---
```

This note attempts to group the intrinsic procedures of Fortran into categories
Expand Down

0 comments on commit b7ff032

Please sign in to comment.