# Static Renderer

**URL:** <https://forums.swift.org/t/static-renderer/52844>\
**Category:** Swift-DocC\
**Created:** [October 15, 2021, 1:18pm UTC](https://forums.swift.org/t/static-renderer/52844 "2021-10-15T13:18:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saklad5](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Saklad5](https://forums.swift.org/u/Saklad5)\
**Post date:** [October 15, 2021, 1:18pm UTC](https://forums.swift.org/t/static-renderer/52844/1 "2021-10-15T13:18:49Z")

</div>

DocC needs to have an option for generating a static site. JavaScript is unnecessarily heavy for the purpose, and the current story for hosting documentation is unnecessarily complicated. It should be possible to _completely_ disable JavaScript without compromising the ability to browse the default documentation.

In particular, I think there should be a substantial amount of focus on the ability to automatically generate documentation compatible with services such as GitHub Pages. I think a lot of people would be thrilled if a CI job could automatically generate documentation for any SPM-compatible repo.

I’m not saying it should explicitly rely on GitHub or anything. Generating static HTML and CSS would be sufficient.

---

<div class="post-metadata">

**Author:** ![JuneBash](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/junebash/32/19323_2.png) [@JuneBash](https://forums.swift.org/u/JuneBash)\
**Post date:** [October 15, 2021, 1:30pm UTC](https://forums.swift.org/t/static-renderer/52844/2 "2021-10-15T13:30:49Z")

</div>

+1! It’d be lovely to be able to just generate a static site and host that on, eg, GitHub Pages or Netlify.

---

<div class="post-metadata">

**Author:** ![xAlien95](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/xalien95/32/12558_2.png) [@xAlien95](https://forums.swift.org/u/xAlien95)\
**Post date:** [October 15, 2021, 1:45pm UTC](https://forums.swift.org/t/static-renderer/52844/3 "2021-10-15T13:45:05Z")

</div>

> [@Saklad5](#):
>
> DocC needs to have an option for generating a static site. JavaScript is unnecessarily heavy for the purpose, and the current story for hosting documentation is unnecessarily complicated. It should be possible to _completely_ disable JavaScript without compromising the ability to browse the default documentation.

DocC may contain [Tutorials](https://developer.apple.com/tutorials/swiftui/creating-and-combining-views), which in a form or another require JavaScript. If an option to generate only static and "JS-free" documentation were available, would those be prevented entirely?

If I'm not mistaken, the DocC team separated the generation of metadata from the renderer process (great!), which – I assume – means that you're free to provide your own renderer built entirely from scratch (fully static, JS agnostic, built with ReactJS instead of VueJS, etc.), so customizing options could be of secondary importance.

---

<div class="post-metadata">

**Author:** ![Saklad5](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Saklad5](https://forums.swift.org/u/Saklad5)\
**Post date:** [October 15, 2021, 1:48pm UTC](https://forums.swift.org/t/static-renderer/52844/4 "2021-10-15T13:48:06Z")

</div>

Simply require JavaScript where absolutely necessary, and nowhere else. Tutorials should probably require it, but that isn’t the main purpose of documentation.

If you want a good example of how to do that, disable JavaScript and reload this page.

---

<div class="post-metadata">

**Author:** ![Damien\_Petrilli](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/damien_petrilli/32/6211_2.png) [@Damien\_Petrilli](https://forums.swift.org/u/Damien_Petrilli)\
**Post date:** [October 15, 2021, 1:54pm UTC](https://forums.swift.org/t/static-renderer/52844/5 "2021-10-15T13:54:32Z")

</div>

And AWS S3 static hosting

---

<div class="post-metadata">

**Author:** ![Saklad5](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Saklad5](https://forums.swift.org/u/Saklad5)\
**Post date:** [October 15, 2021, 1:56pm UTC](https://forums.swift.org/t/static-renderer/52844/6 "2021-10-15T13:56:03Z")

</div>

Specifics are definitely not DocC’s problem. Simply not requiring JavaScript to be usable would be enough for other tools to handle the rest.

---

<div class="post-metadata">

**Author:** ![Karl](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@Karl](https://forums.swift.org/u/Karl)\
**Post date:** [October 15, 2021, 2:03pm UTC](https://forums.swift.org/t/static-renderer/52844/7 "2021-10-15T14:03:14Z")

</div>

It’s on the list

> [@Announcing Swift-DocC](https://forums.swift.org/t/announcing-swift-docc/52797/1):
>
> Additionally, there is already a pretty exciting list of new features and other short-term improvements set for this project, including:
> 
> […]
> 
> - Enable hosting documentation in static file server environments (e.g., GitHub Pages)

---

<div class="post-metadata">

**Author:** ![Saklad5](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Saklad5](https://forums.swift.org/u/Saklad5)\
**Post date:** [October 15, 2021, 2:04pm UTC](https://forums.swift.org/t/static-renderer/52844/8 "2021-10-15T14:04:05Z")

</div>

Ah, my mistake. Sorry about that.
