swiftlang / swift-docc

Documentation compiler that produces rich API reference documentation and interactive tutorials for your Swift framework or package.
https://swift.org/documentation/docc
Apache License 2.0
1.17k stars 123 forks source link

Error when publishing to GitHub Pages #820

Open leif-ibsen opened 7 months ago

leif-ibsen commented 7 months ago

Description

The problem is described in issue #808.

Please, see my last comment from 8. of february in that issue.

Checklist

Expected Behavior

The bug is documented and can be reproduced at this location:

https://leif-ibsen.github.io/DocCTest/documentation/docctest

Actual behavior

Steps To Reproduce

The bug is documented and can be reproduced at this location:

https://leif-ibsen.github.io/DocCTest/documentation/docctest

Swift-DocC Version Information

No response

Swift Compiler Version Information

No response

leif-ibsen commented 7 months ago

I tried to use the new toolchain

swift-DEVELOPMENT-SNAPSHOT-2024-02-12-a.xctoolchain

to build the DocCTest documentation for GitHub Pages. I still get

The page you're looking for can't be found.

messages when looking at the generated documentation, as you will see if you click

https://leif-ibsen.github.io/DocCTest/documentation/docctest

There were no errors during the build but many warnings like

objc[1311]: Class _TtCC11swiftASTGen13SourceManager21MacroExpansionContext is implemented in both 
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-02-12-a.xctoolchain/usr/lib/swift/host/lib_InternalSwiftScan.dylib (0x142dd02d0) 
and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/lib_InternalSwiftScan.dylib (0x111ea8c00). 
One of the two will be used. Which one is undefined.
leif-ibsen commented 7 months ago

The error occurs when you click the following operators:

/ /= % %= < <= > >= << <<= >> >>= | |= ^ ^= ~

The following operators work ok:

leif-ibsen commented 6 months ago

The bug is documented and can be reproduced at this location:

https://leif-ibsen.github.io/DocCTest/documentation/docctest

The DocCTest source code is here:

https://github.com/leif-ibsen/DocCTest

d-ronnqvist commented 6 months ago

I don't know how I can reproduce this.

If I build documentation for that repo with the Xcode 15.3 release build I can view all those pages. At first I thought that it could be an issue with the static hosting files being different but if I locally serve the built documentation with python3 -m http.server 8080 I can still browse all those pages.

leif-ibsen commented 6 months ago

If I preview the documentation (using Xcode 15.3) with the command

swift package --disable-sandbox preview-documentation --target DocCTest

everything work okay. I can see all the pages locally on my computer.

However, if I build for GitHub Pages (also using Xcode 15.3) with the command

swift package --allow-writing-to-directory ./docs generate-documentation \
--target DocCTest --disable-indexing --transform-for-static-hosting \
--hosting-base-path DocCTest --output-path ./docs

and then push the build to GitHub, then the error occurs. Look at the documentation at the location

https://leif-ibsen.github.io/DocCTest/documentation/docctest

and if you click, say the BInt operator /, you should see

The page you're looking for can't be found.

That's what I experience.

leif-ibsen commented 5 months ago

If I preview the documentation (using Xcode 15.3) with the command

swift package --disable-sandbox preview-documentation --target DocCTest everything work okay. I can see all the pages locally on my computer.

However, if I build for GitHub Pages (also using Xcode 15.3) with the command

swift package --allow-writing-to-directory ./docs generate-documentation \ --target DocCTest --disable-indexing --transform-for-static-hosting \ --hosting-base-path DocCTest --output-path ./docs and then push the build to GitHub, then the error occurs. Look at the documentation at the location

https://leif-ibsen.github.io/DocCTest/documentation/docctest and if you click, say the BInt operator /, you should see

The page you're looking for can't be found. That's what I experience.

Den 8. mar. 2024 kl. 16.07 skrev David Rönnqvist @.***>:

I don't know how I can reproduce this.

If I build documentation for that repo with the Xcode 15.3 release build I can view all those pages. At first I thought that it could be an issue with the static hosting files being different but if I locally serve the built documentation with python3 -m http.server 8080 I can still browse all those pages.

— Reply to this email directly, view it on GitHub https://github.com/apple/swift-docc/issues/820#issuecomment-1985859370, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANEVD3A62VBQTA2WKYXHV6DYXHHZZAVCNFSM6AAAAABDBKUHF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHA2TSMZXGA. You are receiving this because you authored the thread.

leif-ibsen commented 1 month ago

The issue is marked with 'needs more information'.

As I have explained, if I build the documentation and view it locally on my PC, everything works ok.

However, when the documentation is pushed to GitHub Pages and viewed there, the error occurs.

I have documented that at the location

https://leif-ibsen.github.io/DocCTest/documentation/docctest/

Is there more information I can provide to help solve this?

The operators that produce the error on GitHub Pages, are:

/ /= % %= | |= ^ ^= ~ << <<= >> >>= < <= > >=