Skip to content

Commit b7ff032

Browse files
authored
[Documentation] Replace recommonmark by myst-parser (#65664)
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
1 parent 92a394e commit b7ff032

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+173
-225
lines changed

.github/workflows/release-tasks.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@ jobs:
2424
release_version=$(echo "${{ github.ref_name }}" | sed 's/llvmorg-//g')
2525
echo "release-version=$release_version" >> "$GITHUB_OUTPUT"
2626
27+
- name: Checkout LLVM
28+
uses: actions/checkout@v4
29+
2730
- name: Install Dependencies
2831
run: |
2932
sudo apt-get update
3033
sudo apt-get install -y \
3134
doxygen \
3235
graphviz \
3336
python3-github \
34-
python3-recommonmark \
35-
python3-sphinx \
3637
ninja-build \
3738
texlive-font-utils
38-
pip3 install --user sphinx-markdown-tables
39-
40-
- name: Checkout LLVM
41-
uses: actions/checkout@v4
39+
pip3 install --user -r ./llvm/docs/requirements.txt
4240
4341
- name: Create Release
4442
run: |

clang/docs/conf.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,11 @@
3232
# Add any paths that contain templates here, relative to this directory.
3333
templates_path = ["_templates"]
3434

35-
# The suffix of source filenames.
36-
source_suffix = {
37-
".rst": "restructuredtext",
38-
}
3935

40-
try:
41-
import recommonmark
42-
except ImportError:
43-
# manpages do not use any .md sources
44-
if not tags.has("builder-man"):
45-
raise
46-
else:
47-
import sphinx
48-
49-
if sphinx.version_info >= (3, 0):
50-
# This requires 0.5 or later.
51-
extensions.append("recommonmark")
52-
else:
53-
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
54-
source_suffix[".md"] = "markdown"
36+
import sphinx
37+
38+
if sphinx.version_info >= (3, 0):
39+
extensions.append("myst_parser")
5540

5641
# The encoding of source files.
5742
# source_encoding = 'utf-8-sig'

flang/docs/Aliasing.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Aliasing in Fortran
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Introduction

flang/docs/ArrayComposition.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Array Composition
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
This note attempts to describe the motivation for and design of an

flang/docs/BijectiveInternalNameUniquing.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Bijective Internal Name Uniquing
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
FIR has a flat namespace. No two objects may have the same name at the module

flang/docs/C++17.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# C++14/17 features used in f18
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
The C++ dialect used in this project constitutes a subset of the

flang/docs/C++style.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Flang C++ Style Guide
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
This document captures the style guide rules that are followed in the Flang codebase.

flang/docs/Calls.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Representation of Fortran function calls
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Procedure reference implementation protocol

flang/docs/Character.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Implementation of `CHARACTER` types in f18
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Kinds and Character Sets

flang/docs/ComplexOperations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Complex Operations
22

3-
```eval_rst
4-
.. contents::
3+
```{eval-rst}
4+
.. toctree::
55
:local:
66
```
77

flang/docs/ControlFlowGraph.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Control Flow Graph
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Concept

flang/docs/DesignGuideline.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
-->
88
# Design Guideline
99

10-
```eval_rst
11-
.. contents::
12-
:local:
10+
```{contents}
11+
---
12+
local:
13+
---
1314
```
1415
## Documenting the design
1516

flang/docs/DoConcurrent.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# `DO CONCURRENT` isn't necessarily concurrent
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
A variant form of Fortran's primary looping construct was

flang/docs/Extensions.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Fortran Extensions supported by Flang
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
As a general principle, this compiler will accept by default and

flang/docs/FIRArrayOperations.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Design: FIR Array operations
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## General

flang/docs/FlangDriver.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Flang drivers
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
There are two main drivers in Flang:

flang/docs/FortranFeatureHistory.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# A Fortran feature history cheat sheet
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Original IBM 704 FORTRAN

flang/docs/FortranForCProgrammers.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Fortran For C Programmers
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
This note is limited to essential information about Fortran so that

flang/docs/FortranIR.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Design: Fortran IR
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Introduction

flang/docs/FortranLLVMTestSuite.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Fortran Tests in the LLVM Test Suite
22

3-
```eval_rst
4-
.. contents::
5-
:local:
3+
```{contents}
4+
---
5+
local:
6+
---
67
```
78

89
The [LLVM Test Suite](https://github.com/llvm/llvm-test-suite) is a

flang/docs/GettingInvolved.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
-->
88
# Getting Involved
99

10-
```eval_rst
11-
.. contents::
12-
:local:
10+
```{contents}
11+
---
12+
local:
13+
---
1314
```
1415

1516
The Flang Project welcomes contributions of all kinds.

flang/docs/GettingStarted.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Getting Started
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
## Building flang
@@ -443,7 +444,8 @@ system to create HTML pages which would be hosted on the webpage of flang and
443444
updated periodically.
444445
445446
If you would like to generate and view the HTML locally:
446-
- Install [Sphinx](http://sphinx-doc.org/), including the [sphinx-markdown-tables](https://pypi.org/project/sphinx-markdown-tables/) extension.
447+
- Install [Sphinx](http://sphinx-doc.org/), and the required extensions
448+
using `pip install --user -r ~/llvm-projects/docs/requirements.txt`
447449
- Pass `-DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF` to the cmake command.
448450
449451
```bash

flang/docs/IORuntimeInternals.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Fortran I/O Runtime Library Internal Design
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
This note is meant to be an overview of the design of the *implementation*

flang/docs/ImplementingASemanticCheck.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
-->
88
# How to implement a Sematic Check in Flang
99

10-
```eval_rst
11-
.. contents::
12-
:local:
10+
```{contents}
11+
---
12+
local:
13+
---
1314
```
1415

1516
I recently added a semantic check to the Flang compiler front end. This document

flang/docs/IntrinsicTypes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
# Implementation of `Intrinsic` types in f18
1010

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

1617
Intrinsic types are integer, real, complex, character, and logical.

flang/docs/Intrinsics.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

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

11-
```eval_rst
12-
.. contents::
13-
:local:
11+
```{contents}
12+
---
13+
local:
14+
---
1415
```
1516

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

0 commit comments

Comments
 (0)