1. Include Source Code
A collapsed list
-
a
-
b
-
c
Source Code File
public class FileRenamer {
...
private static void renameFiles() {
try (Stream<Path> walk = Files.walk(Paths.get(DIRECTORY + File.separator + "styles"))) {
walk
.filter(Files::isRegularFile)
.forEach(file -> {
String fileName = file.getFileName().toString();
String newFileName =
fileName.substring(0, fileName.length() - 4)
+ ".min"
+ fileName.substring(fileName.length() - 4);
// tag::rename-file[]
try {
Files.move(file, (1)
file.getParent().resolve(newFileName)); (2)
} catch (IOException e) {
System.err.println(e.getMessage());
}
// end::rename-file[]
});
} catch (IOException e) {
e.printStackTrace();
}
}
...
}
[source, java]
.Java code from project
----
include::src/main/java/at/htl/asciidoc/FileRenamer.java[tag=rename-file,indent=0]
----
5. Images
With the backend attribute, it is possible to control the output:
-
In the pdf the image is full-size
-
in the slides and html the image is 50% sized
ifdef::backend-html5,backend-revealjs[image:animal-pet-cute-kitten-45201.jpg[width=50%]] ifdef::backend-pdf[image:animal-pet-cute-kitten-45201.jpg[]]
Cute kitten (credits to pixabay)

7. Links:
-
Haki-Blog → look at the "related posts" - links at the end of the post
-
https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/
-
A very nice example of a reveal presentation:
-
CyberlandConf 2020 github-repo, slides