forked from stride3d/stride-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jp-build.ps1
47 lines (43 loc) · 1.12 KB
/
jp-build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Start-Transcript -Path build.log
Write-Host "Start building Japanese documentation."
If(Test-Path jp_tmp){
Remove-Item jp_tmp/* -recurse
}
Else{
New-Item -Path 'jp_tmp' -ItemType "directory"
}
Copy-Item en/* -Recurse jp_tmp -Force
$posts = Get-ChildItem jp_tmp/manual/*.md -Recurse -Force
Write-Host "Start write files:"
Foreach ($post in $posts)
{
if($post.ToString().Contains("toc.md")) {
continue;
}
$data = Get-Content $post
$i = 0;
Foreach ($line in $data)
{
$i++
if ($line.length -le 0)
{
Write-Host $post
$data[$i-1]="<div class='doc-no-translated'/>"
$data | out-file $post
break
}
}
}
Write-Host "End write files"
Copy-Item jp/manual -Recurse jp_tmp -Force
Copy-Item en/docfx.json jp_tmp -Force
(Get-Content jp_tmp/docfx.json) -replace "_site/en","_site/jp" | Set-Content jp_tmp/docfx.json
deps\docfx\docfx.exe build jp_tmp\docfx.json
Remove-Item jp_tmp -recurse
if ($LastExitCode -ne 0)
{
Write-Host "Failed to build doc"
exit $LastExitCode
}
Write-Host "Japanese documentation built."
Stop-Transcript