<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="85963" data-post-id="85963">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amnu3387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amnu3387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>And does the build process of the docs have access to previous versions?<br>
Because if it has (or if it could be made aware somehow during build), then it could also output a small json file as part of the static website, like versions.json, living on the root of the website, which would allow a small js script to request this file from the canonical url (latest version) and then build the dropdown. So a small js snippet could be injected in any version and request the canonical versions.js without having to have prior knowledge of the available versions?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85963" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/where-can-we-submit-documentation-updates-to-hex-packages/14739/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-85963" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85963"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="85970" data-post-id="85970">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ericmj" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ericmj/120/25920_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ericmj
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Elixir Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="amnu3387" data-post="32" data-topic="14739" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/48.png" class="avatar"> amnu3387:</div>
<blockquote>
<p>And does the build process of the docs have access to previous versions?<br>
Because if it has (or if it could be made aware somehow during build), then it could also output a small json file as part of the static website, like versions.json, living on the root of the website, which would allow a small js script to request this file from the canonical url (latest version) and then build the dropdown. So a small js snippet could be injected in any version and request the canonical versions.js without having to have prior knowledge of the available versions?</p>
</blockquote>
</aside>
<p>We could fetch the list of previous versions from the API or repository. Bu that means we could only switch to previous versions, when hexdocs.pm/ecto/1.1.0 is created hexdocs.pm/ecto/1.0.0 would not be able to link to it. We could move the file to hexdocs.pm/ecto/versions.json when uploading to S3 but that means ex_doc has to understand the URL structure of hexdocs.pm and link to things outside of what it generates.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85970" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/where-can-we-submit-documentation-updates-to-hex-packages/14739/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-85970" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85970"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="85972" data-post-id="85972">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="michalmuskala" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/michalmuskala/120/20288_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  michalmuskala
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What if <code>ex_doc</code> standardised on having a <code>versions.json</code> part inside of the package and hexdocs would update this file for all released versions when a new version is pushed?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85972" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/where-can-we-submit-documentation-updates-to-hex-packages/14739/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-85972" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85972"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="86226" data-post-id="86226">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="amnu3387" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  amnu3387
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So there’s no way to inject a JS snippet into all versions?<br>
What I meant was that, you build the docs for the latest version to put them online, in this latest version build, it would also output a ~/versions.json file.</p>
<p>The latest docs are accessible through the non-versioned url right? Like if you go to hexdocs.pm/ecto it shows you the latest version. So if the snippet always retrieved the versions from hexdocs.pm/package/versions.json it would always be able to retrieve all existing versions (assuming on doc build we could return all of them)? In the latest version of the docs it could <code>import</code> directly the JSON file since it’s in the known directory, while the previous versions would use the snippet to retrieve it?</p>
<p>I’m really not familiar with how docs are built so this might not make sense at all/be overlooking something basic</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86226" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/where-can-we-submit-documentation-updates-to-hex-packages/14739/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-86226" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86226"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="86228" data-post-id="86228">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="voughtdq" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/voughtdq/120/9633_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  voughtdq
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="amnu3387" data-post="35" data-topic="14739">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/48.png" class="avatar"> amnu3387:</div>
<blockquote>
<p>So there’s no way to inject a JS snippet into all versions?</p>
</blockquote>
</aside>
<p>ex_doc could include HTML “template comments”:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;!--EX_DOC_JS_INCLUDES--&gt;
</code></pre>
<p>then during the build process, the builder can replace it with whatever necessary after ex_doc finishes. This way ex_doc doesn’t have to know anything and things like version selector can be added without too much trouble.</p>
<p>It’s not perfect, but I think it’s a nice trade off.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86228" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/where-can-we-submit-documentation-updates-to-hex-packages/14739/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-86228" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86228"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="86288" data-post-id="86288">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ericmj" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ericmj/120/25920_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ericmj
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Elixir Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="amnu3387" data-post="35" data-topic="14739" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/48.png" class="avatar"> amnu3387:</div>
<blockquote>
<p>So there’s no way to inject a JS snippet into all versions?<br>
What I meant was that, you build the docs for the latest version to put them online, in this latest version build, it would also output a ~/versions.json file.</p>
<p>The latest docs are accessible through the non-versioned url right? Like if you go to hexdocs.pm/ecto it shows you the latest version. So if the snippet always retrieved the versions from hexdocs.pm/package/versions.json it would always be able to retrieve all existing versions (assuming on doc build we could return all of them)? In the latest version of the docs it could <code>import</code> directly the JSON file since it’s in the known directory, while the previous versions would use the snippet to retrieve it?</p>
<p>I’m really not familiar with how docs are built so this might not make sense at all/be overlooking something basic</p>
</blockquote>
</aside>
<p>That would work but ex_doc would make an assumption about the url structure of where it’s going to be hosted. Keep in mind that today all links and references in ex_doc are relative, that means you can drop in the generated documentation in a web server that can host files from a filesystem and it just works anywhere.</p>
<p>The path to the versions file can be a config option that hex passes to ex_doc but it means we are forever tied to to the url structure we have now, for example we couldn’t later decide to move the docs to hex.pm/docs/phoenix/… without breaking existing documentation.</p>
<p>This is a compromise that might be worth to take but it’s important to keep in mind that we are making a change that can have consequences we don’t know of yet.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86288" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/where-can-we-submit-documentation-updates-to-hex-packages/14739/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-86288" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86288"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>