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

Unresolved H4 links #36

Closed
Kyle-Ye opened this issue Sep 25, 2022 · 7 comments · Fixed by swiftlang/swift-docc#403
Closed

Unresolved H4 links #36

Kyle-Ye opened this issue Sep 25, 2022 · 7 comments · Fixed by swiftlang/swift-docc#403
Labels
Build issue A problem or enhancement in the tools that build and publish this book

Comments

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Sep 25, 2022

In some places, TSPL links to a H4 as an anchor point — for example:

// In Statements.md
#### Switching Over Future Enumeration Cases

// In Attributes.md and RevisionHistory.md
<doc:Statements#Switching-Over-Future-Enumeration-Cases>

However, swift-docc currently only supports H1, H2 and H3 as an anchor to reference.

https://github.com/apple/swift-docc/blob/5fe2d1331eba2243163366e4d25259b86a44e5db/Sources/SwiftDocC/Model/DocumentationNode.swift#L113-L124

Should we update the structure of content in this repo or should this be a feature/bug on swift-docc to be fixed?

If we are going to fix it on swift-docc, should we add a flag to let the consumer decide which heading level we should add as anchor or just extend it to level 4?

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Sep 25, 2022

cc @franklinsch

@krilnon
Copy link
Contributor

krilnon commented Sep 25, 2022

It's probably worth at least asking whether DocC might want to support > H3 heading anchors, especially given our focus here on longer-form content where it's more likely that content will have headings with more depth.

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Sep 25, 2022

It's probably worth at least asking whether DocC might want to support > H3 heading anchors, especially given our focus here on longer-form content where it's more likely that content will have headings with more depth.

I'm +1 for support "> H3 heading anchors" (Whether by default or via a flag)

What's your opinion on this? Or we could make some discussion on tomorrow's meeting @franklinsch

@amartini51 amartini51 added this to the Publish with DocC milestone Sep 26, 2022
@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Oct 8, 2022

What's your opinion on this? Or we could make some discussion on tomorrow's meeting @franklinsch

Ping @franklinsch

@franklinsch
Copy link
Contributor

Sorry I missed this. Supporting links to >h3 makes sense to me!

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Oct 10, 2022

After #403 is merged, there will only 1 warning left for swift-book 👇

Input: /Users/kyle/Workspace/Github/swift-docc-project/swift-book/Sources/TSPL/TSPL.docc
Template: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../share/docc/render
/Users/kyle/Workspace/Github/swift-docc-project/swift-book/Sources/TSPL/TSPL.docc/LanguageGuide/AdvancedOperators.md:5:43: warning: Link in document summary will not be displayed
Summary should only contain (formatted) text. To resolve this issue, place links and images elsewhere in the document, or remove them.
========================================
Starting Local Preview Server
	 Address: http://localhost:8080/
========================================

Which is tracked by #1

@amartini51 amartini51 added the Build issue A problem or enhancement in the tools that build and publish this book label Oct 10, 2022
@amartini51
Copy link
Member

amartini51 commented Nov 3, 2022

Thanks @Kyle-Ye! Confirmed that the H4 link in the revision history works now.

Before:
image

After:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build issue A problem or enhancement in the tools that build and publish this book
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants