spring-io / spring-asciidoctor-extensions

Asciidoctor Extensions developed by the Spring team
46 stars 18 forks source link

Allow blockswitch css and javascript to be easily removed #74

Closed philwebb closed 3 years ago

philwebb commented 3 years ago

Currently blockswitch css and javascript is embedded in every page and is hard to remove if a custom HTML converter is being used that wants to support switch blocks directly. Although the user could remove the extension entirely, it would be nice to include some <!--start..., <!--end... comments to help a post processor remove or replace the docinfo block.

wilkinsona commented 3 years ago

@philwebb As far as I can tell, the Spring Asciidoctor backend ended up not using this functionality. Can we revert this change?

philwebb commented 3 years ago

I've got an open issue to fix that https://github.com/spring-io/spring-asciidoctor-extensions/issues/75. Perhaps there's a better way than the comments? We could use an attribute that the backend sets.

wilkinsona commented 3 years ago

An attribute sounds good to me. I think it makes a lot of sense for the CSS in particular. Being able to switch off the JS is a bit weird though as the extension does nothing without it. I think I'd rather the backend failed gracefully and told the user to remove the extension from their build. Alternatively, the backend could detect the extension's presence and back off.

philwebb commented 3 years ago

OK, let's revert this one and I'll find another way to detect it in the backend.