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

Automatically fetch plugin description from README.md #128

Open
zhutmost opened this issue May 11, 2024 · 1 comment
Open

Automatically fetch plugin description from README.md #128

zhutmost opened this issue May 11, 2024 · 1 comment

Comments

@zhutmost
Copy link

In the JetBrains graddle plugin template, the in plugin.xml is generated by the build flow. It will locate the flag in the README.md, and automatically insert the description into the final plugin.xml.
The related code in build.graddle.kts is: (Link)

        // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
        pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
            val start = "<!-- Plugin description -->"
            val end = "<!-- Plugin description end -->"

            with (it.lines()) {
                if (!containsAll(listOf(start, end))) {
                    throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
                }
                subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
            }
        }

Please add this feature into this sbt build flow. It is very useful.

@unkarjedy
Copy link
Member

It looks like a nice feature, but unfortunately we won't have resources to address it in the nearest future.
A PR would be very welcome.

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

No branches or pull requests

2 participants