-
Notifications
You must be signed in to change notification settings - Fork 98
Conversation
It would be great to get this merged. Currently, I have to fix links at Home.md after every auto-generation. EDIT: And links in the Sidebar: https://github.com/SwiftDocOrg/swift-doc/wiki |
Fixes crashes like this one: ```bash $ swift doc generate my-repo/Sources --module-name MyRepo 2020-06-30T17:00:13-0400 critical: Unable to construct path for /(lhs:rhs:) with baseURL / Fatal error: file /private/tmp/swift-doc-20200630-24417-jrxtfw/Sources/swift-doc/Supporting Types/Page.swift, line 55 zsh: illegal hardware instruction swift doc generate my-repo/Sources --module-name MyRepo ```
If anyone wants to temporarily switch to a fork, this fix has been working well for me for a while now. Just update your GitHub job as follows and you can change it back when the problem is fixed in this repo. ...
- name: Generate Documentation
uses: mattpolzin/swift-doc@bugfix/relative-links
... |
@mattpolzin Thanks for submitting this, and sorry for not responding sooner. I'm taking a look now. |
…olute URLs are supported as documentation paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw your latest changes, and am taking a look at this now. I'll probably write some tests to feel more confident in how this will work.
@mattpolzin @kareman Thank you both for your help in identifying and fixing this bug, and for your patience as I got this merged. I look forward to cutting a new release with this and other improvements this Friday. |
SwiftDocOrg/swift-doc#127 has been merged.
* Wiki action: use SwiftDocOrg/swift-doc SwiftDocOrg/swift-doc#127 has been merged. * Enable manual launching.
Fixes #126
This PR
base-url
argument via the GitHub action. Defaults the GitHub action'sbase-url
to "./". I think a relative URL works well more often than not for markdown, but I am not at all tied to this default because it also makes sense to use the same default the underlying program uses: "/".URL
for path append operation. Ostensibly, this simplifies the code and fixes my problem, but I don't know for sure that this works for all use-cases; I would love feedback on this decision.I ran documentation generation with a few believable base urls to check some common cases. For a component named
"A.B"
:[A.B](A_B)
[A.B](/A_B)
[A.B](something/A_B)
[A.B](/something/A_B)
[A.B](https://website.com/docs/A_B)
[A.B](https://website.com/docs/A_B)
[A.B](./A_B)