Skip to content

Support for custom templates #286

@Russman12

Description

@Russman12

I was surprised to find that there doesn't seem to be any way to provide a custom template for the generated markdown. I know there are post processing hooks and ways to update the frontmatter, but I could not find any way to customize the templates themselves.

While I generally really like this project, I think the templates are meh. It certainly gets the job done, but I think it looks too cluttered. Personally, I like how salesforce's apex documentation has a bulleted list of methods and descriptions, with links to more detailed info about the methods. In the sprit of making the project "non opinionated"

I really think there should be a way for consumers to provide their own templates. This would greatly increase the customizability of package.

Some ways this can be implemented:

  1. Provide a new config, for pointing to a custom templates directory. When provided, any templates matching expected names will override the default templates provided by the project. In the future, this could be expanded on to allow consumers to specify any template under the directory, and have some syntax to link it or something that could be very robust.
  2. On install, create a template directory within the consumer project with default templates. This would be the new exclusive source for apexdoc's templates. If a consumer doesn't like the template, they can just change it. This would require no config changes for the consumer, but would also allow the consumer to break things.
  3. Have multiple config entries, one for each individual template. This might be verbose if a caller wants to override multiple templates, but it's the most explicit of the options as it allows a consumer to structure their project how they want, and only specify the overrides they need.

@cesarParra, I'd like to hear your thoughts on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions