Skip to content

Add single HTML license generator#189

Open
swinslow wants to merge 1 commit intospdx:masterfrom
swinslow:single-html
Open

Add single HTML license generator#189
swinslow wants to merge 1 commit intospdx:masterfrom
swinslow:single-html

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 steve@swinslow.net

Signed-off-by: Steve Winslow <steve@swinslow.net>
@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.

@goneall
Copy link
Member

goneall commented Oct 10, 2025

Ping @swinslow - should I go ahead and merge?

@swinslow
Copy link
Member Author

Hi @goneall -- in all honesty I haven't looked back at this since submitting it in Dec. 2024. I will probably need to take another look at it before telling you to go ahead and merge it.

(From a quick glance now, I do see also that on line 320 I misspelled "licencenseXmlFile" -- so I'll fix that at least!)

@goneall
Copy link
Member

goneall commented Oct 25, 2025

@swinslow - I'm planning on doing a release this weekend - I can catch this PR on a subsequent release.

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