Skip to content

Commit

Permalink
docs: revise URL structure (libraries) part 2 (#4432)
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru authored Oct 4, 2024
1 parent 0d0d29f commit e30cdd7
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 7 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/link-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Link Validator

on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'

permissions:
contents: read

jobs:
validate-links:
runs-on: ubuntu-22.04
if: github.event.repository.fork == false
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with: # https://github.com/olafurpg/setup-scala#faster-checkout-of-big-repos
fetch-depth: 100
fetch-tags: true

- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.5
uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d

- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.5
uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f
with:
jvm: temurin:1.11
apps: cs

- name: sbt site
run: sbt docs/paradox

- name: Run Link Validator
run: cs launch net.runne::site-link-validator:0.2.5 -- scripts/link-validator.conf
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inThisBuild(Def.settings(
val tagOrBranch =
if (isSnapshot.value) "main"
else "v" + version.value
Seq(("BUSL-1.1", url(s"https://raw.githubusercontent.com/akka/akka-http/${tagOrBranch}/LICENSE")))
Seq(("BUSL-1.1", url(s"https://github.com/akka/akka-http/blob/${tagOrBranch}/LICENSE.txt")))
},
description := "Akka Http: Modern, fast, asynchronous, streaming-first HTTP server and client.",
testOptions ++= Seq(
Expand Down Expand Up @@ -512,7 +512,7 @@ lazy val docs = project("docs")
apidocRootPackage := "akka",
Formatting.docFormatSettings,
ThisBuild / publishRsyncHost := "akkarepo@gustav.akka.io",
publishRsyncArtifacts := List((Compile / paradox).value -> gustavDir("docs").value),
publishRsyncArtifacts := List((Compile / paradox).value -> gustavDir("libraries").value),
)
.settings(ParadoxSupport.paradoxWithCustomDirectives)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ agent has been dropped in 10.2.0. HTTP/2 support therefore now requires to be ru

The Scalatest dependency for akka-http-testkit was upgraded to version 3.1.0. This version is incompatible with previous
versions. This is relevant for user code if it uses methods from @scaladoc[ScalatestUtils](akka.http.scaladsl.testkit.ScalatestUtils)
(which are in scope if your test extends from @scaladoc[ScalaTestRouteTest](akka.http.scaladsl.testkit.ScalaTestRouteTest)).
(which are in scope if your test extends from @scaladoc[ScalatestRouteTest](akka.http.scaladsl.testkit.ScalatestRouteTest)).
In this case, the project itself needs to be updated to use Scalatest >= 3.1.0.

### Providing route settings, exception and rejection handling
Expand Down Expand Up @@ -222,7 +222,7 @@ server connections you should create a @apidoc[HttpsConnectionContext] with
the relevant configuration.

Previously, the SSL configuration was constructed based on the parameters
you pass to @apidoc[HttpsConnectionContext$] and the logic and configuration
you pass to @apidoc[HttpsConnectionContext] and the logic and configuration
used by the [ssl-config](https://lightbend.github.io/ssl-config/) library. This was
because back then the default JDK SSL configuration was a bad match for HTTP
connections. Nowadays, however, the JDK defaults are much better and the
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/quickstart-scala/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Akka HTTP example for Scala is a zipped project that includes a sbt build fi
* On Linux and MacOS systems, open a terminal and use the command `unzip` akka-quickstart-scala.zip.
* On Windows, use a tool such as File Explorer to extract the project.

Alternatively, you can bootstrap a new project with Akka HTTP already configured using the [Giter8](http://www.foundweekends.org/giter8/) template directly via sbt:
Alternatively, you can bootstrap a new project with Akka HTTP already configured using the [Giter8](https://www.foundweekends.org/giter8/) template directly via sbt:

```sh
sbt new akka/akka-http-quickstart-scala.g8
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/paradox/routing-dsl/testkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To use Akka HTTP TestKit, add the module to your project:
@@@ div { .group-scala }

Here is an example of what a simple test with the routing testkit might look like using the built-in support for
[scalatest](http://www.scalatest.org) and [specs2](http://etorreborre.github.io/specs2/):
[scalatest](https://www.scalatest.org) and [specs2](https://etorreborre.github.io/specs2/):

ScalaTest
: @@snip [FullTestKitExampleSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/FullTestKitExampleSpec.scala) { #source-quote }
Expand All @@ -58,7 +58,7 @@ route structure defined in your service.
The final element of the `~>` chain is a `check` call, which takes a block of assertions as parameter. In this block
you define your requirements onto the result produced by your route after having processed the given request. Typically
you use one of the defined "inspectors" to retrieve a particular element of the routes response and express assertions
against it using the test DSL provided by your test framework. For example, with [scalatest](http://www.scalatest.org), in order to verify that
against it using the test DSL provided by your test framework. For example, with [scalatest](https://www.scalatest.org), in order to verify that
your route responds to the request with a status 200 response, you'd use the `status` inspector and express an
assertion like this:

Expand Down
37 changes: 37 additions & 0 deletions scripts/link-validator.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// config for https://github.com/ennru/site-link-validator/
site-link-validator {
root-dir = "docs/target/paradox/site/main/"
# relative to `root-dir`
start-file = "index.html"

# Resolves URLs with the given prefix as local files instead
link-mappings = [
{
prefix = "https://doc.akka.io/libraries/akka-http/snapshot/"
replace = "/"
}
{
prefix = "https://doc.akka.io/api/akka-http/snapshot/"
replace = "/api/akka-http/snapshot/"
}
]

ignore-missing-local-files-regex = ""

ignore-prefixes = [
"https://repo.akka.io/maven"
"https://repo.akka.io/snapshots"
# GitHub will block with "429 Too Many Requests"
"https://github.com/"
# MVN repository forbids access after a few requests
"https://mvnrepository.com/artifact/"
"http://localhost:"
"http://example.com"
]

ignore-files = []

non-https-whitelist = [
"http://restclient.net/"
]
}

0 comments on commit e30cdd7

Please sign in to comment.