Commits

Gabriel Farrell  committed 3c41782

Made media links relative

  • Participants
  • Parent commits 89d14af

Comments (0)

Files changed (2)

File code4lib13/isis2couchdb-unwrap.txt

 
 HTTP is the main protocol for interacting with CouchDB<sup><a name="noteorig11" href="#note11">11</a></sup>. Most database administration is done via Futon, its built-in web interface.
 
-<div style="width: 500px; margin: auto;"><a href="http://ramalho.pro.br/media/issue13/ramalho/fig1-futon.png"><img class="caption" src="http://ramalho.pro.br/media/issue13/ramalho/fig1-futon-500x422.png" alt="Futon screen shot: viewing a record" /></a></div> <p class="caption"><strong>Figure 1.</strong> CouchDB Futon web interface showing a LILACS record in ISIS-JSON Type-2 format.</p>
+<div style="width: 500px; margin: auto;"><a href="/media/issue13/ramalho/fig1-futon.png"><img class="caption" src="/media/issue13/ramalho/fig1-futon-500x422.png" alt="Futon screen shot: viewing a record" /></a></div> <p class="caption"><strong>Figure 1.</strong> CouchDB Futon web interface showing a LILACS record in ISIS-JSON Type-2 format.</p>
 
 Nearly every task which can be done via Futon can also be automated using the RESTful API of CouchDB via any HTTP client. In fact, interacting with CouchDB is a great way to learn, in practice, what REST and RESTful interfaces are all about. Here we use cURL, a command-line HTTP client available for many systems. For example, a database is created with a simple PUT request:
 
 
 For any serious work, the CouchApp tool is highly recommended (<a href="#anderson2009">Anderson, 2009</a>). With it you can develop your design documents in your local filesystem, using your favorite editor and version control system, then push your code to a local or remote CouchDB instance with a command. All of the views for this article were developed in this manner. The code is in Bitbucket (<a href="#ramalho2011">Ramalho, 2011</a>).
 
-<div style="width: 500px; margin: auto;"><a href="http://ramalho.pro.br/media/issue13/ramalho/fig2-tempview.png"><img class="caption" src="http://ramalho.pro.br/media/issue13/ramalho/fig2-tempview-500x399.png" alt="Futon screen shot: testing a temporary view" /></a></div> <p class="caption"><strong>Figure 2.</strong> Editing and running a temporary view in CouchDB Futon.</p>
+<div style="width: 500px; margin: auto;"><a href="/media/issue13/ramalho/fig2-tempview.png"><img class="caption" src="/media/issue13/ramalho/fig2-tempview-500x399.png" alt="Futon screen shot: testing a temporary view" /></a></div> <p class="caption"><strong>Figure 2.</strong> Editing and running a temporary view in CouchDB Futon.</p>
 
 When a view is first visited via HTTP, CouchDB indexes all of the documents by applying the <code>map</code> function to each of them. CouchDB also incrementally updates the indexes if documents are inserted or updated. The indexing is only done on demand, when a view is actually requested, and not when documents are created or changed.
 
 
 We are using QUnit (<a href="#jquery2011">JQuery, 2011</a>) to perform unit tests on the <code>isisdm.js</code> module. Here is the the test page:
 
-<div style="width: 500px; margin: auto;"><a href="http://ramalho.pro.br/media/issue13/ramalho/fig3-qunit.png"><img class="caption" src="http://ramalho.pro.br/media/issue13/ramalho/fig3-qunit-500x394.png" alt="Futon screen shot: viewing a record" /></a></div> <p class="caption"><strong>Figure 3.</strong> QUnit test results page, showing that all tests are passing. The tests for the <code>getallsub</code> function are expanded. This page is live at <a href="http://ramalho.couchone.com/lilcouch/_design/lilacs/tests.html" >http://ramalho.couchone.com/lilcouch/_design/lilacs/tests.html</a></p>
+<div style="width: 500px; margin: auto;"><a href="/media/issue13/ramalho/fig3-qunit.png"><img class="caption" src="/media/issue13/ramalho/fig3-qunit-500x394.png" alt="Futon screen shot: viewing a record" /></a></div> <p class="caption"><strong>Figure 3.</strong> QUnit test results page, showing that all tests are passing. The tests for the <code>getallsub</code> function are expanded. This page is live at <a href="http://ramalho.couchone.com/lilcouch/_design/lilacs/tests.html" >http://ramalho.couchone.com/lilcouch/_design/lilacs/tests.html</a></p>
 
 Now, back to the <code>map</code> function, note that the call to <code>emit</code> uses the subfield occurrence as key and the value is just a number 1: <code>emit(occurs[i], 1);</code>. This is because the intent of this view is to produce an aggregate count of each different key. To achieve this, we need a <code>reduce</code> function to sum the values emitted, like this:
 

File code4lib13/isis2couchdb.txt

 done via Futon, its built-in web interface.
 
 <div style="width: 500px; margin: auto;"><a
-href="http://ramalho.pro.br/media/issue13/ramalho/fig1-futon.png"><img
-class="caption"
-src="http://ramalho.pro.br/media/issue13/ramalho/fig1-futon-500x422.png"
+href="/media/issue13/ramalho/fig1-futon.png"><img class="caption"
+src="/media/issue13/ramalho/fig1-futon-500x422.png"
 alt="Futon screen shot: viewing a record" /></a></div> <p
 class="caption"><strong>Figure 1.</strong> CouchDB Futon web interface showing a
 LILACS record in ISIS-JSON Type-2 format.</p>
 code is in Bitbucket (<a href="#ramalho2011">Ramalho, 2011</a>).
 
 <div style="width: 500px; margin: auto;"><a
-href="http://ramalho.pro.br/media/issue13/ramalho/fig2-tempview.png"><img
-class="caption"
-src="http://ramalho.pro.br/media/issue13/ramalho/fig2-tempview-500x399.png"
+href="/media/issue13/ramalho/fig2-tempview.png"><img class="caption"
+src="/media/issue13/ramalho/fig2-tempview-500x399.png"
 alt="Futon screen shot: testing a temporary view" /></a></div> <p
 class="caption"><strong>Figure 2.</strong> Editing and running a temporary view
 in CouchDB Futon.</p>
 tests on the <code>isisdm.js</code> module. Here is the the test page:
 
 <div style="width: 500px; margin: auto;"><a
-href="http://ramalho.pro.br/media/issue13/ramalho/fig3-qunit.png"><img
-class="caption"
-src="http://ramalho.pro.br/media/issue13/ramalho/fig3-qunit-500x394.png"
+href="/media/issue13/ramalho/fig3-qunit.png"><img class="caption"
+src="/media/issue13/ramalho/fig3-qunit-500x394.png"
 alt="Futon screen shot: viewing a record" /></a></div> <p
 class="caption"><strong>Figure 3.</strong> QUnit test results page, showing that
 all tests are passing. The tests for the <code>getallsub</code> function are