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

Use Documentation as a default --config option setting #486

Open
garvinhicking opened this issue Apr 3, 2024 · 0 comments
Open

Use Documentation as a default --config option setting #486

garvinhicking opened this issue Apr 3, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@garvinhicking
Copy link
Contributor

In #421 I tried to adjust guides and render-guides so that it would use --config=Documentation as a default.

Since this idea was part of #421 where it didn't belong, and I failed with my approach, we may address this at a later time.

Description:

render-guides/packages/guides-cli/bin/guides does a very early interpretation of the "config" attribute:
https://github.com/phpDocumentor/guides/blob/main/packages/guides-cli/bin/guides#L54

That means, I'd have to inject fetching a default configuration (based on the path that is to be rendered) at this place.

However, the directory to render is calculated much later on (guides defines it as "docs", render-guides defines it as "Documentation" in a decorator).

So:

  • In the guides binary, I can influence additional loading of a guides.xml - but I cannot get the default "Documentation" render directory, because that is performed AFTER the guides.xml loading.
  • In our render-guides Decorator I can get the proper render directory, but I can no longer inject a guides.xml file (because the container is already built with the XML specifications as part of guides).

I could fetch a default "config" option in the case that a Directory is specified:

vendor/bin/guides Documentation

but I could not get the "right" directory name ("Documentation/") if I would call the binary just via:

vendor/bin/guides

So I think we'll need to retain '--config' as a mandatory argument.

For overview, current behavior:

vendor/bin/guides
# -> Renders "/Documentation", loads "/guides.xml"

vendor/bin/guides Documentation
# -> Renders "/Documentation", loads "/guides.xml"

vendor/bin/guides --config=Documentation
# -> Renders "/Documentation", loads "/Documentation/guides.xml" and "/guides.xml"

vendor/bin/guides --config=Documentation Documentation
# -> Renders "/Documentation", loads "/Documentation/guides.xml" and "/guides.xml"

My goal would be to make all four commands do the same: Render "Documentation", load "Documentation/guides.xml" and load "/guides.xml".

@garvinhicking garvinhicking added enhancement New feature or request help wanted Extra attention is needed labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant