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

Html builder refactor #72

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

protolambda
Copy link

Hey, ESdoc has been of great use so far, but some of the html generation was not customizable enough for me. So I changed the builder system a bit:

  • Each builder is optional now.
  • Moved the html plugin class to HtmlBasePlugin, and left a proxy to it. It works the same as previously, but people can extend the Plugin class of esdoc-publish-html-plugin now to add their own builders.
  • There is a set of default builders, behaving exactly like the old hardcoded set of builders.
  • Each builder has the same exec function signature. Constructors can be different, but I kept the default set of builders consistent (builders are added by providing a creator-function, which wraps instantiation).
  • Each builder can be configured with builder-specific options.
  • There are also a global options, available to each builder. Useful for things like generating custom navigation.
  • Split the DocBuilder class in two: a base builder class named Builder that's very general, and DocBuilder. The old DocBuilder class is way too large for my liking, it's better to layer functionality.

Features:

  • For the manual builder: file patterns for the badge can now be configured.
  • For general: user can overrule the header-link behavior, and specify their own custom links.
  • The file-path for coverage reporting data can be configured now.

See the new esdoc-publish-html-plugin README.md for details about the configuration format.

@protolambda
Copy link
Author

Also, for a future PR, I'm looking to improve the manual builder; the current builder flattens the manual structure and breaks all relative links in the markdown (it doesn't even change .md to .html). I'm thinking of creating a second manual-builder class that will implement this, and then we can compare/merge/replace the builders later.

@protolambda protolambda force-pushed the html-builder-refactor branch from 0952cf0 to 798c2c0 Compare August 23, 2018 15:49
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.

1 participant