-
Notifications
You must be signed in to change notification settings - Fork 98
Add the ability to inject HTML into the <head>
#118
Comments
I'm sympathetic to wanting to customize the output, and that's something I want to have a good story for. Allowing custom HTML to be injected into the For example, looking at your specific usage: <script>
window.addEventListener('DOMContentLoaded', () => {
document.querySelector('.header-link[href^=dash-feed]').remove();
});
</script> It looks like this is removing a link to the Dash feed that's put there by Jazzy. It's never a good sign when one feature of software is used to disable another feature. Analytics
I've seen a hosts like Netlify add this as a feature of their build system, and I suspect that the JavaScript has at least a few utilities that make this easy.
For something like this, I'd want to consider support for custom themes / assets wholesale. Or, in the meantime, my recommendation would be to fork and customize directly in source.
I'd actually be really curious to hear any examples of things someone might want to add. I'd love to get a better understanding of more things the generator could do / what features someone might want to delegate to a static site generator. |
There are probably better specific solutions for many of these use-cases, but the benefit of the
It's there to work around a Jazzy bug: realm/jazzy#1188 So I guess that's another use-case: Temporarily work around SwiftDoc bugs.
I don't want to maintain a fork of a theme though. I just want to do some minor adjustments. Another solution would be to let me specify additional CSS content/files that are then merged with the default CSS at build time.
Some things to comes to mind:
And yes, some of these things could be supported by default, but that will take time, and that's exactly how the |
One of the things that some custom HTML injection is usually needed for w/ Jazzy is the ability to have several packages with their relationships cross-linked in their documentation. For example, SwiftNIO has several repos and packages that they offer, and to link their documentation together they have a plain index "homepage": https://apple.github.io/swift-nio/docs/current/NIO/index.html Vapor does this with a dedicated page and a dropdown: https://api.vapor.codes/ In addition, multiple API versions might be wanted to be generated, such as for 1.0 & 2.0 with a quick way of knowing which version of the API you're looking at, and how to switch to a different version (this relates to #120 somewhat). |
Orthogonally, what I'd love to see is the ability to provide cross-linking / documentation of dependencies, so that our project's documentation feels much more akin to Apple's documentation. When I type
having hotlinks to NIO's |
This can be useful for multiple purposes:
Jazzy solves this with a
head
option: https://github.com/sindresorhus/KeyboardShortcuts/blob/498fcd6cc1562313b5e3aa97b35430cfb2c91292/.jazzy.yml#L13-L19Personally, I would use a more verbose option name.
The text was updated successfully, but these errors were encountered: