291 Commits

Author SHA1 Message Date
Scott Embler
55abbec0ba Adding extension project to support MathML syntax through j2html. (#223)
- Based on PR #220 by matthew-mccall.
2022-12-26 15:36:54 -05:00
Scott Embler
94c82398ad Maven multi module support (#222)
* Restructuring to a Maven multi-module project.

- Renamed directories to match artifact ids.
- Added parent POM.
- Added developers to parent POM.
- Added dependency management and plugin management.  No expectation that the build or release process is fully functional.
- Extracted versions into properties like other projects.

* Fixed file paths for workflow and documentation.

- Added junit to j2html-codegen module.

* Temporarily setting packaging for j2html-codegen to pom, to allow workflow to complete.

* Removed copied configuration of maven-jar-plugin from parent POM.

* Integrating code generation into the main build process.

- j2html-codegen is now supplying a Maven plugin that can read a model file and generate corresponding attribute and tag classes as part of the project build.
- j2html classes that would conflict with the generated classes have been removed.

* Targeting LTS versions only.

- JDK 9 & 10 support ended  in 2018
2022-12-26 09:51:00 -05:00
Scott Embler
38c08d4724 Updating README.md and website documents to match with release 1.6.0. (#214) 2022-06-30 17:49:14 -04:00
David
1c164a0773 [maven-release-plugin] prepare for next development iteration 2022-06-30 20:40:14 +02:00
David
dcc7258c8e [maven-release-plugin] prepare release j2html-1.6.0 j2html-1.6.0 2022-06-30 20:40:09 +02:00
Scott Embler
930ade9354 Upgrading several maven plugins. (#213)
- The maven-enforcer-plugin had an API incompatibility that might be fixed with a version upgrade.
- Several other plugins were out-of-date, and worth upgrading.
- Some plugins were not upgraded out of concern that they might break the build.
2022-06-30 08:12:09 +02:00
Scott Embler
d1c404d5db Web component support (#211)
* Foundational components for reading/processing Wattsi files into classes.

* Introducing tests for compliance with wattsi definitions.

- Several elements have been found to be missing from the code generator.
- A long-term strategy for dealing with obsolete elements will be needed.  Should we remove and change the API?  Or should we deprecate and leave in-place?
- Found one element that was accidentally added to the code generator but never used.  Hopefully.
- Fixes will be applied in following commits.

* Added newer elements/tags and cleaned up invalid Tag class.

- Added DataTag.
- Added SlotTag and TemplateTag to support web components.
- Added global attributes to support web components.
- Removed GenerateTag.  Accidentally introduced by string replacement in code generator.

* Upgrading revapi and maven plugin. Configured revapi to ignore removal of GenerateTag.

- The GenerateTag class was created accidentally.  It does not have any representation in the HTML standard is should not be provided in this library.
2022-06-30 02:13:46 +02:00
Scott Embler
c2177d0584 Updated readme file with latest version number. (#206) 2022-02-02 13:34:48 -05:00
Scott Embler
5eb202b0a9 Updated html files for website. (#205) 2022-01-24 10:57:48 -05:00
Scott Embler
4bda3635ab Website update 1.5.0 release (#204)
* Updated new items to include 1.5.0.

- Adding short upgrade guide for incompatibilities between 1.4.0 and 1.5.0.
2022-01-23 22:04:46 -05:00
David (javalin.io)
f083b2cc9c Update and rename README to README.md 2022-01-23 22:31:21 +01:00
Scott Embler
9ad0e428c1 Fixes #200. Adds support for the picture tag. (#201) 2021-10-03 18:43:33 -04:00
Scott Embler
83866be83f Resolves #194. Introduces Revapi into the build process. (#195)
- Switching to verify goal in main.yml.
2021-06-17 10:17:50 -04:00
David
5135cffc3f Bump website to 1.5.0 2021-06-13 23:10:30 +02:00
David
09e08f3465 [maven-release-plugin] prepare for next development iteration 2021-06-13 23:02:20 +02:00
David
26ba4c3cae [maven-release-plugin] prepare release j2html-1.5.0 j2html-1.5.0 2021-06-13 23:02:14 +02:00
David
dc676b767f bump release plugin 2021-06-13 23:00:16 +02:00
David
07dcbb3ec2 specify pom location for release plugin 2021-06-13 22:11:29 +02:00
Scott Embler
b18459c66f Bifunction each (#191)
Adding TagCreator.each() method to provide access to the collection index.
2021-06-13 16:03:04 -04:00
David
aa8fb7c763 format java code in website project 2021-06-12 22:55:23 +02:00
David
c4f2429ec1 website readme 2021-06-12 22:45:00 +02:00
Scott Embler
a5aaeff22f Merge pull request #190 from obecker/remove-generated
Change package for generated tags
2021-06-12 16:30:49 -04:00
David
f4a179160c move website into repo 2021-06-12 22:19:38 +02:00
Oliver Becker
787035f6b1 Change package for generated tags
- move all generated tag classes from j2html.tags.specialized.generated to j2html.tags.specialized
  since they are now only generated tags and in the long run there should be no difference for a user of j2html whether the classes have been generated or not
2021-06-12 22:13:52 +02:00
Scott Embler
8b08968a6b Merge pull request #187 from obecker/htmltag
Remove manual tags, use only generated tags
2021-06-12 15:14:01 -04:00
Oliver Becker
56f61e421f Remove manual tags, use only generated tags
- change html, head, body from manual to generated tags
- restore compatibility with j2html 1.4.0
- fix https://github.com/tipsy/j2html/issues/185
2021-06-12 20:49:02 +02:00
Scott Embler
afd00597f7 Adding Automatic-Module-Name to manifest to support JDK 9+. (#183)
* Adding Automatic-Module-Name to manifest to support JDK 9+.

- Using reverse-DNS naming convention for module.
2021-06-08 12:23:20 -04:00
Scott Embler
8cc0b7c2c7 Merge pull request #184 from obecker/contributing-fix
Adjust CONTRIBUTING.md to the latest code changes
2021-06-07 18:25:58 -04:00
Oliver Becker
89f0194be0 Adjust CONTRIBUTING.md to the latest code changes
IInstance.get() has been renamed to self() in https://github.com/tipsy/j2html/pull/180
2021-06-07 17:43:35 +02:00
Scott Embler
1079a01750 Merge pull request #182 from obecker/each-fix
Remove calls to render() during tree construction.
2021-06-05 13:42:53 -04:00
Oliver Becker
f89957eeab Fix implementation flaw that called render() during tree construction
* Enables the new render capabilities also for content that was constructed with
  - TagCreator.each(Map, Function) and
  - TagCreator.each(Map, BiFunction)
* Adds convenience method TagCreator.each(DomContent...)
2021-06-04 15:57:16 +02:00
Scott Embler
c07facd490 Merge pull request #181 from sembler/fix_style_and_script_escaping
Treating text as unescaped when using TagCreator methods for style and script elements.
2021-06-03 10:24:45 -04:00
Scott.Embler
1d43a25457 Treating text as unescaped when using TagCreator methods for style and script elements.
- Replicating PR #152, but avoiding conflicts and using more current conventions.
2021-06-02 13:32:37 -04:00
sagesmith-wf
2ecd734239 Make join method work as expected (#168)
- Avoids appending a delimiter to the end of the joined text.
- Add test to verify changes.
2021-06-02 10:11:44 -04:00
Scott Embler
8b2669cab1 Merge pull request #180 from obecker/polish-code
Minor code improvements
2021-05-21 19:39:02 -04:00
Oliver Becker
8c0d03e200 Minor code improvements
* add compiler flag -Xlint:all, resolve all warnings about unchecked or raw generics
* rename IInstance.get() to IInstance.self() because it better reflects its intention
* move MainTag from manual to generated tags
* remove unnecessary type casts in TagCreator
2021-05-21 12:36:51 +02:00
Scott Embler
15702ac0d7 Extracted rendering functionality into implementations of HtmlBuilder. (#179)
* Extracted rendering functionality into implementations of HtmlBuilder.

- Two HtmlBuilders are implemented, FlatHtml and IndentedHtml.  Each offers the equivalent output as ContainerTag.render() and ContainerTag.renderFormatted.
- Existing implementations of DomContent/Renderable were updated to support HtmlBuilder where possible.
- Attribute was altered to support the use of TagBuilder.
- Config was altered to allow instances to be created, which can be passed into factory methods for the HtmlBuilders. Config.defaults() can be used for library defaults, while Config.global() can be used for current static configuration.
- Retained compatibility with previous library version as much as possible. See RenderingCompatabilityTest.

* Fixing unchecked or unsafe operations

* Removing unnecessary @param from javadoc.

* Improving casting of HtmlBuilders in implementations of DomContent (tags, text, etc.).

* Preventing NPEs when text is null.

Co-authored-by: Oliver Becker <ob@obqo.de>
2021-05-20 10:47:06 -04:00
Scott Embler
fd41cccfe2 Merge pull request #176 from obecker/intellij
Add .idea folder to .gitignore for developers using IntelliJ IDEA
2021-04-25 10:11:57 -04:00
Oliver Becker
31a565235e Add .idea folder to .gitignore for developers using IntelliJ IDEA 2021-04-25 10:32:23 +02:00
Oliver Becker
da76ee0d2b Fix indent of tags without tag name when using renderFormatted() (#174)
https://github.com/tipsy/j2html/issues/173

Off topic: Set execute flag on mvnw
2021-04-24 21:52:50 +02:00
Scott Embler
4a4c6314d8 Minor restructuring of Tag internals, increased argument validation, and tests to clarify current behavior. (#175)
Co-authored-by: Scott.Embler <scott.embler@noaa.gov>
2021-04-24 11:37:00 +02:00
pointbazaar
be626b6b96 completely separate the generated interfaces from manual ones and completely separate the manual tags from the generated ones. Also wipe the directories for code generation before code generation (#167) 2020-10-20 10:52:38 +02:00
dependabot[bot]
226cfb9a28 Bump junit from 4.11 to 4.13.1 in /code_gen (#166)
Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.11.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.11...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-17 10:25:29 +02:00
pointbazaar
acf6bff72a Split j2html in 2 projects, "code_gen" and "library" (Issue #161) (#165)
* split the project in 2, to make it easier to iterate on the code generation without breaking the build. This could also help reduce the compiled size of the library.

* update CONTRIBUTING.md

* try to fix github workflow
2020-10-17 10:23:57 +02:00
dependabot[bot]
07427c1433 Bump junit from 4.12 to 4.13.1 (#164)
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-13 15:10:36 +02:00
lambdaupb
7d98d4f2bd Escape Attribute on render instead of in constructor. Fixes #160 (#162)
Also initialize EscapeUtil StringBuilder with input length to avoid growing copying.
2020-09-24 08:50:01 +02:00
lambdaupb
94ad6e29a3 Use one Appendable instance that is passed down for all rendering (#158) 2020-09-23 20:53:32 +02:00
pointbazaar
9338efc7cd Add CONTRIBUTING.md (depends on PR156) (#157)
* start on CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2020-08-31 16:24:44 +02:00
pointbazaar
312cabe69c Implementation of Attributes-per-Tag via Interfaces (#156) 2020-08-31 16:24:00 +02:00
pointbazaar
f091000bbe first iteration of the attribute per tag POC (#154)
* create HtmlTag, BodyTag, HeadTag. hopefully without too large diffs this time.

* add some forgotten variants

* remove 'final' on some methods changed during the last 2 commits, to make it more consistent with the rest of the code

* remove <head>,<body>,<html> from TagCreatorCodeGenerator
2020-08-16 10:39:13 +02:00