<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Wize Doc</title> <meta name='Generator' content='Zim 0.72.0'> <link rel="shortcut icon" href="./Wize_Doc_files/_resources/common-spec/favicon.ico" > <link rel="stylesheet" href="./Wize_Doc_files/_resources/common-spec/zim-variables.css" > <link rel="stylesheet" href="./Wize_Doc_files/_resources/common/zim-style.css" > <link rel="stylesheet" href="./Wize_Doc_files/_resources/common/zim-table-style.css" > <link rel="stylesheet" href="./Wize_Doc_files/_resources/common/zim-special.css" > <link rel="stylesheet" href="./Wize_Doc_files/_resources/common/zim-hljs.css" > <link rel="stylesheet" href="./Wize_Doc_files/_resources/common-spec/zim-override.css" > <style type='text/css'> * { font-family: sans-serif } a:hover { text-decoration: underline; } /* Centre les images mais elles sont coupées aux sauts de page à l'impression */ img { display: block; margin-left: auto; margin-right: auto; } .pages { /*max-width: 1000px;*/ /*padding-left: 320px;*/ width: inherit; transition: margin-left .3s; background: white; padding-left: 10px; padding-right: 10px; padding-bottom: 20px; padding-top: 10px; } .header{ max-width: var(--main-page-width); position: fixed; width: 100%; top:0; background:white; z-index: 1; min-height:48px; } hr{ clear:both; border-style: solid; border-width: 1px; border-color: var(--main-header-color); } body { max-width: var(--main-page-width); display:block; margin-left:auto; margin-right:auto; background: var(--main-body-background-color); background-image: url('./Wize_Doc_files/_resources/common-spec/fond.jpg'); background-position: var(--main-body-background-position); background-repeat: var(--main-body-background-repeat); } .intercalaire { background:white; margin-top: 48px; padding: 10px; } .bold-footer { color: var(--main-header-color); } </style> <!-- Themes clair : atom-one-light.css, vs.css googlecode.css github.css qtcreator_light.css Themes sombres : agate.css vs2015.css atom-one-dark.css hybrid.css ir-black.css sunburst.css tomorrow-night-bright.css qtcreator_dark.css Demo live : https://highlightjs.org/static/demo/ --> <link rel="stylesheet" href="./Wize_Doc_files/_resources/common/hljs/styles/sunburst.css" > <!-- hljs --> <script src="./Wize_Doc_files/_resources/common/hljs/highlight.pack.js"></script> <script src="./Wize_Doc_files/_resources/common/wizefunc.js"></script> <script src="./Wize_Doc_files/_resources/common-spec/notice.js"></script> </head> <body onload="testLogo()"> <button onclick="topFunction()" id="upBtn" title="Go to top"></button> <div class='header'> <table class='navigation' style="float:left"> <tr class='navigation'> <td class='navigation'> <!-- <img src="./Wize_Doc_files/_resources/common/arrow-left-inact.png" alt="Préc." title="Préc."> --> </td> <td class='navigation'> <!-- <img src="./Wize_Doc_files/_resources/common/arrow-up-inact.png" alt="Index" title="Index"> --> </td> <td class='navigation'> <!-- <img src="./Wize_Doc_files/_resources/common/arrow-right-inact.png" alt="Suivant" title="Suivant"> --> </td> </tr> </table> <span> <a name='Tests:Wize Doc'></a> <h1 style="display:inline-block;margin-left:20px;margin-top:5px;"> Wize Doc</h1> </span> <table class='navigation' style="float:right;margin-right:10px;"> <tr class='navigation'> <td class='navigation'> </td> <td class='navigation'> <a href="#attach"> <img src='./Wize_Doc_files/_resources/common-spec/attachment.png' alt='Fichiers liés' title='Fichiers liés'> </a> </td> </tr> </table> </div> <div class="intercalaire"> <hr /> </div> <div id="logoDivId" style="float:right"> <img id="logoImgId" src='./Wize_Doc_files/_resources/common-spec/logo.png' alt=' '> </div> <!-- Wiki content --> <div class='pages'> <!-- <div class='heading'> <h1>Wize Doc <a name='Tests:Wize Doc'></a></h1> </div> --> <div class='content'> <p> Created Wednesday 16 October 2019 </p> <p> <b>Wize</b> stands for <b>W</b>ill's <b>I</b>mproved <b>Z</b>im <b>E</b>xports, it is composed of five html exports templates :<br> <ul style='padding-left: 30pt'> <li>Wize</li> <li>Wize_with_index</li> <li>Wize_with_index_sod</li> <li>Wize_Print</li> <li>Wize_S5</li> </ul> </p> <h2>Installation</h2> <p> First close zim, then checkout the git repository and move it to <tt>$HOME/.local/share/zim</tt> : </p> <pre> rm -rf $HOME/.local/share/zim mv wize $HOME/.local/share/zim </pre> <br> <p> After that, link the wize.rb program present in the wize directory to a place in your <b>PATH</b>, for example <tt>$HOME/bin</tt> </p> <pre> cd $HOME/bin ln -s $HOME/.local/share/zim/wize.rb </pre> <p> Then run the wize.rb program with the -i flag : </p> <pre> wize.rb -i </pre> <p> You can now restart zim. </p> <h2>Features</h2> <p> <b>Wize</b> is a customizable export template for zim, it also modify the <tt>style.conf</tt> file in <tt>$HOME/.config/zim/</tt> to have corresponding colors between zim and the export. This modification is made based on the file <tt>style-template.conf</tt> located in <tt>$HOME/.local/share/zim</tt>. So if there's something you don't like or want to add, you may modify this one. The style.conf file will be generated every time you applied a theme. Also the Wize_Print export will be used when using "Print to browser". </p> <p> On the following is a list of the features, mentionning where it is applied, that can be :<br> <ul> <li>zim : applied in zim itself</li> <li>html : applied in the main html exports :Wize, Wize_with_index, Wize_with_index_sod</li> <li>print : applied in the special Wize_Print html export</li> <li>S5 : applied in the special Wize_S5 html export</li> </ul> </p> <h3>Headers</h3> <p> <b>Applied in :</b> zim, html, print, S5 </p> <p> To have a better visibility on which kind of section the reader is, All headers are indented<br> <img src="./Wize_Doc_files/wize_headers.png"> </p> <h3>Underlined text</h3> <p> <b>Applied in :</b> zim, html, print, S5 </p> <p> As a matter of personal taste, I do not like the highlighted behavior of the underline marking. Thus <u>underlined</u> text is <u>underlined</u>. This original behavior can be easyly restored as we will see later in the customization part. </p> <h3>Verbatim</h3> <p> <b>Applied in :</b> zim, html, print, S5 </p> <p> To emphasized it, <tt>inline</tt> verbatim is colored in (customizable) darkmagenta. </p> <pre> as well as block verbatim </pre> <p> Note that block verbatim is indented. Zim make the difference between inline and block when there's at least two lines selected when applying the style by pressing <b><Ctrl>T</b>. </p> <h3>Tables</h3> <p> <b>Applied in :</b> html, print, S5 </p> <p> Tables in zim using the table plugin are not very practical, but with the adequate styling it can be nice on exports. </p> <table> <thead><tr> <th align="left">First Name</th> <th align="left">Name</th> <th align="left">email</th> <th align="left">Fav. Color</th> </tr></thead> <tr> <td align="left">Nathalie</td> <td align="left">Charpentier</td> <td align="left"><a href="mailto:nathalie.charpentier@lasbas.com" title="nathalie.charpentier@lasbas.com" class="mailto">nathalie.charpentier@lasbas.com</a></td> <td align="left">Green</td> </tr> <tr> <td align="left">Electra</td> <td align="left">Cigales</td> <td align="left"><a href="mailto:electra.cigales@nowhere.com" title="electra.cigales@nowhere.com" class="mailto">electra.cigales@nowhere.com</a></td> <td align="left">Red</td> </tr> <tr> <td align="left">Marcel</td> <td align="left">Dupont</td> <td align="left"><a href="mailto:marcel.dupont@nothere.com" title="marcel.dupont@nothere.com" class="mailto">marcel.dupont@nothere.com</a></td> <td align="left">Blue</td> </tr> <tr> <td align="left">Joe</td> <td align="left">Smith</td> <td align="left"><a href="mailto:joe.smith@here.com" title="joe.smith@here.com" class="mailto">joe.smith@here.com</a></td> <td align="left">Orange</td> </tr> </table> <br> <p> One interesting thing to know in that in zim source (which you can view using the entry in the Tools menu), tables are in "MarkDown" syntax. The table above is represented by the following text. </p> <pre> | First Name | Name | email | Fav. Color | |:-----------|:------------|:--------------------------------|:-----------| | Nathalie | Charpentier | nathalie.charpentier@lasbas.com | Green | | Electra | Cigales | electra.cigales@nowhere.com | Red | | Marcel | Dupont | marcel.dupont@nothere.com | Blue | | Joe | Smith | joe.smith@here.com | Orange | </pre> <p> It is possible to paste a text like that (without verbatim of course) and then press <b><Ctrl>R</b>, zim will recognize it and display the table using the plugin. This can be really usefull if you use a table generator such as the excellent <a href="https://www.tablesgenerator.com/" title="https://www.tablesgenerator.com/" class="https">https://www.tablesgenerator.com/</a> which can export in MarkDown format. </p> <h3>Pictures</h3> <p> <b>Applied in :</b> html, S5 </p> <p> <img src="./Wize_Doc_files/tournesol.jpeg"> </p> <p> In the exports, pictures will appeared centered. It is not applied within the print export because as a side effect, pictures can be cutted during print. </p> <h3>Syntax Highlighting</h3> <p> <b>Applied in :</b> html, print, S5 </p> <p> Code blocks inserted with the source view plugin will be syntax highlighted in the exports. </p> <div class="zim-object"> <pre><code class="cpp">#include <iostream> int main(int argc, char *argv[]) { /* An annoying "Hello World" example */ for (auto i = 0; i < 0xFFFF; i++) cout << "Hello, World!" << endl; char c = '\n'; unordered_map <string, vector<string> > m; m["key"] = "\\\\"; // this is an error return -2e3 + 12l; } </code></pre> </div> <br> <p> This is achieved by integrating <a href="https://highlightjs.org/" title="https://highlightjs.org/" class="https">https://highlightjs.org/</a> . There are a number of possible themes. These are not really customisable but they can be modified inside the main templates. </p> <p> By default a light theme is used for the print export, and a dark one for the others. </p> <br> <h3>Font</h3> <p> <b>Applied in :</b> html, print, S5 </p> <p> The font for the print export is "serif" and "sans serif" for the others. </p> <h3>Navigation</h3> <p> <b>Applied in :</b> html, print, S5 </p> <p> The navigation menu and icons are depending depends on the actual export. </p> <h4>Wize_Print</h4> <p> No navigation added. </p> <h4>Wize</h4> <p> Minimalistic navigation :<br> There's a permanent header in which the page title is reported, as well as navigation arrows, backlinks and attachments icons but only displayed if needed. For single page export this might be the best one. </p> <p> The following pictures shows different situtations (actual width has been shrinked to take screenshot) </p> <p> <img src="./Wize_Doc_files/wise_demo_example1.png"> </p> <p> <img src="./Wize_Doc_files/wise_demo_example2.png"> </p> <p> <img src="./Wize_Doc_files/wise_demo_example3.png"><br> <img src="./Wize_Doc_files/wise_demo_example4.png"> </p> <br> <h4>Wize_with_index</h4> <p> There's a permanent header in which the page title is reported, as well as navigation arows and a menu button that will open/close the index menu. Backlinks and attachments icons are only displayed if needed. </p> <p> <img src="./Wize_Doc_files/wise_demo_example5.png"> </p> <p> <img src="./Wize_Doc_files/wise_demo_example6.png"> </p> <br> <h4>Wize_with_index_sod</h4> <p> A variation of the previous one. The difference is that the side menu is opened by default and can be closed to increased the reading width.<br> <img src="./Wize_Doc_files/wise_demo_example7.png"> </p> <p> <img src="./Wize_Doc_files/wise_demo_example8.png"> </p> <br> <h4>Wize_S5</h4> <p> This is a special export to make slide-show presentation, it is based on the provided SlideShow_(S5) export adapted to wize.<br> Please look at the page describing it : <a href=".Wize_Presentation.html" title="Wize Presentation" class="page">Wize Presentation</a> </p> <br> <h3>Go to top Button</h3> <p> As soon as you scroll, a "Go to top" button will appear on the bottom right :<br> <img src="./Wize_Doc_files/wise_demo_gototop.png"> </p> <h3>Theme switching</h3> <p> The script <tt>wize.rb</tt> is used to managed the differents themes : </p> <p> <b>Display available themes :</b> </p> <pre> $ wize.rb -l blue wize </pre> <p> <b>Show current theme :</b> </p> <pre> $ wize.rb -p wize </pre> <br> <p> <b>Apply an other theme :</b> </p> <pre> $ wize.rb -a blue All done! </pre> <p> The modifications to the exports are immediately available however for the new colors to be applied in zim itself, you must restart it. </p> <br> <h2>Customization</h2> <p> Each theme is defined by the directory <tt>common-theme</tt> located in <tt>$HOME/.local/share/zim/templates/html</tt>. To create a new theme based on the wize theme, copy the directory : </p> <pre> cp -r common-wize common-mytheme </pre> <p> Let's have a look at its content now : </p> <pre> $ ls common-mytheme arrow-left-inact.png arrow-up.png zim-pres-override.css arrow-left.png attachment.png zim-pres-variables.css arrow-right-inact.png backlink.png zim-print-override.css arrow-right.png notice.js zim-variables.css arrow-up-inact.png zim-override.css </pre> <br> <h3>Pictures</h3> <p> The names of the different pictures are self explanatory, replace them with the ones you wish, however every picture must be present in the directory even if it's not modified and their size is better be 48 pixels. </p> <h4>Optional pictures</h4> <p> There are five optional pictures that will be used if they are present :<br> <ul style='padding-left: 30pt'> <li><tt>logo.png</tt> : this logo will be placed on the top right of each page</li> <li><tt>logo-pres.png</tt> : this logo will be placed on the top right of each slide with Wize_S5</li> <li><tt>fond.jpg</tt> : this picture will be used as background image instead of the background color</li> <li><tt>fond-pres.jpg</tt> : this picture will be used as background on each slide with Wize_S5</li> <li><tt>favicon.ico</tt> : this will be used as the favourite icon in the browser</li> </ul> </p> <p> Example use of logo.png :<br> <img src="./Wize_Doc_files/wise_demo_logo.png"> </p> <p> Example use of fond.jpg<br> <img src="./Wize_Doc_files/wise_demo_fond.png"> </p> <h3>CSSs</h3> <p> There are 5 CSSs files in the directory : </p> <p> <ul style='padding-left: 30pt'> <li><tt>zim-variables.css </tt>is used to defined variables for most of the theme</li> <li><tt>zim-pres-variables.css</tt> contains variables specific to Wize_S5</li> <li><tt>zim-override.css </tt>is used to override some behaviors</li> <li><tt>zim-pres-override.css </tt>has the same purpose but for Wize_S5</li> <li><tt>zim-print-override.css</tt> same purpose also but for Wize_Print</li> </ul> </p> <h4>zim-variables.css</h4> <p> All variables have comments and have generally self explanatory names, for example : </p> <div class="zim-object"> <pre><code class="css"> --main-header-color: #4e9a06; /* Headers color */ </code></pre> </div> <p> You may look at some sites like the excellent <a href="https://www.w3schools.com/cssref/css_colors.asp" title="w3schools.com" class="https">w3schools.com</a> to know more about css colors and css in general. </p> <p> As an example you may replace : </p> <div class="zim-object"> <pre><code class="css">--main-u-decoration: underline; --main-u-background-color: white; </code></pre> </div> <p> by </p> <div class="zim-object"> <pre><code class="css">--main-u-decoration: none; --main-u-background-color: yellow; </code></pre> </div> <p> to restore the original zim behavior of underlined text. </p> <h4>zim-override.css</h4> <p> This file can contain anything you want to change from standard behavior. As it will be read in last position, it will have precedence. There's two examples by default in it : </p> <p> The "normal" definition for verbatim blocks is : </p> <div class="zim-object"> <pre><code class="css"> pre { color: var(--main-pre-color); margin-left: 20px; margin-right: 5px; margin-bottom: 5px; margin-top: 5px; font-family: monospace; font-size: large } </code></pre> </div> <br> <p> that will ended with a result quite similar to what you see in zim :<br> <img src="./Wize_Doc_files/wise_demo_verbatim_standard.png"> </p> <p> Now we have this in zim-override.css </p> <div class="zim-object"> <pre><code class="css"> pre { background-color: #EFEFEF; padding: 5px; border: solid #aaa 1px; border-radius: 4px; } </code></pre> </div> <br> <p> and we have the following result :<br> <img src="./Wize_Doc_files/wise_demo_verbatim_override.png"> </p> <br> <h3>JS file notice.js</h3> <p> This file is a small piece of javascript code used to write a short notice at the end of the pages. By default it writes an empty string. <br> For example let's write this : </p> <div class="zim-object"> <pre><code class="js">printNotice = function() { /* You may put into variable notice a short text that will * appears at the end of the page, that can be for example * a confidentiality warning or anything */ var notice = "This document is a wize export of a <a href='https://zim-wiki.org/'>zim</a> notebook!"; /*"";*/ document.getElementById('foot-notice').innerHTML = notice; } </code></pre> </div> <br> <p> And we will have at the end of each page :<br> <img src="./Wize_Doc_files/wise_demo_notice.png"> </p> <h3>Complement : in doc configuration</h3> <p> Some "in document" configurations using special <b>H5</b> headers have been introduced for the Wize_S5 template, but these are available for all. Look at <a href="./Wize_Presentation.html" title="Wize Presentation" class="page">Wize Presentation</a> for their descriptions. </p> <h3>Applying the new theme</h3> <p> To apply your custom theme, you just have to enter : </p> <pre> $ wize.rb -a mytheme </pre> <br> <br> </div> <br /> <div class='page-footer'> <a name="attach"></a> <b class="bold-footer">Fichiers liés</b> <table> <tr><td><a href='./Wize_Doc_files/tournesol.jpeg'>tournesol.jpeg</a></td><td> </td><td>16.0kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example1.png'>wise_demo_example1.png</a></td><td> </td><td>13.3kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example2.png'>wise_demo_example2.png</a></td><td> </td><td>15.6kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example3.png'>wise_demo_example3.png</a></td><td> </td><td>16.8kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example4.png'>wise_demo_example4.png</a></td><td> </td><td>14.7kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example5.png'>wise_demo_example5.png</a></td><td> </td><td>24.4kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example6.png'>wise_demo_example6.png</a></td><td> </td><td>26.1kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example7.png'>wise_demo_example7.png</a></td><td> </td><td>31.7kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_example8.png'>wise_demo_example8.png</a></td><td> </td><td>24.3kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_fond.png'>wise_demo_fond.png</a></td><td> </td><td>47.3kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_gototop.png'>wise_demo_gototop.png</a></td><td> </td><td>21.0kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_logo.png'>wise_demo_logo.png</a></td><td> </td><td>28.9kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_notice.png'>wise_demo_notice.png</a></td><td> </td><td>8.73kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_verbatim_override.png'>wise_demo_verbatim_override.png</a></td><td> </td><td>21.9kb</td></tr> <tr><td><a href='./Wize_Doc_files/wise_demo_verbatim_standard.png'>wise_demo_verbatim_standard.png</a></td><td> </td><td>23.4kb</td></tr> <tr><td><a href='./Wize_Doc_files/wize_headers.png'>wize_headers.png</a></td><td> </td><td>8.69kb</td></tr> <tr><td><a href='./Wize_Doc_files/zim_navigation_3.png'>zim_navigation_3.png</a></td><td> </td><td>17.2kb</td></tr> </table> <div id="foot-notice" class="notice"></div> </div> </div> <script src="./Wize_Doc_files/_resources/common/go-hljs.js"></script> <script>printNotice()</script> <script> tagToInfo(); tagToStyle(); </script> <script> /* Get the button */ var upButton = document.getElementById("upBtn"); /* When the user scrolls call our scrollFunction */ window.onscroll = function() {scrollFunction()}; </script> </body> </html>