onury/docma

Docma CLI `--base` overwrite option

ghermeto opened this issue · 6 comments

The docma serve command can have a --base option that is very useful to test locally when you have a app.base specified. However, the main Docma CLI doesn't have a --base option that allow us to overwrite what is specified on app.base.

This poses a challenge to publish different module versions to our internal manuals which has the version as part of the base path (as /view/module-name/doc-type/version/). Ideally we would like to overwrite the base with a command line argument. This way we would use package.json vars to build documentation for multiple versions.

Is that something that interest you? I can send a PR for it.

onury commented

Thanks but docma serve command already has it. See docs here.

Sorry, maybe my message wasn't clear. I know docma serve has it, but the main docma command doesn't. I would like a way to override app.base at the time we are generating docs to publish in a static server, because our manual server put the version as part of the URL. Without it, every time we are publishing a new version we need to modify docma.json app.base to have the new version and can't rely on automated tools for publishing the library.

actually, nevermind... I can create a script that modifies docma.json and call it on prepublishOnly. doesn't need to be part of docma.

onury commented

I see what you mean. Yes --base option would be very useful for that kind of use-case. You're welcome if you still want to send a PR. I'll re-open this as a feature-request now. Thanks.

Thanks. I opened #79 with the changes. Currently there isn't a great way to test CLI without change some of the current behavior (like passing argv as a parameter to to updateConfig and exporting the method), but I didn't want to make such a huge change for something so small. If you like I can make another PR to enable CLI testing.

onury commented

No problem. Thanks