Skip to content

Commit

Permalink
Sync documentation of main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 15, 2024
1 parent a07e8d4 commit 11c8f26
Show file tree
Hide file tree
Showing 8 changed files with 480 additions and 19 deletions.
27 changes: 27 additions & 0 deletions _data/versioned/main/index/quarkus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2011,6 +2011,33 @@ types:
id: maven-tooling
type: guide
url: /guides/maven-tooling
- title: Quarkus for the Web
filename: web.adoc
summary: Learn more about creating all kinds of Web applications with Quarkus.
categories: web
topics:
- http
- web
- renarde
- full-stack
- qute
- quinoa
- web-bundler
- mvc
- ssr
- nodejs
- npm
- javascript
- css
- jsf
- faces
extensions:
- io.quarkiverse.qute.web:quarkus-qute-web
- io.quarkiverse.renarde:quarkus-renarde
- io.quarkiverse.web-bundler:quarkus-web-bundler
- io.quarkiverse.quinoa:quarkus-quinoa
type: guide
url: /guides/web
- title: Qute Templating Engine
filename: qute.adoc
summary: Learn more about how you can use templating in your applications with the Qute template engine.
Expand Down
98 changes: 98 additions & 0 deletions _data/versioned/main/index/relations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6931,6 +6931,10 @@
matches: 1
/guides/http-reference:
sameTopics:
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 2
- title: Using Reactive Routes
url: /guides/reactive-routes
type: guide
Expand Down Expand Up @@ -10564,6 +10568,10 @@
url: /guides/qute-reference
type: reference
matches: 2
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
sameExtensions:
- title: Qute Reference Guide
url: /guides/qute-reference
Expand All @@ -10575,6 +10583,10 @@
url: /guides/qute
type: guide
matches: 2
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
sameExtensions:
- title: Qute Templating Engine
url: /guides/qute
Expand Down Expand Up @@ -11037,6 +11049,10 @@
url: /guides/http-reference
type: reference
matches: 2
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 2
- title: Authorization of web endpoints
url: /guides/security-authorize-web-endpoints-reference
type: reference
Expand Down Expand Up @@ -12713,6 +12729,10 @@
url: /guides/security-oidc-bearer-token-authentication-tutorial
type: tutorial
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Quarkus Security architecture
url: /guides/security-architecture
type: concepts
Expand Down Expand Up @@ -12932,6 +12952,10 @@
url: /guides/security-oidc-code-flow-authentication-tutorial
type: tutorial
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Quarkus Security architecture
url: /guides/security-architecture
type: concepts
Expand Down Expand Up @@ -13119,6 +13143,10 @@
url: /guides/security-oidc-code-flow-authentication-tutorial
type: tutorial
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Quarkus Security architecture
url: /guides/security-architecture
type: concepts
Expand Down Expand Up @@ -13328,6 +13356,10 @@
url: /guides/security-oidc-code-flow-authentication-tutorial
type: tutorial
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Quarkus Security architecture
url: /guides/security-architecture
type: concepts
Expand Down Expand Up @@ -13612,6 +13644,10 @@
url: /guides/security-oidc-code-flow-authentication-tutorial
type: tutorial
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Quarkus Security architecture
url: /guides/security-architecture
type: concepts
Expand Down Expand Up @@ -19397,6 +19433,56 @@
url: /guides/rest
type: guide
matches: 1
/guides/web:
sameTopics:
- title: HTTP Reference
url: /guides/http-reference
type: reference
matches: 2
- title: Using Reactive Routes
url: /guides/reactive-routes
type: guide
matches: 2
- title: Authorization of web endpoints
url: /guides/security-authorize-web-endpoints-reference
type: reference
matches: 1
- title: Basic authentication
url: /guides/security-basic-authentication
type: concepts
matches: 1
- title: Cross-Site Request Forgery Prevention
url: /guides/security-csrf-prevention
type: guide
matches: 1
- title: Enable Basic authentication
url: /guides/security-basic-authentication-howto
type: howto
matches: 1
- title: Getting started with Security by using Basic authentication and Jakarta Persistence
url: /guides/security-getting-started-tutorial
type: tutorial
matches: 1
- title: Getting started with WebSockets-Next
url: /guides/websockets-next-tutorial
type: tutorial
matches: 1
- title: Qute Reference Guide
url: /guides/qute-reference
type: reference
matches: 1
- title: Qute Templating Engine
url: /guides/qute
type: guide
matches: 1
- title: Using WebSockets
url: /guides/websockets
type: guide
matches: 1
- title: WebSockets Next extension reference guide
url: /guides/websockets-next-reference
type: reference
matches: 1
/guides/websockets:
sameTopics:
- title: Getting started with WebSockets-Next
Expand All @@ -19411,6 +19497,10 @@
url: /guides/http-reference
type: reference
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Using Reactive Routes
url: /guides/reactive-routes
type: guide
Expand All @@ -19429,6 +19519,10 @@
url: /guides/http-reference
type: reference
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Using Reactive Routes
url: /guides/reactive-routes
type: guide
Expand All @@ -19452,6 +19546,10 @@
url: /guides/http-reference
type: reference
matches: 1
- title: Quarkus for the Web
url: /guides/web
type: guide
matches: 1
- title: Using Reactive Routes
url: /guides/reactive-routes
type: guide
Expand Down
7 changes: 7 additions & 0 deletions _generated-doc/main/config/quarkus-all-build-items.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,13 @@ a| `JpaSecurityDefinition jpaSecurityDefinition` :: +++<i>No Javadoc found</i>++
a| https://github.com/quarkusio/quarkus/blob/main/extensions/security-jpa-common/deployment/src/main/java/io/quarkus/security/jpa/common/deployment/PanacheEntityPredicateBuildItem.java[`io.quarkus.security.jpa.common.deployment.PanacheEntityPredicateBuildItem`, window="_blank"] :: +++Build item to evaluate whether the class is a Panache model class.+++
a| `Set modelClasses` :: +++<i>No Javadoc found</i>+++
|===
== SmallRye Context Propagation
[%header,cols=2*]
|===
|Class Name |Attributes
a| https://github.com/quarkusio/quarkus/blob/main/extensions/smallrye-context-propagation/deployment/src/main/java/io/quarkus/smallrye/context/deployment/ContextPropagationInitializedBuildItem.java[`io.quarkus.smallrye.context.deployment.ContextPropagationInitializedBuildItem`, window="_blank"] :: +++Marker build item for build ordering. Signifies that CP is set up and ready for use.+++
a| None
|===
== SmallRye Context Propagation - SPI
[%header,cols=2*]
Expand Down
34 changes: 33 additions & 1 deletion _versions/main/guides/http-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ For Servlet support, Quarkus employs a customized Undertow version that operates
When Undertow is present, RESTEasy functions as a Servlet filter.
In its absence, RESTEasy operates directly on Vert.x without involving Servlets.

== Serving Static Resources
== Serving static resources

If you are looking to use Quarkus for a web application, look at the xref:web.adoc[Quarkus for the Web] guide.

=== From the application jar

Expand All @@ -30,6 +32,36 @@ was chosen as it is the standard location for resources in `jar` files as define
Quarkus can be used without Servlet, following this convention allows existing code that places its resources in this
location to function correctly.

[[from-mvnpm]]
=== From mvnpm

If you are using https://mvnpm.org/[mvnpm], as for the following JQuery dependency:

[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
----
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>bootstrap</artifactId>
<version>5.3.3</version>
<scope>runtime</scope>
</dependency>
----

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
runtimeOnly("org.mvnpm:bootstrap:5.3.3")
----

You can import it in your HTML like this:
[source,html]
----
<script src="_static/bootstrap/5.3.3/dist/css/bootstrap.min.css"></script>
----


[[from-webjars]]
=== From WebJars

If you are using webjars, like the following JQuery one:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions _versions/main/guides/javascript/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,15 @@ function makeCollapsibleHandler(descDiv, td, row,
if( isCollapsed ) {
collapsibleSpan.childNodes.item(0).nodeValue = 'Show less';
iconDecoration.classList.replace('fa-chevron-down', 'fa-chevron-up');
descDiv.classList.remove('description-collapsed');
descDiv.classList.add('description-expanded');
}
else {
collapsibleSpan.childNodes.item(0).nodeValue = 'Show more';
iconDecoration.classList.replace('fa-chevron-up', 'fa-chevron-down');
descDiv.classList.add('description-collapsed');
descDiv.classList.remove('description-expanded');
}
descDiv.classList.toggle('description-collapsed');
descDiv.classList.toggle('description-expanded');
row.classList.toggle('row-collapsed');
};
}
Expand Down
55 changes: 39 additions & 16 deletions _versions/main/guides/qute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,70 @@ Clone the Git repository: `git clone {quickstarts-clone-url}`, or download an {q

The solution is located in the `qute-quickstart` link:{quickstarts-tree-url}/qute-quickstart[directory].

== Hello World with Jakarta REST
[[serving-templates]]
== Serving Qute templates via http

If you want to use Qute in your Jakarta REST application, you need to add an extension first:
If you want to serve your templates via http:

1. The Qute Web extension allows you to directly serve via http templates located in `src/main/resource/templates/pub/`. In that case you don't need any Java code to "plug" the template, for example, the template `src/main/resource/templates/pub/foo.html` will be served from the paths `/foo` and `/foo.html` by default.
2. For finer control, you can combine it with Quarkus REST to control how your template will be served. All files located in the `src/main/resources/templates` directory and its subdirectories are registered as templates and can be injected in a REST resource.

* either `quarkus-rest-qute` if you are using Quarkus REST (formerly RESTEasy Reactive):
+
[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-qute</artifactId>
<groupId>io.quarkiverse.qute.web</groupId>
<artifactId>quarkus-qute-web</artifactId>
</dependency>
----
+

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
implementation("io.quarkus:quarkus-rest-qute")
implementation("io.quarkiverse.qute.web:quarkus-qute-web")
----

NOTE: The Qute Web extension while using the quarkiverse group-id, it is still part of the Quarkus platform.

[[hello-qute-web]]
=== Serving Hello World with Qute

Let's start with a Hello World template:

.src/main/resources/templates/pub/hello.html
[source]
----
<h1>Hello {http:param('name', 'Quarkus')}!</h1> <1>
----
<1> `{http:param('name', 'Quarkus')}` is an expression that is evaluated when the template is rendered (Quarkus is the default value).

NOTE: Templates located in the `pub` directory are served via HTTP. Automatically, no controllers needed. For example, the template src/main/resource/templates/pub/foo.html will be served from the paths /foo and /foo.html by default.

If your application is running, you can open your browser and hit: http://localhost:8080/hello?name=Martin

For more information about Qute Web options, see the https://docs.quarkiverse.io/quarkus-qute-web/dev/index.html[Qute Web guide].

[[hello-qute-rest]]
=== Hello Qute and REST

For finer control, you can combine Qute Web with Quarkus REST or Quarkus RESTEasy to control how your template will be served

* or `quarkus-resteasy-qute` if you are using RESTEasy Classic:
+
[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-qute</artifactId>
<artifactId>quarkus-rest</artifactId>
</dependency>
----
+

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
implementation("io.quarkus:quarkus-resteasy-qute")
implementation("io.quarkus:quarkus-rest")
----

We'll start with a very simple template:
A very simple text template:

.hello.txt
[source]
Expand All @@ -73,8 +98,6 @@ Hello {name}! <1>
----
<1> `{name}` is a value expression that is evaluated when the template is rendered.

NOTE: By default, all files located in the `src/main/resources/templates` directory and its subdirectories are registered as templates. Templates are validated during startup and watched for changes in the development mode.

Now let's inject the "compiled" template in the resource class.

.HelloResource.java
Expand Down
Loading

0 comments on commit 11c8f26

Please sign in to comment.