Search code examples
githubdocumentationremote-accessdocumentation-generation

How to View Documentation on GitHub without Downloading


This is actually a problem I've been having for frequently but I'm finally frustrated enough to look for an answer here.

I have been looking into how to use the PyBluez Python package on GitHub. I want to view the documentation so I go to the repo's docs/index.html page and all I can see is this.

view of HTML text but not the documentation

I have tried for so long to get this to open as an HTML page but it just won't - none of the buttons seem to provide that functionality and I've not found many similar complaints. There is one notable exception, however. I did find this page that I think says I can view the documentation by going to

https://docs.google.com/a/[DOMINIO]/viewer?url=[FILE_URL]

or

https://docs.google.com/a/[DOMINIO]/viewer?url=[FILE_URL]

but I have no idea what [DOMINO] is supposed to be and I don't know if the relative file references (i.e. <frame src="public/toc.html" name="moduleListFrame">) will still work in GoogleDocs. Also it seems like a hassle to url-encode the file URL each time I want to view something.

For now I'm going to download the repo and keep the docs so I can look at them but for future reference how do I look at these docs without downloading the repo?

Edit - They Could Not Be Making This More Annoying

Thanks to YCFlame for the interesting suggestion that I view the page source to see if GitHub references a URL for the actual document to render the text.

Unfortunately (and interestingly) the documents shown on GitHub are actually HTML tables that get filled by a JavaScript library!!!

This is the source for the div that contains the HTML text.

<div itemprop="text" class="blob-wrapper data type-html">
  <table class="highlight tab-size js-file-line-container" data-tab-size="8">
  <tr>
    <td id="L1" class="blob-num js-line-number" data-line-number="1"></td>
    <td id="LC1" class="blob-code blob-code-inner js-file-line">&lt;!DOCTYPE HTML PUBLIC <span class="pl-s">&quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot;</span>&gt;</td>
  </tr>
  <tr>
    <td id="L2" class="blob-num js-line-number" data-line-number="2"></td>
    <td id="LC2" class="blob-code blob-code-inner js-file-line">&lt;<span class="pl-ent">html</span>&gt;</td>
  </tr>
  <tr>
    <td id="L3" class="blob-num js-line-number" data-line-number="3"></td>
    <td id="LC3" class="blob-code blob-code-inner js-file-line">&lt;<span class="pl-ent">head</span>&gt;</td>
  </tr>
  <tr>
    <td id="L4" class="blob-num js-line-number" data-line-number="4"></td>
    <td id="LC4" class="blob-code blob-code-inner js-file-line">  &lt;<span class="pl-ent">title</span>&gt; API Documentation &lt;/<span class="pl-ent">title</span>&gt;</td>
  </tr>
  <tr>
    <td id="L5" class="blob-num js-line-number" data-line-number="5"></td>
    <td id="LC5" class="blob-code blob-code-inner js-file-line">&lt;/<span class="pl-ent">head</span>&gt;</td>
  </tr>
  <tr>
    <td id="L6" class="blob-num js-line-number" data-line-number="6"></td>
    <td id="LC6" class="blob-code blob-code-inner js-file-line">&lt;<span class="pl-ent">frameset</span> <span class="pl-e">cols</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>20%,80%<span class="pl-pds">&quot;</span></span>&gt;</td>
  </tr>
  <tr>
    <td id="L7" class="blob-num js-line-number" data-line-number="7"></td>
    <td id="LC7" class="blob-code blob-code-inner js-file-line">  &lt;<span class="pl-ent">frameset</span> <span class="pl-e">rows</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>30%,70%<span class="pl-pds">&quot;</span></span>&gt;</td>
  </tr>
  <tr>
    <td id="L8" class="blob-num js-line-number" data-line-number="8"></td>
    <td id="LC8" class="blob-code blob-code-inner js-file-line">    &lt;<span class="pl-ent">frame</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>public/toc.html<span class="pl-pds">&quot;</span></span> <span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>moduleListFrame<span class="pl-pds">&quot;</span></span>&gt;</td>
  </tr>
  <tr>
    <td id="L9" class="blob-num js-line-number" data-line-number="9"></td>
    <td id="LC9" class="blob-code blob-code-inner js-file-line">    &lt;<span class="pl-ent">frame</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>public/toc-everything.html<span class="pl-pds">&quot;</span></span> <span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>moduleFrame<span class="pl-pds">&quot;</span></span>&gt;</td>
  </tr>
  <tr>
    <td id="L10" class="blob-num js-line-number" data-line-number="10"></td>
    <td id="LC10" class="blob-code blob-code-inner js-file-line">  &lt;/<span class="pl-ent">frameset</span>&gt;</td>
  </tr>
  <tr>
    <td id="L11" class="blob-num js-line-number" data-line-number="11"></td>
    <td id="LC11" class="blob-code blob-code-inner js-file-line">  &lt;<span class="pl-ent">frame</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>public/bluetooth-module.html<span class="pl-pds">&quot;</span></span> <span class="pl-e">name</span>=<span class="pl-s"><span class="pl-pds">&quot;</span>mainFrame<span class="pl-pds">&quot;</span></span>&gt;</td>
  </tr>
  <tr>
    <td id="L12" class="blob-num js-line-number" data-line-number="12"></td>
    <td id="LC12" class="blob-code blob-code-inner js-file-line">&lt;/<span class="pl-ent">frameset</span>&gt;</td>
  </tr>
  <tr>
    <td id="L13" class="blob-num js-line-number" data-line-number="13"></td>
    <td id="LC13" class="blob-code blob-code-inner js-file-line">&lt;/<span class="pl-ent">html</span>&gt;</td>
  </tr>
</table>
</div>

Solution

  • You can try http://htmlpreview.github.io to preview webpages in Github repos without downloading them, if you don't mind giving up on Google Docs Viewer.