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

Consolidate documentation about documentation into docs directory #159

Merged
merged 36 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
251e906
Remove obsolete file
jimwins Oct 3, 2024
740dab2
Put various bits of documentation into one place
jimwins Oct 3, 2024
42f4bba
Remove obsolete files, move skeleton files into top-level dir
jimwins Oct 3, 2024
b1c75f2
This todo is very old, nuke it
jimwins Oct 3, 2024
d84787d
Skeletons moved
jimwins Oct 3, 2024
ac7a233
Split README.md into other files/places
jimwins Oct 3, 2024
d228116
Remove reference to defunct edit.php.net
jimwins Oct 3, 2024
2b0fbe7
Clean up build instructions, add Docker method
jimwins Oct 3, 2024
2031088
Use .md extension on local links so they work on GitHub
jimwins Oct 4, 2024
e7b109f
Rename intro.md to README.md
jimwins Oct 4, 2024
e9e45c8
Fix a bunch of relative links
jimwins Oct 4, 2024
72698ca
Point to gen_stub as the new preferred way to generate new docs
jimwins Oct 5, 2024
2af6884
Strip down documentation on how manual is built for website
jimwins Oct 5, 2024
c698783
Remove obsolete question
jimwins Oct 5, 2024
9c6398f
Remove another obsolete question
jimwins Oct 5, 2024
731d1cf
Modernize examples, add macOS
jimwins Oct 5, 2024
4934c96
Incorporate improvements from @Girgias
jimwins Oct 5, 2024
1f126de
Remove outdated FAQ
jimwins Oct 5, 2024
63e4f67
Link to docs/README.md
jimwins Oct 7, 2024
ba863b2
Add link to editing.md
jimwins Oct 7, 2024
aa05ff9
Remove 'next chapter' links
jimwins Oct 7, 2024
09e7c8a
Make it clear joining is not necessary for contribution
jimwins Oct 7, 2024
019869e
Add information for building translations
jimwins Oct 7, 2024
e38ccbc
Remove whitespace.md, redundant with info in style.md
jimwins Oct 7, 2024
3c77c8a
Clean up the style of the style guide, add some additional points
jimwins Oct 7, 2024
8917e61
Be consistent with `EN-Revision`
jimwins Oct 7, 2024
18c8d2f
Explain why only translated files should be committed
jimwins Oct 7, 2024
fa4a303
Add table of contents for sidebar
jimwins Oct 12, 2024
8f0a7a0
Needs a rewrite, but at least convert to Markdown for now
jimwins Oct 12, 2024
b06e537
More cleanups and organization
jimwins Oct 13, 2024
fd822fc
Fix links to docs.php.net/guide
jimwins Oct 13, 2024
7913ca0
Incorporate feedback
jimwins Oct 14, 2024
164fcfa
Link to Semantic Line Breaks info
jimwins Oct 14, 2024
2f4333f
Fix markup
jimwins Oct 14, 2024
0f6ce84
Include extension so browsing on GitHub works
jimwins Oct 14, 2024
4d45290
Favor , over . in arguments to echo
jimwins Oct 16, 2024
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
217 changes: 0 additions & 217 deletions CONTRIBUTING_DOCS.md

This file was deleted.

157 changes: 5 additions & 152 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,156 +1,9 @@
This repository contains the base source files and tools for converting
PHP's documentation, written in DocBook XML, into various presentation
formats like HTML and RTF.

# Read this first
Documentation for this system can be found in the `docs` directory.
jimwins marked this conversation as resolved.
Show resolved Hide resolved

This directory contains source files and a setup for converting
PHP's XML documentation into presentation formats like HTML and
RTF. You should not have to bother with this unless you are
writing documentation yourself, or if you simply are curious
about how the XML stuff works.

If you just want to read the documentation, look at:
If you just want to read the documentation for PHP, look at:
https://www.php.net/docs.php

# How to write phpdoc files

If you are interested in information about how to
set up the tools needed, how to work with Git and
DocBook on Linux or Windows, or what conventions you
should follow when writing phpdoc files, please refer
to the PHP Documentation HOWTO.

The PHP Documentation uses the [DocBook 5.2](https://tdg.docbook.org/tdg/5.2/) XML schema. \
However, there is one small change between the official Docbook 5.2 schema and the schema used by the PHP documentation:
the `<classsynopsis>` tag allows "One or more Oriented Object Programming inlines",
like the [DocBook 5.1](https://tdg.docbook.org/tdg/5.1/classsynopsis) schema does,
instead of "One Oriented Object Programming inlines".

You can read the HOWTO online at: http://doc.php.net/tutorial/

If you are already working with the phpdoc module,
then you can find its XML source in the howto directory
of the module, and build it yourself with:

```bash
phd -d .manual.xml
```

However, PhD is a separate project which can be read about here:
https://wiki.php.net/doc/phd

## Quick reference

### Source checkout

For a more general git-workflow see [the Wiki](https://wiki.php.net/vcs/gitworkflow#reviewing_and_closing_pull_requests).
Make sure to upload your SSH public key to your account at main.php.net

Check out the sources:

```bash
mkdir phpdoc
cd phpdoc
git clone git@github.com:php/doc-en.git en
git clone git@github.com:php/doc-your-language-of-choice.git your-language-of-choice
git clone git@github.com:php/doc-base.git
```

Change `your-language-of-choice` if you would like to check out a different language.

The `en` folder contains the English DocBook source files, and `doc-base` contains tools
and resources used in all languages.

### Edits

* Make the change. Use spaces not tabs. Be sure to carefully watch your whitespace!
* cd into the desired clone directory, e.g.
```bash
cd en
```
* Look at your unified diff, make sure it looks right and that whitespace changes aren't mixed in:
```bash
git diff path/to/file.xml
```
* Make sure no errors are present, so at the command line in your phpdoc source directory run:
```bash
php ../doc-base/configure.php
```
* If you are translating, remember to add the full Git commit hash of the English file that you are translating
from, to the file's `EN-Revision` comment.
* Commit your changes
```bash
git commit path/to/file.xml
```

Read the HOWTO for more information. After reading the HOWTO,
email the phpdoc mailing list (phpdoc@lists.php.net) with questions
and concerns.

### New functions

* Copy an existing XML file or use a skeleton from the HOWTO.
Rename and place it into the appropriate directory.
* Edit. Be sure no leftover text exists. No tabs either.
* If you are translating, remember to add the full Git commit hash of the English
file that you are translating from, to the file's `EN-Revision` comment.
* cd into the desired clone directory, e.g.
```bash
cd en
```
* Now test locally before commit by first running
```bash
php ../doc-base/configure.php
```
* Add the file to your staging area
```bash
git add path/to/yourfile.xml
```
* Commit the file and push it to the git-server
```bash
git commit path/to/yourfile.xml
git push remote your-branch
```
* Open a pull request to the main repository via GitHub

### Some popular tags and entities

<filename> filenames
<constant> constants
<varname> variables
<parameter> a function's parameter/argument
<function> functions, this links to function pages or bolds if
already on the function's page. it also adds ().

<literal> teletype/mono-space font <tt>
<emphasis> italics
<example> see HOWTO, includes many other tags.
<link> internal manual links
<link linkend="language.variables">variables</link>

<link> external links via global.ent
<link xlink:href="&spec.cookies;">mmm cookies</link>

<type> types, this links to the given types manual
page: <type>object</type> -> php.net/types.object

&return.success; see: language-snippets.ent
&true; <constant>TRUE</constant>
&false; <constant>FALSE</constant>
&php.ini; <filename>php.ini</filename>

Be sure to check out [global.ent](entities/global.ent) and
language-snippets.ent (located within each language's repo) for
more information for entities and URLs.

# Quality Assurance Tools (QA Tools)

There are various scripts available to ensure the quality of the documentation
and find issues with it, they are located in the `scripts/qa/` directory.

There might be some more just in `scripts/` but they need to be checked if they
are still relevant and/or given some love.

# Translation Tools

There are also various scripts to ensure the quality and synchrony of
documentation translations, located in the `scripts/translation/` directory.

Loading
Loading