# js-utils **Repository Path**: mirrors_dsyer/js-utils ## Basic Information - **Project Name**: js-utils - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-03 - **Last Updated**: 2026-03-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Javascript library (ESM module) with utilities for [Spring](https://spring.io) documentation and websites. ## Usage ``` ``` or ``` ``` ## Block Switcher Often used for switching code samples globally between different high level options (Java and Kotlin, Java and XML, YAML and Properties, etc.). If HTML is rendered with Asciidoctor then code snippets like this: ``` [source,xml,indent=0,role="primary"] .Maven ---- com.example some-library 1.2.3 ---- [source,indent=0,role="secondary"] .Gradle ---- compile 'com.example:some-library:1.2.3' ---- ``` Then the HTML will be generated with "title" elements, like this: ```
Maven

    com.example
    some-library
    1.2.3

    
Gradle
compile 'com.example:some-library:1.2.3'
    
``` The script scans for this kind of structure and re-organizes it so that only one snippet is visible and the others are selectable by a click. It works for all blocks with "Maven|Gradle" choices in the whole document, on the assumption that the user only wants to select this once. It's a bit like classic navigation tabs, but applied to the whole content, not just navigation. ## Publishing This library is published in NPMJS (following instructions [here](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages)). That's how the `unpkg.com` links work above: ``` $ npm login $ npm publish --access public ```