Make "koch docs" copy the dochack.js to the right location too
- Fixes https://github.com/nim-lang/Nim/issues/9104. - Fixes https://github.com/nim-lang/Nim/issues/9095. Expect dochack.js to be fetched from the doc/html/ dir instead of from doc/. Also remove an unused and unexported proc pathPart.
This commit is contained in:
parent
40e01d8549
commit
2e5c759736
6 changed files with 16 additions and 15 deletions
|
|
@ -53,12 +53,9 @@ script:
|
||||||
- nim c -r nimdoc/tester
|
- nim c -r nimdoc/tester
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
# Generate the dochack.js for the doc search to work.
|
|
||||||
- nim js ./tools/dochack/dochack.nim
|
|
||||||
- cp -f ./tools/dochack/nimcache/dochack.js ./doc/.
|
|
||||||
# Make https://nim-lang.github.io/Nim work the same as https://nim-lang.github.io/Nim/overview.html
|
# Make https://nim-lang.github.io/Nim work the same as https://nim-lang.github.io/Nim/overview.html
|
||||||
- cp -f ./doc/html/overview.html ./doc/html/index.html
|
- cp -f ./doc/html/overview.html ./doc/html/index.html
|
||||||
deploy:
|
deploy: # https://nim-lang.github.io/Nim
|
||||||
provider: pages
|
provider: pages
|
||||||
# local-dir *has* to be a relative path from the repo root.
|
# local-dir *has* to be a relative path from the repo root.
|
||||||
local-dir: "doc/html"
|
local-dir: "doc/html"
|
||||||
|
|
|
||||||
|
|
@ -1374,7 +1374,7 @@ span.pragmawrap {
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="../dochack.js"></script>
|
<script type="text/javascript" src="dochack.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function main() {
|
function main() {
|
||||||
|
|
|
||||||
|
|
@ -1199,7 +1199,7 @@ span.pragmawrap {
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="../dochack.js"></script>
|
<script type="text/javascript" src="dochack.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function main() {
|
function main() {
|
||||||
|
|
|
||||||
|
|
@ -1199,7 +1199,7 @@ span.pragmawrap {
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="../dochack.js"></script>
|
<script type="text/javascript" src="dochack.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function main() {
|
function main() {
|
||||||
|
|
|
||||||
|
|
@ -1199,7 +1199,7 @@ span.pragmawrap {
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="../dochack.js"></script>
|
<script type="text/javascript" src="dochack.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function main() {
|
function main() {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@ const
|
||||||
|
|
||||||
nimArgs = "--hint[Conf]:off --hint[Path]:off --hint[Processing]:off -d:boot --putenv:nimversion=$#" % system.NimVersion
|
nimArgs = "--hint[Conf]:off --hint[Path]:off --hint[Processing]:off -d:boot --putenv:nimversion=$#" % system.NimVersion
|
||||||
gitUrl = "https://github.com/nim-lang/Nim"
|
gitUrl = "https://github.com/nim-lang/Nim"
|
||||||
docHtmlOutput = "doc/html"
|
docHtmlOutput = "doc" / "html"
|
||||||
webUploadOutput = "web/upload"
|
webUploadOutput = "web" / "upload"
|
||||||
|
docHackDir = "tools" / "dochack"
|
||||||
|
|
||||||
proc exe*(f: string): string =
|
proc exe*(f: string): string =
|
||||||
result = addFileExt(f, ExeExt)
|
result = addFileExt(f, ExeExt)
|
||||||
|
|
@ -267,8 +268,6 @@ proc buildDocSamples(nimArgs, destPath: string) =
|
||||||
exec(findNim() & " doc $# -o:$# $#" %
|
exec(findNim() & " doc $# -o:$# $#" %
|
||||||
[nimArgs, destPath / "docgen_sample.html", "doc" / "docgen_sample.nim"])
|
[nimArgs, destPath / "docgen_sample.html", "doc" / "docgen_sample.nim"])
|
||||||
|
|
||||||
proc pathPart(d: string): string = splitFile(d).dir.replace('\\', '/')
|
|
||||||
|
|
||||||
proc buildDoc(nimArgs, destPath: string) =
|
proc buildDoc(nimArgs, destPath: string) =
|
||||||
# call nim for the documentation:
|
# call nim for the documentation:
|
||||||
var
|
var
|
||||||
|
|
@ -325,11 +324,15 @@ proc buildPdfDoc*(nimArgs, destPath: string) =
|
||||||
proc buildJS() =
|
proc buildJS() =
|
||||||
exec(findNim() & " js -d:release --out:$1 web/nimblepkglist.nim" %
|
exec(findNim() & " js -d:release --out:$1 web/nimblepkglist.nim" %
|
||||||
[webUploadOutput / "nimblepkglist.js"])
|
[webUploadOutput / "nimblepkglist.js"])
|
||||||
exec(findNim() & " js tools/dochack/dochack.nim")
|
exec(findNim() & " js " & (docHackDir / "dochack.nim"))
|
||||||
|
|
||||||
proc buildDocs*(args: string) =
|
proc buildDocs*(args: string) =
|
||||||
let a = nimArgs & " " & args
|
let
|
||||||
buildJS()
|
a = nimArgs & " " & args
|
||||||
|
docHackJs = "dochack.js"
|
||||||
|
docHackJsSource = docHackDir / "nimcache" / docHackJs
|
||||||
|
docHackJsDest = docHtmlOutput / docHackJs
|
||||||
|
buildJS() # This call generates docHackJsSource
|
||||||
let docup = webUploadOutput / NimVersion
|
let docup = webUploadOutput / NimVersion
|
||||||
createDir(docup)
|
createDir(docup)
|
||||||
buildDocSamples(a, docup)
|
buildDocSamples(a, docup)
|
||||||
|
|
@ -340,3 +343,4 @@ proc buildDocs*(args: string) =
|
||||||
createDir(docHtmlOutput)
|
createDir(docHtmlOutput)
|
||||||
buildDocSamples(nimArgs, docHtmlOutput)
|
buildDocSamples(nimArgs, docHtmlOutput)
|
||||||
buildDoc(nimArgs, docHtmlOutput)
|
buildDoc(nimArgs, docHtmlOutput)
|
||||||
|
copyFileWithPermissions(docHackJsSource, docHackJsDest)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue