Skip to content

Refactor header and footer support to use mustache templating. #2554

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

Merged
merged 4 commits into from
Mar 3, 2021

Conversation

srawlins
Copy link
Member

@srawlins srawlins commented Mar 2, 2021

  • Remove mixin GeneratorContext and move contained code into
    DartdocGeneratorOptionContext, the only class which mixed in this mixin.
  • Breaking change: Move DartdocGeneratorOptionContext from
    lib/dartdoc.dart to lib/options.dart, which is more directly related to
    the class, and is the only library in which this class is constructed or
    extended.
  • Add header, footer, and footerText getters to
    DartdocGeneratorOptionContext.
  • Add customHeaderContent, customFooterContent, and customInnerFooterText
    to DartdocGneratorBackendOptions.
  • Breaking change: Privatize the DartdocGeneratorBackendOptions into a new
    private constructor which takes no parameters.
  • Change all header/footer/footer-text placeholder comments in templates to
    instead be mustache interpolations.

* Remove `mixin GeneratorContext` and move contained code into
  DartdocGeneratorOptionContext, the only class which mixed in this mixin.
* **Breaking change**: Move DartdocGeneratorOptionContext from
  `lib/dartdoc.dart` to `lib/options.dart`, which is more directly related to
  the class, and is the only library in which this class is constructed or
  extended.
* Add `header`, `footer`, and `footerText` getters to
  DartdocGeneratorOptionContext.
* Add `customHeaderContent`, `customFooterContent`, and `customInnerFooterText`
  to DartdocGneratorBackendOptions.
* **Breaking change**: Privatize the DartdocGeneratorBackendOptions into a new
  private constructor which takes no parameters.
* Change all header/footer/footer-text placeholder comments in templates to
  instead be mustache interpolations.
@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Mar 2, 2021
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 91.734% when pulling 2dd5b4b on srawlins:headers-footers into 217c584 on dart-lang:master.

@srawlins srawlins requested a review from jcollins-g March 2, 2021 23:59
Copy link
Contributor

@jcollins-g jcollins-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, and is way simpler than what I thought it would look like!

Approved, assuming you have tested this with Flutter and the custom headers/footers look reasonable there.

@srawlins
Copy link
Member Author

srawlins commented Mar 3, 2021

Header and footers look good to me. The use --header and --footer-text, but not --footer.

@srawlins srawlins merged commit 59166fd into dart-lang:master Mar 3, 2021
@srawlins srawlins deleted the headers-footers branch March 3, 2021 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants