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

Migrate PHP Documentation schema to DocBook 5.2 #3326

Open
13 of 16 tasks
Girgias opened this issue Apr 21, 2024 · 2 comments
Open
13 of 16 tasks

Migrate PHP Documentation schema to DocBook 5.2 #3326

Girgias opened this issue Apr 21, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Girgias
Copy link
Member

Girgias commented Apr 21, 2024

DocBook 5.2 has finally been released: https://www.oasis-open.org/2024/02/13/the-docbook-schema-version-5-2-oasis-standard-published/

The primary motivation to migrate to this new version is to be able to use the new <enumsynopsis> tag.

However, there a some issues with the current documentation which makes this migration challenging.

RelaxNG Schema

The new schema is only provided as a RelaxNG schema, whereas most of our tooling expects a DTD.
I have made progress in checking the documentation against it, but this required compiling jing-trang locally to check what is causing issues. It is likely we will need to have this on CI somehow to improve the debugging experience for new contributors.

Legacy custom markup

Classes, Interfaces, and Exceptions use a custom phpdoc: tag, and need to be converted to a structure that fits the DocBook schema, I have written a script that converts the relevant files to a new markup, but this does not validate the schema yet.

Turns out jumping directly to DocBook 5.2 simplifies some stuff as we just need to replace those tags with <reference>.

However, our "new" markup for extending classes/implementing interfaces doesn't comply :(
There seems to either be a bug in the DocBook 5.2 schema, or an undocumented BC break. Trying to contact the relevant people about this issue.

Minor schema violation issues

Various files do not follow the DocBook schema properly and need to be fixed some bigger issues are:

Migration Procedure

@haszi
Copy link
Contributor

haszi commented May 16, 2024

Maybe we can convert some of the tooling (e.g. doc-base's configure.php) to use DOMDocument::relaxNGValidate() to switch from DTD to RelaxNG schema validation. Do you think that could work?

@Girgias
Copy link
Member Author

Girgias commented May 20, 2024

Maybe we can convert some of the tooling (e.g. doc-base's configure.php) to use DOMDocument::relaxNGValidate() to switch from DTD to RelaxNG schema validation. Do you think that could work?

So yes that's the plan, but libxml2 is terrible at giving useful errors when the schema fails, and also it somehow doesn't validate the schema properly unless I reload the whole file.

You can see what I have here: php/doc-base@master...Girgias:doc-base:docbook-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants