Fullmenu null


01 August 2017

You can access the content in HTML in this link https://groovy-lang.gitlab.io/101-scripts/
You can access the content in PDF in this link enlace 101-groovy-scripts-pdf.pdf
You can access the content in eBook in this link enlace 101-groovy-scripts-epub.epub

The aim of 101 Scripts de Groovy it’s to collect as many practical Groovy Scripts we can in order they can be use in you daily work. To include your script in the site you only need to follow these steps:


  • We want scripts that solve specific problems. Don’t worry if your script seems very specific, surely it can provide ideas to someone about how to solve a similar situation

  • There is not such thing as a too simple script. Maybe your small script can solve a problem to someone (and in this way we will reach faster the 101 limit)

  • You need to write at least one script and one documentation file. If you want you can attach screenshots or similar but it isn’t required

  • The script must be functional. Under the documented circumstances someone can execute it and obtain a result

  • We have created some categories but it’s not a closed list. If you think your script can be categorized in other just tell us

  • We use Asciidoctor. It’s mandatory because is the toolchain we use to build the Html, Pdf and ePub

  • We use Jbake for the static site. Yes, there are more but we like this. But don’t worry it’s running and working fine


The script must be in src/jbake/assets/script/category where category is one of the availables. Currently we have basico,bbdd,docker,file ,google,office, etc ( basico it’s basic in spanish )

The asciidoct must be in src/jbake/content/category (be aware of the directory)

As a general rule we capitalize the script but not the adoc. If you write a post in english it’s better to add the -en suffix to the name (i.e. my-documentation-en.adoc )

The adoc file needs to have this header:

= Title
Name <email@email.domain>
:jbake-type: post
:jbake-status: published
:jbake-tags: blog, asciidoc, all the tags you want
:jbake-category: the category
:jbake-script: /scripts/categoria/NombreScript.groovy
:jbake-lang: en (if it's in english, or empty if it's in spanish)
:imagesdir: ../images

You documentation starts here

jbake-category is the attribute that helps the generator position your script in the menu jbake-script is the attribute that helps the generator link your script with the documentation jbake-lang is the attribute that indicates on which language your documentation is `jbake-type`indicates that it is a post type document (the one we use) `jbake-status`indicates the document is ready for publication (otherwise please use draft)


If you have Java installed you can serve the blog in your machine. In this way you can review your post before to do a Merge Request. You only need to execute:

./gradlew serveApp

when it’s ready yo can go to http://localhost:8081/101-scripts


You can use from a simple editor to a complex Ide. We use Intellij but surely others are also good. Remember to restart the serveApp task when you make changes in order to regenerate the site