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

Change the content of the generated HTML files from the Maven plugin #121

Closed
wants to merge 1 commit into from
Closed

Conversation

gallandarakhneorg
Copy link

With this pull request, the HtmlFile class exhibits properties that permit to change the content of the generated files. Some of these properties may be set from the Maven's configuration of jnario-maven-report-plugin.

The added properties are:

  • showTabs for enabling the generation of the tabs "Spec" and "Source" (also configurable from Maven).
  • showSource for enabling the generation of the tab "Source", specifically.
  • specTabLabel for changing the label of the "Spec" tab (also configurable from Maven).
  • sourceTabLabel for changing the label of the "Source" tab (also configurable from Maven).
  • footer for changing the text generated at the foot of the pages (also configurable from Maven).

… class has several properties that permit to change several parts of the generated files. Some of these properties may be set from the Maven's configuration of jnario-maven-report-plugin.
@sebastianbenz
Copy link
Owner

Thanks a lot for the contribution! It definitely makes sense to provide further customization options for the generated documentation. The only thing is, that I am not sure, whether it makes sense to configure it from the maven plugin. The problem is that the features works in this case only with maven and not with the doc generator integrated into Eclipse. I would prefer a more general approach of having a properties file somewhere in the same or in one of the parent directories which contains the customizations. This has the advantage that all generators (maven, eclipse, ...) would automatically support customizing the generated documentation.

What do you think?

@gallandarakhneorg
Copy link
Author

I created this pull request only to provides a possible implementation of this feature, quicly; and to start the discussion.

I agree wit you. On efficient way could be to avoid to have "hard-coded" creation of the HtmlFile instances, but use a factory in place of. In this way, it will be easier to create customized HTML generators. With injection mechanism, it will be possible to change the factory.
Another way could be the use of HTML template files, put in the resources of the project. So the current HTML content will be copied into a "default" template.

Perhaps the best way will be:

  • Recode the HtmlFile for supporting HTML templates.
  • Inject the HtmlFile.

I have no concrete idea on what HTML template library to use, if it exists, yet.
What is your position?
I may update this pull request with an updated approach.

@sebastianbenz
Copy link
Owner

Having clean SpecHtmlFile, FeatureHtmlFile,... interfaces would definitely be nice to have. However, we would then need to find a way to add custom implementations during runtime, which makes things complicated again.

As a first step I would prefer your approach of having static extension points which can be configured via a properties file. This could even go as far as including custom header and footer files. To simplify configuration, these files could be edited via an Eclipse preferences page.

@sebastianbenz
Copy link
Owner

Unfortunately, I could not integrate your pull request into the latest Jnario release as it does not yet fit the approach how we handle settings in Jnario. But it is not forgotten and I definitely would like to integrate such a feature in one of the releases.

@gallandarakhneorg
Copy link
Author

This pull request is partly duplicate of #143 since I solve most of my problems concerning the structure of the tags in the generated HTML files with the generator proposed by #143.
We could close this pull request without merging it.

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.

None yet

2 participants