From 8252ee601fb6afc10829381826c829e90218498b Mon Sep 17 00:00:00 2001 From: Julien Richard-Foy Date: Fri, 6 May 2022 13:19:38 +0200 Subject: [PATCH 1/7] Add redirections from old URLs to avoid breakages (#15118) * Add redirections from old URLs to avoid breakages The Scala 3 reference documentation that used to be published to https://docs.scala-lang.org was using some different URLs than the URLs used by the documentation produced by Scaladoc. You can see here some examples of breakages: https://github.com/scala/docs.scala-lang/pull/2391/commits/763d51842a16cf2398087a4a1af3c914fbbd8179 We add redirects from previously supported URLs to avoid such breakages in case there are links in the web that point to the old URLs. --- .../{other-new-types.md => other-new-features.md} | 0 docs/sidebar.yml | 2 +- project/Build.scala | 12 ++++++++++++ project/resources/referenceReplacements/sidebar.yml | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) rename docs/_docs/reference/other-new-features/{other-new-types.md => other-new-features.md} (100%) diff --git a/docs/_docs/reference/other-new-features/other-new-types.md b/docs/_docs/reference/other-new-features/other-new-features.md similarity index 100% rename from docs/_docs/reference/other-new-features/other-new-types.md rename to docs/_docs/reference/other-new-features/other-new-features.md diff --git a/docs/sidebar.yml b/docs/sidebar.yml index 95786121e8f4..e3d496822003 100644 --- a/docs/sidebar.yml +++ b/docs/sidebar.yml @@ -69,7 +69,7 @@ subsection: - page: reference/metaprogramming/reflection.md - page: reference/metaprogramming/tasty-inspect.md - title: Other New Features - index: reference/other-new-features/other-new-types.md + index: reference/other-new-features/other-new-features.md subsection: - page: reference/other-new-features/trait-parameters.md - page: reference/other-new-features/transparent-traits.md diff --git a/project/Build.scala b/project/Build.scala index a581cd26aa38..16f45f50befb 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1381,21 +1381,33 @@ object Build { generateDocumentation(Testcases) }.value, + // Generate the Scala 3 reference documentation (published at https://docs.scala-lang.org/scala3/reference) generateReferenceDocumentation := Def.inputTaskDyn { val shouldRegenerateExpectedLinks = (Space ~> literal("--no-regenerate-expected-links")).?.parsed.isEmpty generateStaticAssetsTask.value + // Move all the source files to a temporary directory and apply some changes specific to the reference documentation val temp = IO.createTemporaryDirectory IO.copyDirectory(file("docs"), temp / "docs") IO.delete(temp / "docs" / "_blog") + // Overwrite the main layout and the sidebar IO.copyDirectory( file("project") / "resources" / "referenceReplacements", temp / "docs", overwrite = true ) + // Add redirections from previously supported URLs, for some pages + for (name <- Seq("changed-features", "contextual", "dropped-features", "metaprogramming", "other-new-features")) { + val path = temp / "docs" / "_docs" / "reference" / name / s"${name}.md" + val contentLines = IO.read(path).linesIterator.to[collection.mutable.ArrayBuffer] + contentLines.insert(1, s"redirectFrom: /${name}.html") // Add redirection + val newContent = contentLines.mkString("\n") + IO.write(path, newContent) + } + val languageReferenceConfig = Def.task { Scala3.value .add(OutputDir("scaladoc/output/reference")) diff --git a/project/resources/referenceReplacements/sidebar.yml b/project/resources/referenceReplacements/sidebar.yml index 680b44d353d4..a9a4d23c869f 100644 --- a/project/resources/referenceReplacements/sidebar.yml +++ b/project/resources/referenceReplacements/sidebar.yml @@ -49,7 +49,7 @@ subsection: - page: reference/metaprogramming/reflection.md - page: reference/metaprogramming/tasty-inspect.md - title: Other New Features - index: reference/other-new-features/other-new-types.md + index: reference/other-new-features/other-new-features.md subsection: - page: reference/other-new-features/trait-parameters.md - page: reference/other-new-features/transparent-traits.md From 87c3ce42cee223bd1dfb0cb6f2bd9e3aebe43b34 Mon Sep 17 00:00:00 2001 From: Julien Richard-Foy Date: Fri, 6 May 2022 13:40:37 +0200 Subject: [PATCH 2/7] Regenerate the expected URLs --- .../reference-expected-links.txt | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/project/scripts/expected-links/reference-expected-links.txt b/project/scripts/expected-links/reference-expected-links.txt index f51727b7b432..3e6c027e64be 100644 --- a/project/scripts/expected-links/reference-expected-links.txt +++ b/project/scripts/expected-links/reference-expected-links.txt @@ -1,8 +1,9 @@ ./changed-features/compiler-plugins.html -./changed-features/eta-expansion-spec.html ./changed-features/eta-expansion.html -./changed-features/implicit-conversions-spec.html +./changed-features/eta-expansion-spec.html +./changed-features.html ./changed-features/implicit-conversions.html +./changed-features/implicit-conversions-spec.html ./changed-features/implicit-resolution.html ./changed-features/imports.html ./changed-features/index.html @@ -14,22 +15,23 @@ ./changed-features/overload-resolution.html ./changed-features/pattern-bindings.html ./changed-features/pattern-matching.html -./changed-features/structural-types-spec.html ./changed-features/structural-types.html +./changed-features/structural-types-spec.html ./changed-features/type-checking.html ./changed-features/type-inference.html ./changed-features/vararg-splices.html ./changed-features/wildcards.html ./contextual/by-name-context-parameters.html ./contextual/context-bounds.html -./contextual/context-functions-spec.html ./contextual/context-functions.html +./contextual/context-functions-spec.html ./contextual/conversions.html -./contextual/derivation-macro.html ./contextual/derivation.html +./contextual/derivation-macro.html ./contextual/extension-methods.html ./contextual/given-imports.html ./contextual/givens.html +./contextual.html ./contextual/index.html ./contextual/multiversal-equality.html ./contextual/relationship-implicits.html @@ -39,12 +41,13 @@ ./docs/reference/other-new-features/named-typeargs.html ./docsScalaLangResources/scaladoc-assets.html ./dropped-features/auto-apply.html -./dropped-features/class-shadowing-spec.html ./dropped-features/class-shadowing.html +./dropped-features/class-shadowing-spec.html ./dropped-features/delayed-init.html ./dropped-features/do-while.html ./dropped-features/early-initializers.html ./dropped-features/existential-types.html +./dropped-features.html ./dropped-features/index.html ./dropped-features/limit22.html ./dropped-features/macros.html @@ -54,8 +57,8 @@ ./dropped-features/symlits.html ./dropped-features/this-qualifier.html ./dropped-features/type-projection.html -./dropped-features/weak-conformance-spec.html ./dropped-features/weak-conformance.html +./dropped-features/weak-conformance-spec.html ./dropped-features/wildcard-init.html ./dropped-features/xml.html ./enums/adts.html @@ -64,13 +67,13 @@ ./enums/index.html ./experimental/canthrow.html ./experimental/cc.html -./experimental/erased-defs-spec.html ./experimental/erased-defs.html +./experimental/erased-defs-spec.html ./experimental/explicit-nulls.html ./experimental/index.html ./experimental/main-annotation.html -./experimental/named-typeargs-spec.html ./experimental/named-typeargs.html +./experimental/named-typeargs-spec.html ./experimental/numeric-literals.html ./experimental/overview.html ./features-classification.html @@ -79,28 +82,30 @@ ./language-versions/index.html ./language-versions/source-compatibility.html ./metaprogramming/compiletime-ops.html +./metaprogramming.html ./metaprogramming/index.html ./metaprogramming/inline.html -./metaprogramming/macros-spec.html ./metaprogramming/macros.html +./metaprogramming/macros-spec.html ./metaprogramming/reflection.html ./metaprogramming/staging.html ./metaprogramming/tasty-inspect.html -./new-types/dependent-function-types-spec.html ./new-types/dependent-function-types.html +./new-types/dependent-function-types-spec.html ./new-types/index.html -./new-types/intersection-types-spec.html ./new-types/intersection-types.html +./new-types/intersection-types-spec.html ./new-types/match-types.html ./new-types/polymorphic-function-types.html -./new-types/type-lambdas-spec.html ./new-types/type-lambdas.html -./new-types/union-types-spec.html +./new-types/type-lambdas-spec.html ./new-types/union-types.html +./new-types/union-types-spec.html ./other-new-features/control-syntax.html ./other-new-features/creator-applications.html ./other-new-features/experimental-defs.html ./other-new-features/export.html +./other-new-features.html ./other-new-features/indentation.html ./other-new-features/index.html ./other-new-features/kind-polymorphism.html @@ -108,8 +113,8 @@ ./other-new-features/opaques-details.html ./other-new-features/opaques.html ./other-new-features/open-classes.html -./other-new-features/parameter-untupling-spec.html ./other-new-features/parameter-untupling.html +./other-new-features/parameter-untupling-spec.html ./other-new-features/safe-initialization.html ./other-new-features/targetName.html ./other-new-features/threadUnsafe-annotation.html From 63b838a1f3e3b75430b95ca1ca2832a445de5a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Zyba=C5=82a?= Date: Fri, 6 May 2022 09:44:20 +0200 Subject: [PATCH 3/7] Remove blank line at the end of Jekyll warning --- scaladoc/src/dotty/tools/scaladoc/DocContext.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaladoc/src/dotty/tools/scaladoc/DocContext.scala b/scaladoc/src/dotty/tools/scaladoc/DocContext.scala index 366b5b8c162c..cf43b31ce6ec 100644 --- a/scaladoc/src/dotty/tools/scaladoc/DocContext.scala +++ b/scaladoc/src/dotty/tools/scaladoc/DocContext.scala @@ -105,5 +105,5 @@ case class DocContext(args: Scaladoc.Args, compilerContext: CompilerContext): report.warning( s"""Following generated file paths might not be compatible with Jekyll: |${jekyllIncompatLinks.mkString("\n")} - |If using GitHub Pages consider adding a \".nojekyll\" file. - """.stripMargin)(using compilerContext) + |If using GitHub Pages consider adding a \".nojekyll\" file.""".stripMargin + )(using compilerContext) From 93b300fe46b3fd6376bf162747ec180cd03afb6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Zyba=C5=82a?= Date: Fri, 6 May 2022 09:45:09 +0200 Subject: [PATCH 4/7] Replace occurrences of master to main. Fix Edit button --- .../src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala | 2 +- scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala index 3a5d47c8f46c..10e95046d220 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala @@ -223,7 +223,7 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do footer( div(id := "generated-by")( span(cls := "footer-text")(raw("Generated by")), - a(href := "https://github.com/lampepfl/dotty/tree/master/scaladoc")( + a(href := "https://github.com/lampepfl/dotty/tree/main/scaladoc")( img( src := resolveRoot(link.dri, "images/scaladoc_logo.svg"), alt := "scaladoc", diff --git a/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala b/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala index 659409f2ef67..16bbd9c97905 100644 --- a/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala +++ b/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala @@ -42,12 +42,12 @@ case class LoadedTemplate( val subpages = children.filterNot(_.hidden).map(_.lazyTemplateProperties(ctx)) def getMap(key: String) = templateFile.settings.getOrElse(key, Map.empty).asInstanceOf[Map[String, Object]] - val sourceLinks = if !file.exists() then Nil else + val sourceLinks = if !templateFile.file.exists() then Nil else // TODO (https://github.com/lampepfl/scala3doc/issues/240): configure source root // toRealPath is used to turn symlinks into proper paths - val actualPath = Paths.get("").toAbsolutePath.relativize(file.toPath.toRealPath()) + val actualPath = Paths.get("").toAbsolutePath.relativize(templateFile.file.toPath.toRealPath()) ctx.sourceLinks.pathTo(actualPath).map("viewSource" -> _ ) ++ - ctx.sourceLinks.pathTo(actualPath, operation = "edit", optionalRevision = Some("master")).map("editSource" -> _) + ctx.sourceLinks.pathTo(actualPath, operation = "edit").map("editSource" -> _) val updatedSettings = templateFile.settings ++ ctx.projectWideProperties + ("site" -> (getMap("site") + ("subpages" -> subpages))) + ("urls" -> sourceLinks.toMap) + From 6a3f467a9b74f210c8ba1e327ea7f5552c0c0022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Zyba=C5=82a?= Date: Fri, 6 May 2022 11:41:00 +0200 Subject: [PATCH 5/7] Try relative and absolute path in PathBased --- project/Build.scala | 2 +- scaladoc/src/dotty/tools/scaladoc/PathBased.scala | 10 ++++++---- .../src/dotty/tools/scaladoc/site/LoadedTemplate.scala | 4 +--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 16f45f50befb..c15a56fa7ec5 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1416,7 +1416,7 @@ object Build { .add(ProjectVersion("3.1.2")) // TODO: Change that later to the current version tag. (This must happen on first forward this branch to stable release tag) .remove[VersionsDictionaryUrl] .add(SourceLinks(List( - dottySrcLink(referenceVersion, temp.getAbsolutePath + "=") + dottySrcLink("language-reference-stable", temp.getAbsolutePath + "=") ))) .withTargets(List("___fake___.scala")) } diff --git a/scaladoc/src/dotty/tools/scaladoc/PathBased.scala b/scaladoc/src/dotty/tools/scaladoc/PathBased.scala index ab73fc683846..5e24623b43d5 100644 --- a/scaladoc/src/dotty/tools/scaladoc/PathBased.scala +++ b/scaladoc/src/dotty/tools/scaladoc/PathBased.scala @@ -4,10 +4,12 @@ import java.nio.file.{Path, Paths} case class PathBased[T](entries: List[PathBased.Entry[T]], projectRoot: Path): def get(path: Path): Option[PathBased.Result[T]] = - if path.isAbsolute && path.startsWith(projectRoot) then get(projectRoot.relativize(path)) - else entries.filter(_.path.forall(p => path.startsWith(p))).maxByOption(_.path.map(_.toString.length)).map(entry => - PathBased.Result(entry.path.fold(path)(_.relativize(path)), entry.elem) - ) + val paths = Option.when(path.isAbsolute && path.startsWith(projectRoot))(projectRoot.relativize(path)).toSeq :+ path + paths.iterator.to(LazyList).flatMap { path => + entries.filter(_.path.forall(p => path.startsWith(p))).maxByOption(_.path.map(_.toString.length)).map(entry => + PathBased.Result(entry.path.fold(path)(_.relativize(path)), entry.elem) + ) + }.headOption trait ArgParser[T]: def parse(s: String): Either[String, T] diff --git a/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala b/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala index 16bbd9c97905..fd5e50b2acba 100644 --- a/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala +++ b/scaladoc/src/dotty/tools/scaladoc/site/LoadedTemplate.scala @@ -43,9 +43,7 @@ case class LoadedTemplate( def getMap(key: String) = templateFile.settings.getOrElse(key, Map.empty).asInstanceOf[Map[String, Object]] val sourceLinks = if !templateFile.file.exists() then Nil else - // TODO (https://github.com/lampepfl/scala3doc/issues/240): configure source root - // toRealPath is used to turn symlinks into proper paths - val actualPath = Paths.get("").toAbsolutePath.relativize(templateFile.file.toPath.toRealPath()) + val actualPath = templateFile.file.toPath ctx.sourceLinks.pathTo(actualPath).map("viewSource" -> _ ) ++ ctx.sourceLinks.pathTo(actualPath, operation = "edit").map("editSource" -> _) From f570c07d3b7a663340ee7d11dc24629bc313078c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Zyba=C5=82a?= Date: Fri, 6 May 2022 13:47:53 +0200 Subject: [PATCH 6/7] Remove hardcoded ref from CI --- .github/workflows/language-reference.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/language-reference.yaml b/.github/workflows/language-reference.yaml index d99e05c70abc..6aeb174738a2 100644 --- a/.github/workflows/language-reference.yaml +++ b/.github/workflows/language-reference.yaml @@ -21,7 +21,6 @@ jobs: uses: actions/checkout@v3 with: path: 'dotty' - ref: 'language-reference-stable' fetch-depth: 0 ssh-key: ${{ secrets.DOCS_KEY }} From df354ddc863961cba075840e598ba1a9082e7722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Zyba=C5=82a?= Date: Fri, 6 May 2022 14:19:22 +0200 Subject: [PATCH 7/7] Regenerate links and set collation order in sort command --- project/scripts/docsLinksStability | 2 +- .../reference-expected-links.txt | 40 +++++++++---------- project/scripts/regenerateExpectedLinks | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/project/scripts/docsLinksStability b/project/scripts/docsLinksStability index 911f1974febf..1d57bc0a58fa 100755 --- a/project/scripts/docsLinksStability +++ b/project/scripts/docsLinksStability @@ -9,7 +9,7 @@ EXPECTED_LINKS_FILE=$2 # The location of expected-links.txt is passed as a secon pushd $DOCS_DIR > /dev/null # Go to docs dir but remember previous location # We need to go to docs dir to make find return correct relative paths -find . -type f -name "*.html" | sort | (popd > /dev/null; diff $EXPECTED_LINKS_FILE -;) +find . -type f -name "*.html" | LC_ALL=C sort | (popd > /dev/null; diff $EXPECTED_LINKS_FILE -;) # We list every html file in documentation, then sort it and finally compare to the expected links list. # Before running diff we need to popd to return to the previous location because we don't have relative path to the expected links file. diff --git a/project/scripts/expected-links/reference-expected-links.txt b/project/scripts/expected-links/reference-expected-links.txt index 3e6c027e64be..2e4236586c07 100644 --- a/project/scripts/expected-links/reference-expected-links.txt +++ b/project/scripts/expected-links/reference-expected-links.txt @@ -1,9 +1,9 @@ +./changed-features.html ./changed-features/compiler-plugins.html -./changed-features/eta-expansion.html ./changed-features/eta-expansion-spec.html -./changed-features.html -./changed-features/implicit-conversions.html +./changed-features/eta-expansion.html ./changed-features/implicit-conversions-spec.html +./changed-features/implicit-conversions.html ./changed-features/implicit-resolution.html ./changed-features/imports.html ./changed-features/index.html @@ -15,23 +15,23 @@ ./changed-features/overload-resolution.html ./changed-features/pattern-bindings.html ./changed-features/pattern-matching.html -./changed-features/structural-types.html ./changed-features/structural-types-spec.html +./changed-features/structural-types.html ./changed-features/type-checking.html ./changed-features/type-inference.html ./changed-features/vararg-splices.html ./changed-features/wildcards.html +./contextual.html ./contextual/by-name-context-parameters.html ./contextual/context-bounds.html -./contextual/context-functions.html ./contextual/context-functions-spec.html +./contextual/context-functions.html ./contextual/conversions.html -./contextual/derivation.html ./contextual/derivation-macro.html +./contextual/derivation.html ./contextual/extension-methods.html ./contextual/given-imports.html ./contextual/givens.html -./contextual.html ./contextual/index.html ./contextual/multiversal-equality.html ./contextual/relationship-implicits.html @@ -40,14 +40,14 @@ ./contextual/using-clauses.html ./docs/reference/other-new-features/named-typeargs.html ./docsScalaLangResources/scaladoc-assets.html +./dropped-features.html ./dropped-features/auto-apply.html -./dropped-features/class-shadowing.html ./dropped-features/class-shadowing-spec.html +./dropped-features/class-shadowing.html ./dropped-features/delayed-init.html ./dropped-features/do-while.html ./dropped-features/early-initializers.html ./dropped-features/existential-types.html -./dropped-features.html ./dropped-features/index.html ./dropped-features/limit22.html ./dropped-features/macros.html @@ -57,8 +57,8 @@ ./dropped-features/symlits.html ./dropped-features/this-qualifier.html ./dropped-features/type-projection.html -./dropped-features/weak-conformance.html ./dropped-features/weak-conformance-spec.html +./dropped-features/weak-conformance.html ./dropped-features/wildcard-init.html ./dropped-features/xml.html ./enums/adts.html @@ -67,13 +67,13 @@ ./enums/index.html ./experimental/canthrow.html ./experimental/cc.html -./experimental/erased-defs.html ./experimental/erased-defs-spec.html +./experimental/erased-defs.html ./experimental/explicit-nulls.html ./experimental/index.html ./experimental/main-annotation.html -./experimental/named-typeargs.html ./experimental/named-typeargs-spec.html +./experimental/named-typeargs.html ./experimental/numeric-literals.html ./experimental/overview.html ./features-classification.html @@ -81,31 +81,31 @@ ./language-versions/binary-compatibility.html ./language-versions/index.html ./language-versions/source-compatibility.html -./metaprogramming/compiletime-ops.html ./metaprogramming.html +./metaprogramming/compiletime-ops.html ./metaprogramming/index.html ./metaprogramming/inline.html -./metaprogramming/macros.html ./metaprogramming/macros-spec.html +./metaprogramming/macros.html ./metaprogramming/reflection.html ./metaprogramming/staging.html ./metaprogramming/tasty-inspect.html -./new-types/dependent-function-types.html ./new-types/dependent-function-types-spec.html +./new-types/dependent-function-types.html ./new-types/index.html -./new-types/intersection-types.html ./new-types/intersection-types-spec.html +./new-types/intersection-types.html ./new-types/match-types.html ./new-types/polymorphic-function-types.html -./new-types/type-lambdas.html ./new-types/type-lambdas-spec.html -./new-types/union-types.html +./new-types/type-lambdas.html ./new-types/union-types-spec.html +./new-types/union-types.html +./other-new-features.html ./other-new-features/control-syntax.html ./other-new-features/creator-applications.html ./other-new-features/experimental-defs.html ./other-new-features/export.html -./other-new-features.html ./other-new-features/indentation.html ./other-new-features/index.html ./other-new-features/kind-polymorphism.html @@ -113,8 +113,8 @@ ./other-new-features/opaques-details.html ./other-new-features/opaques.html ./other-new-features/open-classes.html -./other-new-features/parameter-untupling.html ./other-new-features/parameter-untupling-spec.html +./other-new-features/parameter-untupling.html ./other-new-features/safe-initialization.html ./other-new-features/targetName.html ./other-new-features/threadUnsafe-annotation.html diff --git a/project/scripts/regenerateExpectedLinks b/project/scripts/regenerateExpectedLinks index 95369f826e54..6ef3cd6adeaf 100755 --- a/project/scripts/regenerateExpectedLinks +++ b/project/scripts/regenerateExpectedLinks @@ -9,7 +9,7 @@ EXPECTED_LINKS_FILE=$2 # The location of expected-links.txt is passed as a secon pushd $DOCS_DIR > /dev/null # Go to docs dir but remember previous location # We need to go to docs dir to make find return correct relative paths -find . -type f -name "*.html" | (popd > /dev/null; sort > $2;) +find . -type f -name "*.html" | (popd > /dev/null; LC_ALL=C sort > $2;) # We list every html file in documentation, then sort it and finally write it to the expected links list file. # Before writing we need to popd to return to the previous location because we don't have relative path to the expected links file.