JAL-1645 relocate developer info about BioJS MSA templates to jalview/doc.
[jalview.git] / doc / biojsmsa-templates.html
1 <html>
2 <title>The BioJS MSA Templating System</title>
3 <body>
4   <h2>BioJS MSA Templates</h2>
5   <p>The Jalview Desktop uses a template file to embed data when
6     exporting an alignment as a BioJS MSA HTML page. This means it is
7     possible to update Jalview's template with different versions of the
8     BioJS MSA viewer, or even customise the page for your own needs.</p>
9   <p>NOTE: This is an experimental feature new in jalview 2.9 -
10     please get in contact with the developers if you're interested in
11     creating your own templates so we can improve this documentation !</p>
12   <h3>The components of a BioJS template file</h3>
13   <ul>
14     <li>All JavaScripts necessary to render and visualise BioJS
15       data</li>
16     <li>JavaScripts to transform BioJSON data to BioJS MSA data</li>
17     <li>Place holder for BioJSON data (this can be a div or input
18       element as show below): <pre>
19         <code>&lt;div name="seqData" id="seqData" style="display: none;"&gt;#valid BioJSON data#&lt;/div&gt;  OR
20 &lt;input type="hidden" id="seqData" name="seqData" value='#valid BioJSON data#'/&gt;
21 </code>
22       </pre>
23     </li>
24   </ul>
25
26   The externalised BioJS MSA templates are available in the Github
27   repository
28   <a
29     href="https://github.com/jalview/exporter-templates/tree/master/biojs">https://github.com/jalview/exporter-templates/tree/master/biojs</a>.
30   <br />Jalview processes the
31   <b>package.json</b> file at
32   <a
33     href="https://github.com/jalview/exporter-templates/blob/master/biojs/package.json">https://github.com/jalview/exporter-templates/blob/master/biojs/package.json</a>
34   to work out the available versions of BioJS MSA Viewer templates and
35   the latest release version to use for its exports.
36
37
38   <h2>Creating/Updating a new BioJS MSA Template</h2>
39   The following steps can be taken to create or update a BioJS MSA
40   template
41   <ol>
42     <li>Add/update all BioJS MSA scripts to the template file</li>
43     <li>Add/update codes for transforming BioJSON data to BioJS MSA
44       data (this requires knowledge of both data models)</li>
45     <li>Ensure that the new template created can be employed by
46       Jalview to generate valid BioJS MSA files. This can be achieved by
47       following the steps below to deploy the new export template to a
48       test repository and subsequently configure Jalview to use the test
49       repository for testing the template:
50       <ol type="i">
51         <li>Publish the template along with a valid package.json
52           file to an online repository</li>
53         <li>Configure Jalview preferences to point to the raw URL
54           of package.json in your test repository. This is done by
55           creating/changing the property <b>'biojs_template_git_repo'</b>
56           in the <b>jalview_properties</b> file <br />e.g. <b>biojs_template_git_repo=https://raw.githubusercontent.com/gituser/biojs-templates/package.json</b>
57         </li>
58         <li>Restart Jalview and ensure that the new templates are
59           downloaded</li>
60         <li>Export an alignment to BioJS MSA</li>
61         <li>Check that the exported file is valid and reflects all
62           the incorporated changes</li>
63       </ol>
64     </li>
65     <li>Commit the new template to the official Jalview-BioJS
66       Github template repository <a
67       href="https://github.com/jalview/exporter-templates/tree/master/biojs">https://github.com/jalview/exporter-templates/tree/master/biojs</a>
68     </li>
69     <li>Update the package.json of the official template repository
70       at <a
71       href="https://github.com/jalview/exporter-templates/blob/master/biojs/package.json">https://github.com/jalview/exporter-templates/blob/master/biojs/package.json</a>
72       accordingly
73     </li>
74     <li>Restore value for <b>'biojs_template_git_repo'</b> in
75       jalview_properties to point to the official template repository
76     </li>
77     <li>Repeat steps 3iii to 3v above</li>
78   </ol>
79
80 </body>
81 </html>