cesarParra / apexdocs

Node.js tool to generate documentation for your Salesforce Apex Classes.
https://www.npmjs.com/package/@cparra/apexdocs
MIT License
109 stars 18 forks source link

Possibility to provide the documentation root folder #76

Closed IlyaMatsuev closed 1 year ago

IlyaMatsuev commented 1 year ago

I'm using docsify for documentation. My docs folder structure is the following:

docs/
  | - examples/
  | - types/
         | - Classes/      # <-- This is the `Classes` group folder
         | - README.md      # <-- This is the documentation generated by `apexdocs` package
  | - README.md
  | - index.html      # <-- This is the `docsify` index.html file 

So, the problem I'm facing is that Apex classes documentation is not located in the root folder but when I generate it, the links are referencing relatively to the Apex classes README files in group folders:

## Classes

### [SomeService](/Classes/SomeService.md)

Some description

This doesn't work for docsify, as my index.html file is located one level above. It means that when I try to check the Apex Classes documentation from docsify page, clicking on a particular class link, it tries to direct me to /Classes/SomeService.md. But the actual URL in my case should be /types/Classes/SomeService.md.

My current workaround is manually replacing links in the docs folder with a sed bash command but I was wondering what you think about this case and if this could be addressed with an additional option like rootFolder or something. Thanks in advance

cesarParra commented 1 year ago

Delivered in 2.15.0. The argument is called documentationRootDir and it receives the path where the docs reside, relative to the root of the site. So in the case of your example, that value should be types.

Let me know if you find any issues!

IlyaMatsuev commented 1 year ago

Nice @cesarParra, I'm glad you found that feature useful, thanks