Skip to content

Commit 5dbe914

Browse files
committed
Sync documentation of main branch
1 parent 7a28b84 commit 5dbe914

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

_versions/main/guides/scripting.adoc

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,18 +375,29 @@ With that in place running `jbang quarkusapp.java` will log and render as expect
375375

376376
== Configuring Application
377377

378-
You can use `//Q:CONFIG <property>=<value>` to set up static configuration for your application.
378+
To configure the application you can use the `application.properties` file as usual, but you need to _add_ it to the script:
379379

380-
I.e. if you wanted to add the `smallrye-openapi` and `swagger-ui` extensions and have the Swagger UI always show up you would add the following:
380+
[source,java]
381+
----
382+
//FILES application.properties
381383
382-
[source,java,subs=attributes+]
384+
// ...
385+
@ConfigProperty(name = "prefix", defaultValue = "WG -")
386+
String prefix;
387+
----
388+
389+
This will make the `application.properties` file available to the script, and process the configuration as usual.
390+
391+
You can also use the `application.yaml` file.
392+
For this, you need to _add_ it to the `application.yaml` file to the script and include the `quarkus-config-yaml` dependency:
393+
394+
[source,java]
383395
----
384-
//DEPS io.quarkus:quarkus-smallrye-openapi:{quarkus-version}
385-
//DEPS io.quarkus:quarkus-swagger-ui:{quarkus-version}
386-
//Q:CONFIG quarkus.swagger-ui.always-include=true
396+
//DEPS io.quarkus:quarkus-config-yaml
397+
//FILES application.yaml
387398
----
388399

389-
Now during build the `quarkus.swagger-ui.always-include` will be generated into the resulting jar and `http://0.0.0.0:8080/q/swagger-ui` will be available when run.
400+
NOTE: The path to the `application.properties` and `application.yaml` files are relative to the script file.
390401

391402
== Running as a native application
392403

@@ -440,6 +451,23 @@ __ ____ __ _____ ___ __ ____ ______
440451
2023-03-22 09:38:45,450 INFO [io.quarkus] (main) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
441452
----
442453

454+
=== Using Qute
455+
456+
You can use the xref:./qute.adoc[Qute templating engine] in your JBang script by adding the `quarkus-qute` dependency.
457+
You also need to include the `templates` directory in the script:
458+
[source,java]
459+
----
460+
//DEPS io.quarkus:quarkus-qute
461+
//FILES templates/=templates/*
462+
463+
// ...
464+
465+
@Inject
466+
Template template; // Locate and load the `templates/template.html` file
467+
----
468+
469+
If your `templates` directory includes sub-directories, use `templates/=templates/**/*` instead.
470+
443471
=== Conclusion
444472

445473
If you want to get started with Quarkus or write something quickly, Quarkus Scripting with jbang lets you do that. No Maven, no Gradle - just a Java file. In this guide we outlined the very basics on using Quarkus with JBang; if you want to learn more about what JBang can do, go see https://jbang.dev.

_versions/main/guides/telemetry-micrometer.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Given the following declaration of a timer: `registry.timer("http.server.request
179179
=== Define dimensions for aggregation
180180

181181
Metrics, single numerical measurements, often have additional data captured with them. This ancillary data is used to group or aggregate metrics for analysis.
182-
The Micrometer API refers to this dimensional data as tags, but you may it referred to as "labels" or "attributes" in other documentation sources.
182+
The Micrometer API refers to this dimensional data as tags, but you may see it referred to as "labels" or "attributes" in other documentation sources.
183183

184184
Micrometer is built primariliy for backend monitoring systems that support dimensional data (metric names that are enchriched with key/value pairs).
185185
For heirarchical systems that only support a flat metric name, Micrometer will flatten the set of key/value pairs (sorted by key) and add them to the name.

0 commit comments

Comments
 (0)