Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package preview-documentation doesn't display pathing to docs target, and top-level page is throwing an error when resolving. #75

Open
2 tasks done
heckj opened this issue Oct 1, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@heckj
Copy link
Member

heckj commented Oct 1, 2022

Description

Using the tools versioned with 5.7.0 release:

/Applications/Xcode-14.1beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift package --disable-sandbox tools-version
5.7.0

(This is also with the swift-docc-plugin branch of main to get snippets to work.)

When I invoke swift package preview-documentation:

export DOCC_JSON_PRETTYPRINT=YES
om.github.heckj.DoccSnippetExample \
 $(xcrun --find swift) package \
     --disable-sandbox \
     preview-documentation \
     --target DoccSnippetExample

The preview no longer shows the extension of the target. The output I'm seeing is:

========================================
Starting Local Preview Server
	 Address: http://localhost:8000/
========================================

Where it used to display the full path to the target:
http://localhost:8000/documentation/doccsnippetexample/

That root page also displays an error when you try to access it:

Screen Shot 2022-10-01 at 3 18 56 PM

``` Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8000/data/documentation/doccsnippetexample.json ```

And when I looked into the directory structure, the json file is located inside the target - so I'm suspecting there's been a slight adjustment somewhere and parts aren't quite aligned for where swift-docc-render looks for JSON files.

In the on-disk directory, the JSON file for this page resides at:
docs/data/documentation/doccsnippetexample/doccsnippetexample.json and I'm thinking that the preview server and docs-render is expecting to find it at docs/data/documentation/doccsnippetexample.json.

I'm uncertain, but suspect these might be related (target directory and broken link with preview), so I'm including them into a single report, but I'm happy to break them up as well.

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

No response

Actual behavior

No response

Steps To Reproduce

For a reproduction case:

clone the repo:

  • git clone https://github.com/heckj/DoccSnippetExample
  • cd DoccSnippetExample
  • ./docpreview.bash

(which invokes:

export DOCC_JSON_PRETTYPRINT=YES

 $(xcrun --find swift) package \
     --disable-sandbox \
     preview-documentation \
     --target DoccSnippetExample

Swift-DocC Version Information

'5.7.0'

Swift Compiler Version Information

swift-driver version: 1.62.15 Apple Swift version 5.7.1 (swiftlang-5.7.1.134.3 clang-1400.0.29.51)
Target: arm64-apple-macosx12.0
@heckj heckj added the bug Something isn't working label Oct 1, 2022
@d-ronnqvist d-ronnqvist transferred this issue from swiftlang/swift-docc Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant