-
Notifications
You must be signed in to change notification settings - Fork 414
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
Add Flag to Include Resources #853
Comments
Thank you, @drekka. |
So we want to:
So given: jazzy --resources 'My Awesome.png' and some markdown in eg. a class doc comment: [This text links to the image](My Awesome.png)
![Image's alt text](My Awesome.png) we get html: <a href="../Resources/my-awesome.png">This text links to the image</a>
<img src="../Resources/my-awesome.png" alt="Image's alt text"> As a follow-on would make sense to do the same thing for documentation markdown files as requested by a couple of other issues. |
@johnfairh, That would work well for the But for documentation comments, Xcode’s Quick Help will not have those resources and I can see that being a source for confusion. I think for documentation comments I would propose maybe one of the following: A) Make a configuration option available to specify the base URL of the canonical location the documents will be hosted. Then documentation comments should point to absolute URLs in that canonical location for Xcode’s sake. Jazzy would recognize the matching prefix and strip it, so Jazzy’s version points at its own local copies because it can guarantee their existence. Users who will not be hosting anything online can use a mock canonical URL (e.g. B) Jazzy treats them as you said, but whenever it encounters a link to a local resource in a documentation comment, it throws a warning in much the same way it does when it encounters something undocumented. That way users are clearly notified that their documentation only works with Jazzy—not Xcode or other tools. It would be reasonable to disable all such warnings with a configuration option. Option B is simpler, but would make it impossible for a project to support both Jazzy’s local resources and Xcode at once, forcing users to choose between the two. |
Good point. Could do (A) by default, spot absolute links (with any prefix) to resource files + rewrite them as relative. Then still support the option to 'rewrite only these urls' as you describe to deal with unwanted/specific rewriting. |
Currently I've been adding a bash
cp
command after generating the documentation with Jazzy in order to copy additional resources into the documentation. In my case thecp
copies images stored in a directory into the generated docs. This works ok for then publishing the docs as html, but the images are not included into the docset Jazzy creates in docs/docset.I think I'd like to see a new argument to Jazzy. Something like this:
So I could do this:
As a further justification, whilst images can be referenced via links to resources stored on the internet, it won't work when the docs are being passed around on some internal company networks (with heavy security) or when the computer is offline.
The text was updated successfully, but these errors were encountered: