doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

Fix ext/dom constant aliases

Open kocsismate opened this issue 1 year ago • 5 comments

I noticed failures when I tried to run ./build/gen_stub.php --verify-manual ./ ../doc-en/, and it turned out that the newly added ext/dom constant aliases cause this. I found no way to add support for the DOM_INDEX_SIZE_ERR / Dom\INDEX_SIZE_ERR format in gen_stub.php (gen_stub.php can only replace/fix constants one-by-one), so I had to duplicate the constant definitions in the manual.

Since the constant IDs would clash in most of the cases, I had to add an extra dom- prefix to them. It may be possible to fix these via phd and use . as separator instead of - in case of namespaces (?).

kocsismate avatar Dec 12 '24 07:12 kocsismate

Known when reviewing the PR: https://github.com/php/doc-en/pull/4212#discussion_r1865855179

I don't think duplicating the test is useful, or at minimum use XIncludes so they do not get out of sync.

For the linking aspect I would prefer to have @haszi's input, considering they handled the whole constant linking thing.

Girgias avatar Dec 12 '24 08:12 Girgias

I just thought of the good solution, which is to convert the table to a <variablelist> and have multiple <term> elements. Will do that soonish.

Girgias avatar Dec 12 '24 17:12 Girgias

For the linking aspect I would prefer to have @haszi's input, considering they handled the whole constant linking thing.

All the linking needs is an xml:id so the simplest way to do this is to use one <term> / <entry> tag per constant and add an xml:id to the alias's tag. This will work as long as we make sure PhD renders those IDs.

E.g.:

     <row xml:id="constant.dom-index-size-err">
      <entry>
       <constant>DOM_INDEX_SIZE_ERR</constant>
       (<type>int</type>)
      </entry>
      <entry xml:id="dom.constants.index-size-err">
       <constant>Dom\INDEX_SIZE_ERR</constant>
       (<type>int</type>)
      </entry>

haszi avatar Dec 29 '24 12:12 haszi

@haszi Thank you for the hint! @Girgias Are you still planning to convert the table to a list?

kocsismate avatar Dec 30 '24 12:12 kocsismate

@haszi Thank you for the hint! @Girgias Are you still planning to convert the table to a list?

Still planned, but feel free to do @haszi suggestion in the meantime :)

Girgias avatar Jan 27 '25 15:01 Girgias