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

Add single HTML license generator #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swinslow
Copy link
Member

@swinslow swinslow commented Dec 9, 2024

This adds a new command, LicenseSingleHTMLGenerator, intended to be used for license-list-XML testing purposes.

It generates only the website files (could probably be limited even further to just the HTML file) for just one single identified license or exception. It also skips other steps for full publication, e.g. cross-ref URL checking.

Signed-off-by: Steve Winslow [email protected]

@swinslow
Copy link
Member Author

swinslow commented Dec 9, 2024

@goneall Grateful for any suggestions you have here. This is my first time really digging into the LicenseListPublisher code, so feel free to tell me if I've done things wrong :)

This is motivated by situations like spdx/license-list-XML#1773 (comment) where it's helpful for us to test how a single license or exception renders on the HTML site, without having to run a full website generation round. You'll see that the code is heavily based on LicenseRDFAGenerator -- in fact, it's basically just that code with a lot of the options and additional writer formats stripped out.

@goneall
Copy link
Member

goneall commented Dec 9, 2024

@swinslow - I think this would work, but I wonder if there may be a different design approach which would result in less code duplication.

We could refactor the LicenseRDFAGenerator and separate out the common code, perhaps splitting generateLicenseData into to static methods with one taking List<ILicenseFormatWriter> writers as an input parameter. There's some other refactoring I'd love to do in the LicenseRDFAGenerator, but just haven't had time. Top of the list is to rename it - it does a lot more than generate RDFA (it's original function).

Since you've been in the code more recently, let me know if such a refactoring would work.

One important note, I'm working on a major change to support the SPDX 3 version of the spec. I would suggest holding off on any development until it is merged - which will be within a couple of days of the 3.0.1 spec being release.

I would suggest working off the branch for the PR, but you'll need a bunch of supporting libraries - much easier to work from once it the 3.0 changes are merged.

@swinslow
Copy link
Member Author

Thanks @goneall! Agreed with refactoring for less duplication, and I'm happy to take a stab at it. Will hold off until after the new changes are merged.

@goneall
Copy link
Member

goneall commented Dec 16, 2024

@swinslow - I just merged in the version 3 changes.

BTW - I'm working on one more change before submitting a PR to the license list XML repo to update the CI. I don't know if there's time to get that in before the next license list release.

@goneall
Copy link
Member

goneall commented Dec 16, 2024

@swinslow - I just merged in the version 3 changes.

BTW - I'm working on one more change before submitting a PR to the license list XML repo to update the CI. I don't know if there's time to get that in before the next license list release.

Actually, @swinslow - I should check with you before doing a release to see if you want me to wait for some of the other changes you're working on - let me know.

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.

2 participants