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

Add output_path argument to render_docs() #300

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

etiennebacher
Copy link
Owner

@etiennebacher etiennebacher commented Nov 23, 2024

Fixes #299

Bunch of auto-formatting changes, the actual changes are at the end of render_docs(). Instead of changing the target directory in all internal functions, I just cut and paste the "docs" folder to wherever the output path is.

@nsheff Could you try this branch and let me know if that works?

pak::pak("etiennebacher/altdoc#300")

Note that with this PR, the output folder is still named "docs", so render_docs(output_path = "../mydocs") creates ../mydocs/docs. Is this what you had in mind or did you expect ../mydocs to contain all the documentation files?

@nsheff
Copy link

nsheff commented Nov 23, 2024

I was expecting to be able to control the output folder entirely.

In my use case, I was thinking of putting multiple altdoc-managed packages into a single mkdocs website. So, I'll already have a parent docs folder; I want to control the name of the subfolder I put this particular package's docs in.

@etiennebacher
Copy link
Owner Author

Ok so you'd expect ../mydocs to contain the documentation files. But until #298 is solved I don't think you'd be able to have those multiple subfolders with each containing a separate altdoc documentation. Even if it was solved, each subfolder would still contain an mkdocs.yml file, so for instance you might have:

  • all-docs
    • pkgA-docs
      • mkdocs.yml
      • other files...
    • pkgB-docs
      • mkdocs.yml
      • other files...

Would mkdocs still work with this structure? I've never made multi-project websites.

@nsheff
Copy link

nsheff commented Nov 25, 2024

Well, I would put the primary mkdocs config under all-docs.
Then mkdocs would just ignore the other ones. So, they could be deleted/ignored/whatever, and I think it could work.

Is altdoc simply copying the mkdocs.yml file over from the altdoc/ folder in the R package?
If so, possibly a setting like include_mkdocs_config=FALSE or suppress_mkdocs_config=TRUE could just prevent it from creating it.

@etiennebacher
Copy link
Owner Author

Is altdoc simply copying the mkdocs.yml file over from the altdoc/ folder in the R package?

It copies the file but also replaces some template variable e.g. $ALTDOC_PACKAGE_VERSION, by their actual values.

If so, possibly a setting like include_mkdocs_config=FALSE or suppress_mkdocs_config=TRUE could just prevent it from creating it.

I don't want to add arguments that are tool-specific. This would only be useful for mkdocs and not for the others. I'd prefer you to delete those files yourself after generating all the package doc subfolders in your main "all-docs" folder, as you suggested.

Could you try this PR, just to check that the structure of output is as you expect? (I know #298 is still the main issue here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to configure output directory of render_docs
2 participants