File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed
builds/kotlinlang/buidTypes Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ import jetbrains.buildServer.configs.kotlin.BuildType
5
5
import jetbrains.buildServer.configs.kotlin.*
6
6
import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
7
7
import jetbrains.buildServer.configs.kotlin.buildSteps.script
8
+ import java.io.File
9
+ import java.nio.file.Paths
10
+
11
+ private fun readScript (name : String ): String {
12
+ val file = File (Paths .get(" scripts/$name .mjs" ).toAbsolutePath().toString())
13
+ return file.readText()
14
+ }
8
15
9
16
object BuildReferenceDocs : BuildType({
10
17
name = " Reference Docs"
@@ -35,6 +42,21 @@ object BuildReferenceDocs : BuildType({
35
42
dockerImage = " alpine"
36
43
dockerImagePlatform = ScriptBuildStep .ImagePlatform .Linux
37
44
}
45
+
46
+ script {
47
+ name = " Prepare page views"
48
+ scriptContent = """
49
+ #!/usr/bin/env bash
50
+ npm i cheerio
51
+
52
+ ":" //# comment; exec /usr/bin/env node --input-type=module - "${' $' } @" < "${' $' } 0"
53
+
54
+ ${readScript(" fix-wrs/index" )}
55
+ """ .trimIndent()
56
+ dockerImage = " node:22-slim"
57
+ dockerImagePlatform = ScriptBuildStep .ImagePlatform .Linux
58
+ dockerPull = true
59
+ }
38
60
}
39
61
40
62
dependencies {
Original file line number Diff line number Diff line change
1
+ import { load } from 'cheerio' ;
2
+ import { readFile , writeFile } from 'node:fs/promises' ;
3
+ import { join , resolve } from 'node:path' ;
4
+
5
+ const ROOT_DIR = resolve ( '.' ) ;
6
+ const DATA_DIR = join ( ROOT_DIR , 'kr.tree' ) ;
7
+
8
+ const text = ( await readFile ( DATA_DIR ) ) ;
9
+ const $ = await load ( text , { xml : true } ) ;
10
+
11
+ const ids = ( await $ ( 'toc-element[hidden="true"]' ) )
12
+ . map ( ( i , e ) => $ ( e ) . attr ( 'id' ) ) . get ( ) ;
13
+
14
+ const dels = ids
15
+ . map ( async id => {
16
+ const file = `${ ROOT_DIR } /pages/${ id . replace ( / .m d $ / g, '.html' ) } ` ;
17
+ const text = await readFile ( file ) ;
18
+ const patched = text . toString ( ) . replace ( / ( < h e a d > ) / g, '$1<meta name="robots" content="noindex">' ) ;
19
+ console . log ( 'exclude' , file ) ;
20
+ await writeFile ( file , patched ) ;
21
+ } ) ;
22
+
23
+ await Promise . all ( dels ) ;
Original file line number Diff line number Diff line change 51
51
<toc-element toc-title =" Language features and proposals" topic =" kotlin-language-features-and-proposals.md" />
52
52
<toc-element toc-title =" Language evolution principles" accepts-web-file-names =" kotlin-evolution.html" topic =" kotlin-evolution-principles.md" />
53
53
<toc-element topic =" components-stability.md" />
54
- <toc-element hidden =" true" topic =" components-stability-pre-1. 4.md" />
54
+ <toc-element hidden =" true" topic =" components-stability-pre-1- 4.md" />
55
55
<toc-element accepts-web-file-names =" plugin-releases.html" topic =" releases.md" />
56
56
</toc-element >
57
57
<toc-element toc-title =" Basics" >
You can’t perform that action at this time.
0 commit comments