DEV Community

Cover image for javadoc-cleanup 1.3.7 Released (minor bug fixes)
Vincent A. Cicirello
Vincent A. Cicirello

Posted on

javadoc-cleanup 1.3.7 Released (minor bug fixes)

TL;DR

I just released javadoc-cleanup 1.3.7, a GitHub Action to Post-Process Javadoc-Generated Documentation in GitHub Actions Before Deploying to the Web. The javadoc-cleanup GitHub Action is implemented in Python, and its functionality includes inserting a viewport meta tag if not present (pre-Java 16); generating and inserting canonical URLs into the head of Javadoc pages; an option to insert a user-defined block into the head of Javadoc generated pages, which I use in my projects to insert my website's favicon and a referrer policy; and a few other things.

This release, javadoc-cleanup 1.3.7, primarily consists of minor bug fixes not likely encountered by users, all related to regular expressions used to check for things within Javadoc generated HTML, such as to check for presence of a viewport meta tag, or to check if a page was generated by Javadoc to begin with. The existing regular expressions worked correctly for all cases based upon actual Javadoc generated pages, but could fail for other validly formatted tags they were designed to detect. Bugs revealed by warning messages generated by Python 3.12 about the regular expressions that were not generated by Python 3.11 and earlier.

Changelog 1.3.7 - 2023-10-05

Fixed

  • Fix minor bug in regex used to detect if an HTML file was generated by Javadoc.
  • Fix minor bug in regex used to detect if an HTML file is a redirect, such as in javadocs for libraries that define a JPMS module.
  • Fix minor bug in regex used to detect if a Javadoc page already specified a viewport directive, such as in Java 16+.

Dependencies

  • Bump cicirello/pyaction from 4.11.1 to 4.25.0, including upgrading Python within the Docker container to 3.12.

CI/CD

  • Bump Python to 3.12 in CI/CD workflows when running unit tests.

More Information

Please consider starring javadoc-cleanup's GitHub repository:

GitHub logo cicirello / javadoc-cleanup

Create mobile-friendly documentation sites by post-processing javadocs in GitHub Actions

javadoc-cleanup

cicirello/javadoc-cleanup - Create mobile-friendly documentation sites by post-processing javadocs in GitHub Actions

Check out all of our GitHub Actions: https://actions.cicirello.org/

About

GitHub Actions GitHub release (latest by date) Count of Action Users
Build Status build CodeQL
Source Info License GitHub top language
Support GitHub Sponsors Liberapay Ko-Fi

The javadoc-cleanup GitHub action is a utility to tidy up javadocs prior to deployment to an API documentation website, assumed hosted on GitHub Pages. It performs the following functions:

  • Improves mobile browsing experience: It inserts <meta name="viewport" content="width=device-width, initial-scale=1"> within the <head> of each html file that was generated by javadoc, if not already present. Beginning with Java 16, javadoc properly defines the viewport, whereas prior to Java 16, it does not.
  • Strips out any timestamps inserted by javadoc: The timestamps cause a variety of version control issues for documentation sites maintained in git repositories. Javadoc has an option -notimestamp to direct javadoc not to insert timestamps (which we recommend that you also use). However, at the present time there appears to be a bug (in OpenJDK 11's javadoc, and possibly other versions)…

For more information, see my earlier post about javadoc-cleanup here on DEV, as well as its webpage.

javadoc-cleanup - Create mobile-friendly and SEO ready documentation sites by post-processing javadocs in GitHub Actions

The javadoc-cleanup GitHub Action enables creating mobile-friendly and SEO ready documentation sites by post-processing javadocs in GitHub Actions. It is a utility to tidy up javadocs prior to deployment to an API documentation website, including improving mobile browsing experience, inserting canonical links, and anything else you want to insert into the head of each page.

favicon actions.cicirello.org

If you'd like to see some examples of how this action can be used within GitHub Workflows, then also check out another earlier DEV post:

Where You Can Find Me

Follow me here on DEV and on GitHub:

Or visit my website:

Vincent A. Cicirello - Professor of Computer Science

Vincent A. Cicirello - Professor of Computer Science at Stockton University - is a researcher in artificial intelligence, evolutionary computation, swarm intelligence, and computational intelligence, with a Ph.D. in Robotics from Carnegie Mellon University. He is an ACM Senior Member, IEEE Senior Member, AAAI Life Member, EAI Distinguished Member, and SIAM Member.

favicon cicirello.org

Top comments (0)