Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
run: pip install -r docs/requirements.txt
- name: Check formatting
run: make -C docs check-formatting
- name: Build
run: make -C docs html
- name: Publish
if: github.event_name == 'push'
uses: sphinx-notes/pages@v3
Expand Down
136 changes: 0 additions & 136 deletions docs-old/output-api.md

This file was deleted.

22 changes: 9 additions & 13 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,29 @@
# If people set these on the make command line, use 'em

SPHINXBUILD ?= sphinx-build
MDFORMAT ?= mdformat

SOURCEDIR = source
BUILDDIR = build
RSTFMT = rstfmt
RSTFMTFLAGS = -w 100

rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
FILES = $(call rwildcard,$(SOURCEDIR),*.rst)
MARKDOWN_FILES = $(call rwildcard,$(SOURCEDIR),*.md) $(call rwildcard,$(SOURCEDIR),*.rst)

all : html

.PHONY : check-formatting clean html preflight
.PHONY : check-formatting clean format html
.SUFFIXES : # Disable legacy behavior

check-formatting :
$(RSTFMT) $(RSTFMTFLAGS) --check $(SOURCEDIR)
$(MDFORMAT) --check $(MARKDOWN_FILES)

clean :
rm -rf -- $(wildcard $(SOURCEDIR)/.~ $(BUILDDIR))
rm -rf -- $(BUILDDIR)

html : preflight
format :
$(MDFORMAT) $(MARKDOWN_FILES)

html :
$(SPHINXBUILD) -M $@ $(SOURCEDIR) $(BUILDDIR)
@printf 'Browse the \e]8;;%s\e\\%s\e]8;;\e\\.\n' \
"file://$(abspath $(BUILDDIR))/$@/index.$@" "php-src html docs locally"

preflight : $(SOURCEDIR)/.~

$(SOURCEDIR)/.~ : $(FILES)
$(RSTFMT) $(RSTFMTFLAGS) $?
touch $@
11 changes: 5 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ your browser.

## Formatting

The files in this documentation are formatted using the
[``rstfmt``](https://github.com/dzhu/rstfmt) tool.
The files in this documentation are formatted using
[mdformat](https://mdformat.readthedocs.io/) with its
[MyST plugin](https://github.com/executablebooks/mdformat-myst).

```bash
rstfmt -w 100 source
make format
make check-formatting
```

This tool is not perfect. It breaks on custom directives, so we might switch to
either a fork or something else in the future.
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Sphinx
mdformat==1.0.0
mdformat-myst==0.3.0
myst-parser>=5.1
sphinx-design
sphinxawesome-theme
rstfmt
15 changes: 15 additions & 0 deletions docs/source/_templates/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url={{ redirect_url }}">
<link rel="canonical" href="{{ redirect_url }}">
<title>Redirecting&hellip;</title>
<script>
window.location.replace({{ redirect_url | tojson }} + window.location.hash);
</script>
</head>
<body>
<p>This page has moved to <a href="{{ redirect_url }}">its new location</a>.</p>
</body>
</html>
23 changes: 23 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@
project = 'php-src docs'
author = 'The PHP Group'
extensions = [
'myst_parser',
'sphinx_design',
'sphinx.ext.autosectionlabel',
]
exclude_patterns = ['**/*TODO.md']
myst_enable_extensions = [
'alert',
'gfm_autolink',
'strikethrough',
'tasklist',
]
myst_heading_anchors = 6
templates_path = ['_templates']
html_theme = 'sphinxawesome_theme'
html_static_path = ['_static']
Expand Down Expand Up @@ -58,3 +67,17 @@
)
html_theme_options = asdict(theme_options)
pygments_style = 'sphinx'


redirects = {
'core/data-structures/reference-counting': '../memory-management/reference-counting.html',
}


def generate_redirects(_app):
for source, target in redirects.items():
yield source, {'redirect_url': target}, 'redirect.html'


def setup(app):
app.connect('html-collect-pages', generate_redirects)
8 changes: 8 additions & 0 deletions docs/source/core/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Core TODO

Pages to add:

- Parser and AST: grammar generation, AST representation, compilation boundaries,
and important extension points.
- Virtual Machine: opcode execution, operands, call frames, and VM variants.
- Object Handlers: handler contracts, object storage, and common ownership traps.
4 changes: 4 additions & 0 deletions docs/source/core/data-structures/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Data Structures TODO

- Add a HashTable page covering ownership, iteration, mutation, and common APIs.
- Expand the zval macro table and document the remaining internal zval types.
12 changes: 12 additions & 0 deletions docs/source/core/data-structures/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Data Structures

```{toctree}
---
hidden: true
---
zval
zend_string
zend_constant
```

This section provides an overview of the core data structures used in php-src.
13 changes: 0 additions & 13 deletions docs/source/core/data-structures/index.rst

This file was deleted.

Loading
Loading