You guys have left me in your wake with all your suggestions, tidying up code (thanks Edward) and discussion of other mods. Unfortunately, I'll make this worse over the next two weeks since I'll be travelling overseas with poorer communication options.
Since there seem to be several people testing Viewrendered2, there is a problem in that the plugin itself doesn't have a good docstring for the plugin help functionality. I'll fix this with a pull request sometime. However, I've put a rough version of the additional manual materials below - hopefully this will help in the short term.
I've also added the example Leo outline (VR2test.leo) that I used to generate the screenshots. Note that the @thin file included shouldn't be refreshed from disk since this won't be in your file system at this location, but I think it should still show what is intended.
I think there was a question about the css that I used to make the html look the way I like (it should still work fine without this css stuff though!). I've attached css.zip, which should be unzipped and the resulting css folder placed in the same folder as VR2test.leo. Much of this already comes from Leo, but the leo_vr.css is the main one for this. VR2test.leo has a built-in setting to find this css file if you include this css directory as described.
Also, for those more adventurous, the slideshow option outputs an s5 html slideshow which requires the correct javascript and support files. I've attached ui.zip from which the 'ui' folder should also be placed into the VR2test.leo folder. I think this is still the normal s5 support folder unmodified by me. However, it should be noted that without a specific patch I created, docutils doesn't really produce nice slides out of arbitrary tree of nodes.
Note that the text below is valid reST and if you paste it into a node, should produce a more readable version in viewrendered or viewrendered2.
Preliminaries
============
* Viewrendered2 is a replacement for Viewrendered. They can't co-exist.
* The existing viewrendered commands are still valid and no additional commands have been added.
* Extra settings specific to Viewrendered2 have been added.
* I have not tested the plugin on Python 3.
Using the Toolbar
=================
:Go Back: Browser-style navigation
:Go Forward: Browser-style navigation
..
:Reload: Force an update the rendering of the selection node or tree. This button is used to manually update the This can be also be used to revert to the original view after having followed a web-link in the pane.
..
:Options toolbutton: Shows a menu of rendering options as follows:
..
:Whole tree: Check this to render the whole tree rather than the node.
:Verbose logging: Provide more verbose logging of the rendering process.
:Auto-update: Check to automatically rerender when changes are made.
:Lock to node: Lock the rendered node/tree while another node is editted.
:Show as slideshow: Show a tree as an s5 slideshow (requires s5 support files).
:Visible code: Show the code designated by ``@language`` directives.
:Execute code: Execute ``@language`` code blocks and show the output. When this option is switched on, "Auto-update" is switched off automatically. This helps to prevent unexpected execution of node code when navigating the outline.
:Code output reST: Assume code execution text output is reStructuredText.
..
:Export button: Show this in the default web-browser.
If the default browser is not already open it will be started. Exporting is useful for full-screen slideshows and also for using the printing and saving functions of the browser. Exporting leaves the file ``leo.html`` in the current ``path`` of the root node for the render. This is what the browser renders and this can also be used to save for other purposes.
:Title: The title of the root of the node or tree being rendered is shown on the right of the toolbar so that the title node can still be identified, even if the rendered title has been scrolled out of view.
Keyboard Shortcuts
==================
:``ctl-c``: Copy highlighted html from the pane to the clipboard
:``ctl-+``: Zoom in
:``ctl--``: Zoom out
:``ctl-0``: Zoom to original size
Notebook Execution
==================
A form of "Notebook" functionality can be achieved by setting the *code options* in the Options toolbutton menu. A Notebook is defined here as a Leo node tree containing a combination of reST nodes and code nodes that, when rendered with Viewrendered2, shows the formatted output combination of text, code, and executed code output text. Multiple code nodes share the same namespace during execution, so any variables or objects created in one node are available to all subsequent nodes. However, an individual node's code-execution output appears in the correct position (node with the tree) in the rendered output.
Potential use cases are:
:Documented calculations: ("Visible code" checked, "Execute code" checked, "Code outputs reST" unchecked)
Calculations are documented in formatted text, calculations are performed as part of the viewing operation ("Reload" button), the code is shown, but the output is simple text. Charts and other images generated by the code are explicitly saved as a file and shown within the formatted text described by reST (e.g. using ``.. image::`` directives). Code and reST nodes are distinguished by the ``@language`` directives in force at the node. The headings of nodes containing code are shown.
:Dashboards or Reports: ("Visible code" unchecked, "Execute code" checked, "Code outputs reST" checked)
This mode aims to have a polished rendered output by not showing any of the code, but does show its execution output. The code is specifically designed to output reST and so has the full range of reST formatting capability. The node headers containing the code are *NOT* shown.
Settings
========
- ``@bool vr_verbose = False``
The initial state of "Verbose logging" on the Options toolbutton.
- ``@bool vr_auto_update = True``
The initial state of "Auto-update" on the Options toolbutton.
- ``@bool vr_lock_node = False``
The initial state of "Lock to node" on the Options toolbutton.
- ``@bool vr_slideshow = False``
The initial state of "Show as slideshow" on the Options toolbutton.
- ``@bool vr_visible_code = True``
The initial state of "Visible code" on the Options toolbutton.
- ``@bool vr_execute_code = False``
The initial state of "Execute code" on the Options toolbutton.
- ``@bool vr_rest_code_output = False``
The initial state of "Code outputs reST" on the Options toolbutton.
**System Settings**
- ``@string vr_stylesheet_path =``
The complete path to the stylesheet file. If the path is an empty string, then the docutils default stylesheet will be used.
- ``@string vr_math_output = mathjax``
The docutils math rendering type in the html. See docutils options.
- ``@int vr_halt_level = 6``
The level of docutils processing error for rendering to halt. See docutils documentation.
- ``@int vr_report_level = 5``
The level of docutils processing error for reporting to occur. See docutils documentation.
- ``@bool vr_smart_quotes = True``
The level of docutils processing error for reporting to occur. See docutils documentation.
- ``@bool vr_embed_stylesheet = True``
The docutils option of whether to embed the stylesheet in the html output.
- ``@bool vr_xml_declaration = False``
The docutils option of whether to include the xml declaration. Setting to False helps compatibility with MS Office importing. It doesn't affect the rendering in the Viewrendered2 pane.