The best way to collect debugging information is to build the site locally. However if that isn’t an option, this page documents tags which can be helpful.
Echo
This echo
include just prints its arguments, for debugging/learning purposes. This can be helpful in understanding Liquid syntax and how strings are being read internally by an include
.
Arguments are printed as a comma-separated list of "argument"==>"value"
pairs.
Note that liquid allows the passing of arbitrary arguments to include
templates. All these arguments will be stored, but won’t have any effect unless the include
’s source actually does something with those arguments.
{"content"=>"This is the content argument", "bracket"=>"what if I pass {}?", "gorilla"=>"Why do we have a gorilla argument?"}
What’s in a page
?
Ever wonder what all is part of the page
data structure? Let’s find out!
(You can also do this with the site
data structure, but be warned: the output will include every page body across the whole site!)
{"p"=>{ "path": "_pages/editing/debugging.md", "relative_path": "_pages/editing/debugging.md", "excerpt": "
The best way to collect debugging information is to <a href=\"/editing/advanced\">build the site locally</a>. However if that isn’t an option, this page documents tags which can be helpful.
\n\n", "previous": { "path": "_pages/editing/code.md", "relative_path": "_pages/editing/code.md", "excerpt": "This page describes nice ways of embedding source code in a page.
\n\n", "previous": { "path": "_pages/editing/citations.md", "relative_path": "_pages/editing/citations.md", "excerpt": "This page demonstrates how to add a citation to your page.
\n\n", "previous": { "path": "_pages/editing/buttons.md", "relative_path": "_pages/editing/buttons.md", "id": "/editing/buttons", "collection": "pages", "url": "/editing/buttons", "draft": false, "categories": [ ], "title": "Buttons", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "buttons", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "id": "/editing/citations", "collection": "pages", "next": { "path": "_pages/editing/code.md", "relative_path": "_pages/editing/code.md", "id": "/editing/code", "collection": "pages", "url": "/editing/code", "draft": false, "categories": [ ], "title": "Source Code", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "code", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "output": "<!DOCTYPE html>\n\n\t\n\t\tμManager Documentation
\n- \n
- <a href=\"/news/index\">News</a> \n\n\n
- \n
<a href=\"/Download_Micro-Manager_Latest_Release\">Downloads</a>
- \n
- <a href=\"/Micro-Manager_Nightly_Builds\">Nightly Builds</a> \n
- <a href=\"/Micro-Manager_Version_Archive\">Old Releases</a> \n
- <a href=\"/Micro-Manager_Installation_Notes\">Installation Notes</a> \n
- <a href=\"/Micro-Manager_Source_Code\">Source Code</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Project_Overview\">Learn</a>
- \n \n
- \n
<a href=\"/Micro-Manager_Project_Overview\">Overview</a>
- \n
- <a href=\"/Why_Micro-Manager\">Why Micro-Manager?</a> \n
- <a href=\"/Who_should_use_Micro-Manager\">Who should use Micro-Manager</a> \n
\n\n\n \n - \n
<a href=\"/Version_2.0\">Version 2.0</a>
- \n
- <a href=\"/Version_2.0_Users_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Version_2.0_Plugins\">Plugins</a> \n
- <a href=\"/Version_2.0_FAQ\">FAQ</a> \n
- <a href=\"/Version_2.0_More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Version_2.0_API\">API</a> \n
- <a href=\"/Version_2.0_API_Transition_Guide\">API Transition Guide</a> \n
- <a href=\"/Version_2.0_API_How_do_I\">API, How do I?</a> \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">Javadoc</a> \n
- <a href=\"/Version_2.0_API_Events\">API Events</a> \n
- <a href=\"/Version_2.0_Plugins\">Writing Plugins</a> \n
- <a href=\"/Version_2.0_Scripts\">Scripting</a> \n
\n\n\n \n - \n
<a href=\"/Overview_of_the_documentation\">Version 1.4</a>
- \n
- <a href=\"/Micro-Manager_User's_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Plugins\">Plugins</a> \n
- <a href=\"http://valelab4.ucsf.edu/publications/2010EdelsteinCurrProt.pdf\">Tutorial (PDF)</a> \n
- <a href=\"http://www.jbmethods.org/jbm/article/view/36/29\">Advanced Methods</a> \n
- <a href=\"/Micro-Manager_FAQ-new\">FAQ</a> \n
- <a href=\"/More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Screencasts\">Video Screencasts</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Programming_Guide\">Extend</a>
- \n
- <a href=\"/Script_Panel_GUI\">Scripting (Beanshell)</a> \n
- <a href=\"/Example_Beanshell_scripts\">Example Beanshell scripts</a> \n
- <a href=\"/Writing_plugins_for_Micro-Manager\">Writing Plugins</a> \n
- <a href=\"/Using_the_Micro-Manager_python_library\">Python</a> \n
- <a href=\"/Matlab\">Matlab</a> \n
- <a href=\"/Micro-Manager_File_Formats\">File Formats</a> \n
- <a href=\"/Search_Paths\">Search Paths</a> \n
- <a href=\"/Building_Micro-Manager_Device_Adapters\">Writing Device Adapters</a> \n
- <a href=\"/Free_third-party_tools_for_testing_communications_with_hardware\">Testing communication with hardware</a> \n
- <a href=\"/Building_and_debugging_Micro-Manager_source_code\">Building and Debugging Micro-Manager</a> \n
- <a href=\"/Multi-Dimensional_Acquisition_Programming\">Multi-D Acq. Programming</a> \n
- <a href=\"/Policies_for_inclusion_of_source_code\">Policies for inclusion of source code</a> \n
- <a href=\"https://github.com/micro-manager\">Source code repository history and tickets</a> \n
- \n
APIs
- \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">2.0 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmstudio/1.4/org/micromanager/api/ScriptInterface.html\">1.4 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmcorej/latest/mmcorej/CMMCore.html\">Core API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/MMCore/latest/class_c_m_m_core.html\">Core API Reference (C++)</a> \n
- <a href=\"/apidoc/MMDevice/latest/class_m_m_1_1_device.html\">Device API Reference (C++)</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Device_Support\">Devices</a>
- \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Community\">Support</a>
- \n
- <a href=\"/Contact\">Contact</a> \n
- <a href=\"/System_Integrators\">System Integrators</a> \n
- <a href=\"/Programming_Services\">Programming Services</a> \n
- \n
<a href=\"/editing/\">Editing the Wiki</a>
- \n
- <a href=\"/editing/advanced\">Advanced editing</a> \n
- <a href=\"/editing/buttons\">Buttons</a> \n
- <a class=\"current-page\">Citations</a> \n
- <a href=\"/editing/code\">Source Code</a> \n
- <a href=\"/editing/headers\">Headers</a> \n
- <a href=\"/editing/icons\">Icons</a> \n
- <a href=\"/editing/images\">Images</a> \n
- <a href=\"/editing/keys\">Keyboard Shortcuts</a> \n
- <a href=\"/editing/linking\">Linking</a> \n
- <a href=\"/editing/math\">Math Expressions</a> \n
- <a href=\"/editing/notices\">Notices</a> \n
- <a href=\"/editing/pitfalls\">Pitfalls</a> \n
- <a href=\"/editing/symbols\">Symbols</a> \n
- <a href=\"/editing/tables\">Tables</a> \n
- <a href=\"/editing/videos\">Videos</a> \n
- <a href=\"/editing/whitespace\">Whitespace</a> \n
\n \n
\n\n\n\n - \n
<a href=\"/Credits\">Credits</a>
- \n
- <a href=\"/Papers_citing_Micro-Manager\">Papers citing MicroManager</a> \n
- <a href=\"/Citing_Micro-Manager\">How to cite MicroManager</a> \n
\n\n\n
Citations
\n\t\t\t</header>\n\t\t</div>\n\n\t<section id=\"right-column\" class=\"sidebar dock\">\n\t\t\t\n\t\t\t<div id=\"toc\" class=\"toc menu dockable\">\n\t\t\t\t<div class=\"drag-handle\"></div>\n\t\t\t\tPage contents
\n\t\t\t\t<ul data-toc=\"#content\" data-toc-headings=\"h1,h2,h3,h4,h5,h6\"></ul>\n\t\t\t</div>\n\t\t</section>\n\n\t\t\n\t\t<div id=\"nav-bar\"><ul class=\"shadowed-box\">This page demonstrates how to add a citation to your page.
\n\n<code class=\"language-plaintext highlighter-rouge\">include citation</code> allows you to create a single-use citation, or footnote.
\n\n<h2 id=\"include-citations\">Include Citations</h2>\n\n<h3 id=\"usage\">Usage</h3>\nThis include creates a citation given the following inputs:\nauthor (all authors of the publication, this input will be presented as entered):
\ntitle title of the publication
\nurl url link to location the publication is hosted
\nyear year of publication
\njournal name of the publishing journal
\nvolume volume of the publishing journal
\nnumber issuing number of the publishing journal
\npages page numbers that the publication appears in publishing journal
\ndoi digital object identifier
\nfn foot note number
The following liquid code:
\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\">\n{% include cite content='journal' author='Albert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas'\nyear='2012'\ntitle='TrakEM2 software for neural circuit reconstruction' journal='PLoS ONE'\nurl='http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011'\ndoi='10.1371/journal.pone.0038011' %}\n\n
</pre></div></div>\nproduces:
\n\nAlbert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas (2012), “<a href=\"http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011\">TrakEM2 software for neural circuit reconstruction</a>”, PLoS ONE , doi:<a href=\"https://dx.doi.org/10.1371/journal.pone.0038011\">10.1371/journal.pone.0038011</a>.
\n\n<h2 id=\"creating-footnotes\">Creating footnotes</h2>\n\n<h3 id=\"in-your-document\">In your document</h3>\nUse the <a href=\"https://kramdown.gettalong.org/quickref.html#footnotes\">kramdown syntax</a> in your document to refer to footnotes by number.
\n\nNB: regardless of where the liquid reference appears in your document, footnote text will always be at the bottom.
\n\n<h3 id=\"in-your-citation\">In your citation</h3>\n\nSpecify the footnote number in the <code class=\"language-plaintext highlighter-rouge\">include</code>.
\n\nThe following markdown and liquid code:
\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\">This is a reference[^1].\n\n\n{% include cite content='journal' author='Albert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas'\nyear='2012'\nfn='1'\ntitle='TrakEM2 software for neural circuit reconstruction' journal='PLoS ONE'\nurl='http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011'\ndoi='10.1371/journal.pone.0038011' %}\n\n
</pre></div></div>\nproduces:
\n\nThis is a reference<sup id=\"fnref:1\" role=\"doc-noteref\"><a href=\"#fn:1\" class=\"footnote\" rel=\"footnote\">1</a></sup>.
\n\n<div class=\"footnotes\" role=\"doc-endnotes\">\n- \n <li id=\"fn:1\" role=\"doc-endnote\">\n
Albert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas (2012), “<a href=\"http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011\">TrakEM2 software for neural circuit reconstruction</a>”, PLoS ONE , doi:<a href=\"https://dx.doi.org/10.1371/journal.pone.0038011\">10.1371/journal.pone.0038011</a>. <a href=\"#fnref:1\" class=\"reversefootnote\" role=\"doc-backlink\">↩</a>
\n </li>\nμManager Documentation
\n- \n
- <a href=\"/news/index\">News</a> \n\n\n
- \n
<a href=\"/Download_Micro-Manager_Latest_Release\">Downloads</a>
- \n
- <a href=\"/Micro-Manager_Nightly_Builds\">Nightly Builds</a> \n
- <a href=\"/Micro-Manager_Version_Archive\">Old Releases</a> \n
- <a href=\"/Micro-Manager_Installation_Notes\">Installation Notes</a> \n
- <a href=\"/Micro-Manager_Source_Code\">Source Code</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Project_Overview\">Learn</a>
- \n \n
- \n
<a href=\"/Micro-Manager_Project_Overview\">Overview</a>
- \n
- <a href=\"/Why_Micro-Manager\">Why Micro-Manager?</a> \n
- <a href=\"/Who_should_use_Micro-Manager\">Who should use Micro-Manager</a> \n
\n\n\n \n - \n
<a href=\"/Version_2.0\">Version 2.0</a>
- \n
- <a href=\"/Version_2.0_Users_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Version_2.0_Plugins\">Plugins</a> \n
- <a href=\"/Version_2.0_FAQ\">FAQ</a> \n
- <a href=\"/Version_2.0_More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Version_2.0_API\">API</a> \n
- <a href=\"/Version_2.0_API_Transition_Guide\">API Transition Guide</a> \n
- <a href=\"/Version_2.0_API_How_do_I\">API, How do I?</a> \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">Javadoc</a> \n
- <a href=\"/Version_2.0_API_Events\">API Events</a> \n
- <a href=\"/Version_2.0_Plugins\">Writing Plugins</a> \n
- <a href=\"/Version_2.0_Scripts\">Scripting</a> \n
\n\n\n \n - \n
<a href=\"/Overview_of_the_documentation\">Version 1.4</a>
- \n
- <a href=\"/Micro-Manager_User's_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Plugins\">Plugins</a> \n
- <a href=\"http://valelab4.ucsf.edu/publications/2010EdelsteinCurrProt.pdf\">Tutorial (PDF)</a> \n
- <a href=\"http://www.jbmethods.org/jbm/article/view/36/29\">Advanced Methods</a> \n
- <a href=\"/Micro-Manager_FAQ-new\">FAQ</a> \n
- <a href=\"/More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Screencasts\">Video Screencasts</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Programming_Guide\">Extend</a>
- \n
- <a href=\"/Script_Panel_GUI\">Scripting (Beanshell)</a> \n
- <a href=\"/Example_Beanshell_scripts\">Example Beanshell scripts</a> \n
- <a href=\"/Writing_plugins_for_Micro-Manager\">Writing Plugins</a> \n
- <a href=\"/Using_the_Micro-Manager_python_library\">Python</a> \n
- <a href=\"/Matlab\">Matlab</a> \n
- <a href=\"/Micro-Manager_File_Formats\">File Formats</a> \n
- <a href=\"/Search_Paths\">Search Paths</a> \n
- <a href=\"/Building_Micro-Manager_Device_Adapters\">Writing Device Adapters</a> \n
- <a href=\"/Free_third-party_tools_for_testing_communications_with_hardware\">Testing communication with hardware</a> \n
- <a href=\"/Building_and_debugging_Micro-Manager_source_code\">Building and Debugging Micro-Manager</a> \n
- <a href=\"/Multi-Dimensional_Acquisition_Programming\">Multi-D Acq. Programming</a> \n
- <a href=\"/Policies_for_inclusion_of_source_code\">Policies for inclusion of source code</a> \n
- <a href=\"https://github.com/micro-manager\">Source code repository history and tickets</a> \n
- \n
APIs
- \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">2.0 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmstudio/1.4/org/micromanager/api/ScriptInterface.html\">1.4 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmcorej/latest/mmcorej/CMMCore.html\">Core API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/MMCore/latest/class_c_m_m_core.html\">Core API Reference (C++)</a> \n
- <a href=\"/apidoc/MMDevice/latest/class_m_m_1_1_device.html\">Device API Reference (C++)</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Device_Support\">Devices</a>
- \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Community\">Support</a>
- \n
- <a href=\"/Contact\">Contact</a> \n
- <a href=\"/System_Integrators\">System Integrators</a> \n
- <a href=\"/Programming_Services\">Programming Services</a> \n
- \n
<a href=\"/editing/\">Editing the Wiki</a>
- \n
- <a href=\"/editing/advanced\">Advanced editing</a> \n
- <a href=\"/editing/buttons\">Buttons</a> \n
- <a class=\"current-page\">Citations</a> \n
- <a href=\"/editing/code\">Source Code</a> \n
- <a href=\"/editing/headers\">Headers</a> \n
- <a href=\"/editing/icons\">Icons</a> \n
- <a href=\"/editing/images\">Images</a> \n
- <a href=\"/editing/keys\">Keyboard Shortcuts</a> \n
- <a href=\"/editing/linking\">Linking</a> \n
- <a href=\"/editing/math\">Math Expressions</a> \n
- <a href=\"/editing/notices\">Notices</a> \n
- <a href=\"/editing/pitfalls\">Pitfalls</a> \n
- <a href=\"/editing/symbols\">Symbols</a> \n
- <a href=\"/editing/tables\">Tables</a> \n
- <a href=\"/editing/videos\">Videos</a> \n
- <a href=\"/editing/whitespace\">Whitespace</a> \n
\n \n
\n\n\n\n - \n
<a href=\"/Credits\">Credits</a>
- \n
- <a href=\"/Papers_citing_Micro-Manager\">Papers citing MicroManager</a> \n
- <a href=\"/Citing_Micro-Manager\">How to cite MicroManager</a> \n
\n\n\n
This page demonstrates how to add a citation to your page.
\n\n<code class=\"language-plaintext highlighter-rouge\">include citation</code> allows you to create a single-use citation, or footnote.
\n\n<h2 id=\"include-citations\">Include Citations</h2>\n\n<h3 id=\"usage\">Usage</h3>\nThis include creates a citation given the following inputs:\nauthor (all authors of the publication, this input will be presented as entered):
\ntitle title of the publication
\nurl url link to location the publication is hosted
\nyear year of publication
\njournal name of the publishing journal
\nvolume volume of the publishing journal
\nnumber issuing number of the publishing journal
\npages page numbers that the publication appears in publishing journal
\ndoi digital object identifier
\nfn foot note number
The following liquid code:
\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\">\n{% include cite content='journal' author='Albert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas'\nyear='2012'\ntitle='TrakEM2 software for neural circuit reconstruction' journal='PLoS ONE'\nurl='http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011'\ndoi='10.1371/journal.pone.0038011' %}\n\n
</pre></div></div>\nproduces:
\n\nAlbert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas (2012), “<a href=\"http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011\">TrakEM2 software for neural circuit reconstruction</a>”, PLoS ONE , doi:<a href=\"https://dx.doi.org/10.1371/journal.pone.0038011\">10.1371/journal.pone.0038011</a>.
\n\n<h2 id=\"creating-footnotes\">Creating footnotes</h2>\n\n<h3 id=\"in-your-document\">In your document</h3>\nUse the <a href=\"https://kramdown.gettalong.org/quickref.html#footnotes\">kramdown syntax</a> in your document to refer to footnotes by number.
\n\nNB: regardless of where the liquid reference appears in your document, footnote text will always be at the bottom.
\n\n<h3 id=\"in-your-citation\">In your citation</h3>\n\nSpecify the footnote number in the <code class=\"language-plaintext highlighter-rouge\">include</code>.
\n\nThe following markdown and liquid code:
\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\">This is a reference[^1].\n\n\n{% include cite content='journal' author='Albert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas'\nyear='2012'\nfn='1'\ntitle='TrakEM2 software for neural circuit reconstruction' journal='PLoS ONE'\nurl='http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011'\ndoi='10.1371/journal.pone.0038011' %}\n\n
</pre></div></div>\nproduces:
\n\nThis is a reference<sup id=\"fnref:1\" role=\"doc-noteref\"><a href=\"#fn:1\" class=\"footnote\" rel=\"footnote\">1</a></sup>.
\n\n<div class=\"footnotes\" role=\"doc-endnotes\">\n- \n <li id=\"fn:1\" role=\"doc-endnote\">\n
Albert Cardona, Stephan Saalfeld, Johannes Schindelin, Ignacio Arganda-Carreras, Stephan Preibisch, Mark Longair, Pavel Tomancak, Volker Hartenstein and Rodney J. Douglas (2012), “<a href=\"http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0038011\">TrakEM2 software for neural circuit reconstruction</a>”, PLoS ONE , doi:<a href=\"https://dx.doi.org/10.1371/journal.pone.0038011\">10.1371/journal.pone.0038011</a>. <a href=\"#fnref:1\" class=\"reversefootnote\" role=\"doc-backlink\">↩</a>
\n </li>\nThe best way to collect debugging information is to <a href=\"/editing/advanced\">build the site locally</a>. However if that isn’t an option, this page documents tags which can be helpful.
\n\n", "previous": { "path": "_pages/editing/code.md", "relative_path": "_pages/editing/code.md", "id": "/editing/code", "collection": "pages", "url": "/editing/code", "draft": false, "categories": [ ], "title": "Source Code", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "code", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "id": "/editing/debugging", "collection": "pages", "next": { "path": "_pages/editing/headers.md", "relative_path": "_pages/editing/headers.md", "id": "/editing/headers", "collection": "pages", "url": "/editing/headers", "draft": false, "categories": [ ], "title": "Headers", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "headers", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "output": null, "content": "The best way to collect debugging information is to [build the site locally](/editing/advanced). However if that isn't an option, this page documents tags which can be helpful.\n\n## Echo\n\nThis `echo` include just prints its arguments, for debugging/learning purposes. This can be helpful in understanding Liquid syntax and how strings are being read internally by an `include`.\n\nArguments are printed as a comma-separated list of `\"argument\"==>\"value\"` pairs.\n\nNote that liquid allows the passing of [arbitrary arguments](https://jekyllrb.com/docs/includes/) to `include` templates. All these arguments will be stored, but won't have any effect unless the `include`'s [source](https://github.com/micro-manager/micro-manager.github.io/tree/main/_includes) actually does something with those arguments.\n\n{% highlight liquid %}{% raw %}{% include echo content=\"This is the content argument\" bracket=\"what if I pass {}?\" gorilla=\"Why do we have a gorilla argument?\" %}{% endraw %}{% endhighlight %}\n{% include echo content=\"This is the content argument\" bracket=\"what if I pass {}?\" gorilla=\"Why do we have a gorilla argument?\" %}\n\n### What's in a `page`?\n\n{% include notice icon=\"tech\" content=\"Ever wonder what all is part of the `page` data structure? Let's find out!\n\n(You can also do this with the `site` data structure, but be warned: the output will include every page body across the whole site!)\" %}\n\n{% highlight liquid %}{% raw %}{% include echo p=page %}{% endraw %}{% endhighlight %}\n{% include echo p=page %}\n", "url": "/editing/debugging", "draft": false, "categories": [ ], "title": "Debugging", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "debugging", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "output": "<!DOCTYPE html>\n\n\t\n\t\tμManager Documentation
\n- \n
- <a href=\"/news/index\">News</a> \n\n\n
- \n
<a href=\"/Download_Micro-Manager_Latest_Release\">Downloads</a>
- \n
- <a href=\"/Micro-Manager_Nightly_Builds\">Nightly Builds</a> \n
- <a href=\"/Micro-Manager_Version_Archive\">Old Releases</a> \n
- <a href=\"/Micro-Manager_Installation_Notes\">Installation Notes</a> \n
- <a href=\"/Micro-Manager_Source_Code\">Source Code</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Project_Overview\">Learn</a>
- \n \n
- \n
<a href=\"/Micro-Manager_Project_Overview\">Overview</a>
- \n
- <a href=\"/Why_Micro-Manager\">Why Micro-Manager?</a> \n
- <a href=\"/Who_should_use_Micro-Manager\">Who should use Micro-Manager</a> \n
\n\n\n \n - \n
<a href=\"/Version_2.0\">Version 2.0</a>
- \n
- <a href=\"/Version_2.0_Users_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Version_2.0_Plugins\">Plugins</a> \n
- <a href=\"/Version_2.0_FAQ\">FAQ</a> \n
- <a href=\"/Version_2.0_More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Version_2.0_API\">API</a> \n
- <a href=\"/Version_2.0_API_Transition_Guide\">API Transition Guide</a> \n
- <a href=\"/Version_2.0_API_How_do_I\">API, How do I?</a> \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">Javadoc</a> \n
- <a href=\"/Version_2.0_API_Events\">API Events</a> \n
- <a href=\"/Version_2.0_Plugins\">Writing Plugins</a> \n
- <a href=\"/Version_2.0_Scripts\">Scripting</a> \n
\n\n\n \n - \n
<a href=\"/Overview_of_the_documentation\">Version 1.4</a>
- \n
- <a href=\"/Micro-Manager_User's_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Plugins\">Plugins</a> \n
- <a href=\"http://valelab4.ucsf.edu/publications/2010EdelsteinCurrProt.pdf\">Tutorial (PDF)</a> \n
- <a href=\"http://www.jbmethods.org/jbm/article/view/36/29\">Advanced Methods</a> \n
- <a href=\"/Micro-Manager_FAQ-new\">FAQ</a> \n
- <a href=\"/More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Screencasts\">Video Screencasts</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Programming_Guide\">Extend</a>
- \n
- <a href=\"/Script_Panel_GUI\">Scripting (Beanshell)</a> \n
- <a href=\"/Example_Beanshell_scripts\">Example Beanshell scripts</a> \n
- <a href=\"/Writing_plugins_for_Micro-Manager\">Writing Plugins</a> \n
- <a href=\"/Using_the_Micro-Manager_python_library\">Python</a> \n
- <a href=\"/Matlab\">Matlab</a> \n
- <a href=\"/Micro-Manager_File_Formats\">File Formats</a> \n
- <a href=\"/Search_Paths\">Search Paths</a> \n
- <a href=\"/Building_Micro-Manager_Device_Adapters\">Writing Device Adapters</a> \n
- <a href=\"/Free_third-party_tools_for_testing_communications_with_hardware\">Testing communication with hardware</a> \n
- <a href=\"/Building_and_debugging_Micro-Manager_source_code\">Building and Debugging Micro-Manager</a> \n
- <a href=\"/Multi-Dimensional_Acquisition_Programming\">Multi-D Acq. Programming</a> \n
- <a href=\"/Policies_for_inclusion_of_source_code\">Policies for inclusion of source code</a> \n
- <a href=\"https://github.com/micro-manager\">Source code repository history and tickets</a> \n
- \n
APIs
- \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">2.0 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmstudio/1.4/org/micromanager/api/ScriptInterface.html\">1.4 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmcorej/latest/mmcorej/CMMCore.html\">Core API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/MMCore/latest/class_c_m_m_core.html\">Core API Reference (C++)</a> \n
- <a href=\"/apidoc/MMDevice/latest/class_m_m_1_1_device.html\">Device API Reference (C++)</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Device_Support\">Devices</a>
- \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Community\">Support</a>
- \n
- <a href=\"/Contact\">Contact</a> \n
- <a href=\"/System_Integrators\">System Integrators</a> \n
- <a href=\"/Programming_Services\">Programming Services</a> \n
- \n
<a href=\"/editing/\">Editing the Wiki</a>
- \n
- <a href=\"/editing/advanced\">Advanced editing</a> \n
- <a href=\"/editing/buttons\">Buttons</a> \n
- <a href=\"/editing/citations\">Citations</a> \n
- <a class=\"current-page\">Source Code</a> \n
- <a href=\"/editing/headers\">Headers</a> \n
- <a href=\"/editing/icons\">Icons</a> \n
- <a href=\"/editing/images\">Images</a> \n
- <a href=\"/editing/keys\">Keyboard Shortcuts</a> \n
- <a href=\"/editing/linking\">Linking</a> \n
- <a href=\"/editing/math\">Math Expressions</a> \n
- <a href=\"/editing/notices\">Notices</a> \n
- <a href=\"/editing/pitfalls\">Pitfalls</a> \n
- <a href=\"/editing/symbols\">Symbols</a> \n
- <a href=\"/editing/tables\">Tables</a> \n
- <a href=\"/editing/videos\">Videos</a> \n
- <a href=\"/editing/whitespace\">Whitespace</a> \n
\n \n
\n\n\n\n - \n
<a href=\"/Credits\">Credits</a>
- \n
- <a href=\"/Papers_citing_Micro-Manager\">Papers citing MicroManager</a> \n
- <a href=\"/Citing_Micro-Manager\">How to cite MicroManager</a> \n
\n\n\n
Source Code
\n\t\t\t</header>\n\t\t</div>\n\n\t<section id=\"right-column\" class=\"sidebar dock\">\n\t\t\t\n\t\t\t<div id=\"toc\" class=\"toc menu dockable\">\n\t\t\t\t<div class=\"drag-handle\"></div>\n\t\t\t\tPage contents
\n\t\t\t\t<ul data-toc=\"#content\" data-toc-headings=\"h1,h2,h3,h4,h5,h6\"></ul>\n\t\t\t</div>\n\t\t</section>\n\n\t\t\n\t\t<div id=\"nav-bar\"><ul class=\"shadowed-box\">This page describes nice ways of embedding source code in a page.
\n\n<h2 id=\"inline-code-snippets\">Inline code snippets</h2>\n\nIf you just want to write a short snippet of code as part of a sentence,\nsurround the code in backtick symbols (`
).
Code
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\">Type `print('Hello world!')` and save as `hello.py`.</code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\nType <code class=\"language-plaintext highlighter-rouge\">print('Hello world!')</code> and save as <code class=\"language-plaintext highlighter-rouge\">hello.py</code>.
\n\nA “code fence” is three backtick symbols (```
) preceding your\ncode, and another three concluding it. Optionally, you can write the name of\nthe language in small case next to the leading fence to declare syntax\nhighlighting is desired with the stated language.
Code
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\">```java\nImage3DUniverse univ = new Image3DUniverse();\nuniv.show();\nuniv.addMesh(yourImagePlus, null, \"somename\", 50,\n new boolean[] {true, true, true}, 2);\n```</code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n <div class=\"language-java highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><span class=\"nc\">Image3DUniverse</span> <span class=\"n\">univ</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nc\">Image3DUniverse</span><span class=\"o\">();</span>\n<span class=\"n\">univ</span><span class=\"o\">.</span><span class=\"na\">show</span><span class=\"o\">();</span>\n<span class=\"n\">univ</span><span class=\"o\">.</span><span class=\"na\">addMesh</span><span class=\"o\">(</span><span class=\"n\">yourImagePlus</span><span class=\"o\">,</span> <span class=\"kc\">null</span><span class=\"o\">,</span> <span class=\"s\">\"somename\"</span><span class=\"o\">,</span> <span class=\"mi\">50</span><span class=\"o\">,</span>\n <span class=\"k\">new</span> <span class=\"kt\">boolean</span><span class=\"o\">[]</span> <span class=\"o\">{</span><span class=\"kc\">true</span><span class=\"o\">,</span> <span class=\"kc\">true</span><span class=\"o\">,</span> <span class=\"kc\">true</span><span class=\"o\">},</span> <span class=\"mi\">2</span><span class=\"o\">);</span>\n
</pre>Code
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\">```python\ndef update_progress(progress):\n barLength = 10 # length of progress bar\n block = int(round(barLength*progress))\n text = f'\\rPercent complete: ' +\n f'[{\"#\"*block + \"-\"*(barLength-block)}] ' +\n f'{progress*100}%'\n sys.stdout.write(text)\n sys.stdout.flush()\n```</code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n <div class=\"language-python highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><span class=\"k\">def</span> <span class=\"nf\">update_progress</span><span class=\"p\">(</span><span class=\"n\">progress</span><span class=\"p\">):</span>\n <span class=\"n\">barLength</span> <span class=\"o\">=</span> <span class=\"mi\">10</span> <span class=\"c1\"># length of progress bar\n</span> <span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"nb\">round</span><span class=\"p\">(</span><span class=\"n\">barLength</span><span class=\"o\">*</span><span class=\"n\">progress</span><span class=\"p\">))</span>\n <span class=\"n\">text</span> <span class=\"o\">=</span> <span class=\"sa\">f</span><span class=\"s\">'</span><span class=\"se\">\\r</span><span class=\"s\">Percent complete: '</span> <span class=\"o\">+</span>\n <span class=\"sa\">f</span><span class=\"s\">'[</span><span class=\"si\">{</span><span class=\"s\">\"#\"</span><span class=\"o\">*</span><span class=\"n\">block</span> <span class=\"o\">+</span> <span class=\"s\">\"-\"</span><span class=\"o\">*</span><span class=\"p\">(</span><span class=\"n\">barLength</span><span class=\"o\">-</span><span class=\"n\">block</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s\">] '</span> <span class=\"o\">+</span>\n <span class=\"sa\">f</span><span class=\"s\">'</span><span class=\"si\">{</span><span class=\"n\">progress</span><span class=\"o\">*</span><span class=\"mi\">100</span><span class=\"si\">}</span><span class=\"s\">%'</span>\n <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">stdout</span><span class=\"p\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"n\">text</span><span class=\"p\">)</span>\n <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">stdout</span><span class=\"p\">.</span><span class=\"n\">flush</span><span class=\"p\">()</span>\n
</pre>Alternately, there is a <code class=\"language-plaintext highlighter-rouge\">highlight</code> Liquid directive you can try.\nIt looks like this:
\n\n<div class=\"code-example\">\nCode
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\"><span class=\"p\">{%</span><span class=\"w\"> </span><span class=\"nt\">highlight</span><span class=\"w\"> </span>java<span class=\"w\"> </span><span class=\"p\">%}</span>\nlog.info(\"You're a wizard, Harry!\");\nlog.error(\"I'm a what?\");\n<span class=\"p\">{%</span><span class=\"w\"> </span><span class=\"nt\">endhighlight</span><span class=\"w\"> </span><span class=\"p\">%}</span></code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n <figure class=\"highlight\"><code class=\"language-java\" data-lang=\"java\"><span class=\"n\">log</span><span class=\"o\">.</span><span class=\"na\">info</span><span class=\"o\">(</span><span class=\"s\">\"You're a wizard, Harry!\"</span><span class=\"o\">);</span>\n<span class=\"n\">log</span><span class=\"o\">.</span><span class=\"na\">error</span><span class=\"o\">(</span><span class=\"s\">\"I'm a what?\"</span><span class=\"o\">);</span></code></figure>\n\n
The <code class=\"language-plaintext highlighter-rouge\">highlight</code> directive and code fences are separate features, but\nfunctionally very similar. If code fences are not working as you like,\ngive the <code class=\"language-plaintext highlighter-rouge\">highlight</code> directive a try to see if it does any better.
\n\n<h2 id=\"embedding-code-from-github\">Embedding code from GitHub</h2>\n\nIf you have a block of code in a GitHub repository, you can embed it\ndynamically into the page using the <code class=\"language-plaintext highlighter-rouge\">github-embed</code> include. This approach has\nthe advantage of avoiding copy-paste skew as the code evolves over time.
\n\n<div class=\"code-example\">\nCode
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\"><span class=\"p\">{%</span><span class=\"w\"> </span><span class=\"nt\">include</span><span class=\"w\"> </span><span class=\"nv\">github-embed</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">org</span><span class=\"o\">=</span><span class=\"s2\">\"duckythescientist\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">repo</span><span class=\"o\">=</span><span class=\"s2\">\"obfuscatedLife\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">branch</span><span class=\"o\">=</span><span class=\"s2\">\"original\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">path</span><span class=\"o\">=</span><span class=\"s2\">\"life.c\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">label</span><span class=\"o\">=</span><span class=\"s2\">\"Conway's Obfuscated Game of Life\"</span><span class=\"w\"> </span><span class=\"p\">%}</span></code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n<a href=\"https://github.com/duckythescientist/obfuscatedLife/blob/original/life.c\">Conway’s Obfuscated Game of Life</a>
<script src=\"https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fduckythescientist%2FobfuscatedLife%2Fblob%2Foriginal%2Flife.c%23L1-99999&style=github&showBorder=on&showLineNumbers=on&showFileMeta=on&showCopy=on\"></script>
Other parameters supported by the <code class=\"language-plaintext highlighter-rouge\">github-embed</code> include are:
\n\nDefault | \n
---|
<code class=\"language-plaintext highlighter-rouge\">1</code> | \n
<code class=\"language-plaintext highlighter-rouge\">99999</code> | \n
no label | \n
<code class=\"language-plaintext highlighter-rouge\">github</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
* Valid style values are:
\n<ul style=\"display: flex; flex-wrap: wrap; list-style: none;\">\nμManager Documentation
\n- \n
- <a href=\"/news/index\">News</a> \n\n\n
- \n
<a href=\"/Download_Micro-Manager_Latest_Release\">Downloads</a>
- \n
- <a href=\"/Micro-Manager_Nightly_Builds\">Nightly Builds</a> \n
- <a href=\"/Micro-Manager_Version_Archive\">Old Releases</a> \n
- <a href=\"/Micro-Manager_Installation_Notes\">Installation Notes</a> \n
- <a href=\"/Micro-Manager_Source_Code\">Source Code</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Project_Overview\">Learn</a>
- \n \n
- \n
<a href=\"/Micro-Manager_Project_Overview\">Overview</a>
- \n
- <a href=\"/Why_Micro-Manager\">Why Micro-Manager?</a> \n
- <a href=\"/Who_should_use_Micro-Manager\">Who should use Micro-Manager</a> \n
\n\n\n \n - \n
<a href=\"/Version_2.0\">Version 2.0</a>
- \n
- <a href=\"/Version_2.0_Users_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Version_2.0_Plugins\">Plugins</a> \n
- <a href=\"/Version_2.0_FAQ\">FAQ</a> \n
- <a href=\"/Version_2.0_More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Version_2.0_API\">API</a> \n
- <a href=\"/Version_2.0_API_Transition_Guide\">API Transition Guide</a> \n
- <a href=\"/Version_2.0_API_How_do_I\">API, How do I?</a> \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">Javadoc</a> \n
- <a href=\"/Version_2.0_API_Events\">API Events</a> \n
- <a href=\"/Version_2.0_Plugins\">Writing Plugins</a> \n
- <a href=\"/Version_2.0_Scripts\">Scripting</a> \n
\n\n\n \n - \n
<a href=\"/Overview_of_the_documentation\">Version 1.4</a>
- \n
- <a href=\"/Micro-Manager_User's_Guide\">User Guide</a> \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
- <a href=\"/Plugins\">Plugins</a> \n
- <a href=\"http://valelab4.ucsf.edu/publications/2010EdelsteinCurrProt.pdf\">Tutorial (PDF)</a> \n
- <a href=\"http://www.jbmethods.org/jbm/article/view/36/29\">Advanced Methods</a> \n
- <a href=\"/Micro-Manager_FAQ-new\">FAQ</a> \n
- <a href=\"/More_Help_Topics\">More Help Topics</a> \n
- <a href=\"/Screencasts\">Video Screencasts</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Programming_Guide\">Extend</a>
- \n
- <a href=\"/Script_Panel_GUI\">Scripting (Beanshell)</a> \n
- <a href=\"/Example_Beanshell_scripts\">Example Beanshell scripts</a> \n
- <a href=\"/Writing_plugins_for_Micro-Manager\">Writing Plugins</a> \n
- <a href=\"/Using_the_Micro-Manager_python_library\">Python</a> \n
- <a href=\"/Matlab\">Matlab</a> \n
- <a href=\"/Micro-Manager_File_Formats\">File Formats</a> \n
- <a href=\"/Search_Paths\">Search Paths</a> \n
- <a href=\"/Building_Micro-Manager_Device_Adapters\">Writing Device Adapters</a> \n
- <a href=\"/Free_third-party_tools_for_testing_communications_with_hardware\">Testing communication with hardware</a> \n
- <a href=\"/Building_and_debugging_Micro-Manager_source_code\">Building and Debugging Micro-Manager</a> \n
- <a href=\"/Multi-Dimensional_Acquisition_Programming\">Multi-D Acq. Programming</a> \n
- <a href=\"/Policies_for_inclusion_of_source_code\">Policies for inclusion of source code</a> \n
- <a href=\"https://github.com/micro-manager\">Source code repository history and tickets</a> \n
- \n
APIs
- \n
- <a href=\"/apidoc/mmstudio/latest/org/micromanager/Studio.html\">2.0 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmstudio/1.4/org/micromanager/api/ScriptInterface.html\">1.4 MMStudio API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/mmcorej/latest/mmcorej/CMMCore.html\">Core API Reference (Java/Beanshell)</a> \n
- <a href=\"/apidoc/MMCore/latest/class_c_m_m_core.html\">Core API Reference (C++)</a> \n
- <a href=\"/apidoc/MMDevice/latest/class_m_m_1_1_device.html\">Device API Reference (C++)</a> \n
\n\n
\n\n\n\n - \n
<a href=\"/Device_Support\">Devices</a>
- \n
- <a href=\"/Micro-Manager_Configuration_Guide\">Hardware Configuration Guide</a> \n
\n\n\n\n - \n
<a href=\"/Micro-Manager_Community\">Support</a>
- \n
- <a href=\"/Contact\">Contact</a> \n
- <a href=\"/System_Integrators\">System Integrators</a> \n
- <a href=\"/Programming_Services\">Programming Services</a> \n
- \n
<a href=\"/editing/\">Editing the Wiki</a>
- \n
- <a href=\"/editing/advanced\">Advanced editing</a> \n
- <a href=\"/editing/buttons\">Buttons</a> \n
- <a href=\"/editing/citations\">Citations</a> \n
- <a class=\"current-page\">Source Code</a> \n
- <a href=\"/editing/headers\">Headers</a> \n
- <a href=\"/editing/icons\">Icons</a> \n
- <a href=\"/editing/images\">Images</a> \n
- <a href=\"/editing/keys\">Keyboard Shortcuts</a> \n
- <a href=\"/editing/linking\">Linking</a> \n
- <a href=\"/editing/math\">Math Expressions</a> \n
- <a href=\"/editing/notices\">Notices</a> \n
- <a href=\"/editing/pitfalls\">Pitfalls</a> \n
- <a href=\"/editing/symbols\">Symbols</a> \n
- <a href=\"/editing/tables\">Tables</a> \n
- <a href=\"/editing/videos\">Videos</a> \n
- <a href=\"/editing/whitespace\">Whitespace</a> \n
\n \n
\n\n\n\n - \n
<a href=\"/Credits\">Credits</a>
- \n
- <a href=\"/Papers_citing_Micro-Manager\">Papers citing MicroManager</a> \n
- <a href=\"/Citing_Micro-Manager\">How to cite MicroManager</a> \n
\n\n\n
This page describes nice ways of embedding source code in a page.
\n\n<h2 id=\"inline-code-snippets\">Inline code snippets</h2>\n\nIf you just want to write a short snippet of code as part of a sentence,\nsurround the code in backtick symbols (`
).
Code
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\">Type `print('Hello world!')` and save as `hello.py`.</code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\nType <code class=\"language-plaintext highlighter-rouge\">print('Hello world!')</code> and save as <code class=\"language-plaintext highlighter-rouge\">hello.py</code>.
\n\nA “code fence” is three backtick symbols (```
) preceding your\ncode, and another three concluding it. Optionally, you can write the name of\nthe language in small case next to the leading fence to declare syntax\nhighlighting is desired with the stated language.
Code
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\">```java\nImage3DUniverse univ = new Image3DUniverse();\nuniv.show();\nuniv.addMesh(yourImagePlus, null, \"somename\", 50,\n new boolean[] {true, true, true}, 2);\n```</code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n <div class=\"language-java highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><span class=\"nc\">Image3DUniverse</span> <span class=\"n\">univ</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"nc\">Image3DUniverse</span><span class=\"o\">();</span>\n<span class=\"n\">univ</span><span class=\"o\">.</span><span class=\"na\">show</span><span class=\"o\">();</span>\n<span class=\"n\">univ</span><span class=\"o\">.</span><span class=\"na\">addMesh</span><span class=\"o\">(</span><span class=\"n\">yourImagePlus</span><span class=\"o\">,</span> <span class=\"kc\">null</span><span class=\"o\">,</span> <span class=\"s\">\"somename\"</span><span class=\"o\">,</span> <span class=\"mi\">50</span><span class=\"o\">,</span>\n <span class=\"k\">new</span> <span class=\"kt\">boolean</span><span class=\"o\">[]</span> <span class=\"o\">{</span><span class=\"kc\">true</span><span class=\"o\">,</span> <span class=\"kc\">true</span><span class=\"o\">,</span> <span class=\"kc\">true</span><span class=\"o\">},</span> <span class=\"mi\">2</span><span class=\"o\">);</span>\n
</pre>Code
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\">```python\ndef update_progress(progress):\n barLength = 10 # length of progress bar\n block = int(round(barLength*progress))\n text = f'\\rPercent complete: ' +\n f'[{\"#\"*block + \"-\"*(barLength-block)}] ' +\n f'{progress*100}%'\n sys.stdout.write(text)\n sys.stdout.flush()\n```</code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n <div class=\"language-python highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><span class=\"k\">def</span> <span class=\"nf\">update_progress</span><span class=\"p\">(</span><span class=\"n\">progress</span><span class=\"p\">):</span>\n <span class=\"n\">barLength</span> <span class=\"o\">=</span> <span class=\"mi\">10</span> <span class=\"c1\"># length of progress bar\n</span> <span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"nb\">round</span><span class=\"p\">(</span><span class=\"n\">barLength</span><span class=\"o\">*</span><span class=\"n\">progress</span><span class=\"p\">))</span>\n <span class=\"n\">text</span> <span class=\"o\">=</span> <span class=\"sa\">f</span><span class=\"s\">'</span><span class=\"se\">\\r</span><span class=\"s\">Percent complete: '</span> <span class=\"o\">+</span>\n <span class=\"sa\">f</span><span class=\"s\">'[</span><span class=\"si\">{</span><span class=\"s\">\"#\"</span><span class=\"o\">*</span><span class=\"n\">block</span> <span class=\"o\">+</span> <span class=\"s\">\"-\"</span><span class=\"o\">*</span><span class=\"p\">(</span><span class=\"n\">barLength</span><span class=\"o\">-</span><span class=\"n\">block</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s\">] '</span> <span class=\"o\">+</span>\n <span class=\"sa\">f</span><span class=\"s\">'</span><span class=\"si\">{</span><span class=\"n\">progress</span><span class=\"o\">*</span><span class=\"mi\">100</span><span class=\"si\">}</span><span class=\"s\">%'</span>\n <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">stdout</span><span class=\"p\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"n\">text</span><span class=\"p\">)</span>\n <span class=\"n\">sys</span><span class=\"p\">.</span><span class=\"n\">stdout</span><span class=\"p\">.</span><span class=\"n\">flush</span><span class=\"p\">()</span>\n
</pre>Alternately, there is a <code class=\"language-plaintext highlighter-rouge\">highlight</code> Liquid directive you can try.\nIt looks like this:
\n\n<div class=\"code-example\">\nCode
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\"><span class=\"p\">{%</span><span class=\"w\"> </span><span class=\"nt\">highlight</span><span class=\"w\"> </span>java<span class=\"w\"> </span><span class=\"p\">%}</span>\nlog.info(\"You're a wizard, Harry!\");\nlog.error(\"I'm a what?\");\n<span class=\"p\">{%</span><span class=\"w\"> </span><span class=\"nt\">endhighlight</span><span class=\"w\"> </span><span class=\"p\">%}</span></code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n <figure class=\"highlight\"><code class=\"language-java\" data-lang=\"java\"><span class=\"n\">log</span><span class=\"o\">.</span><span class=\"na\">info</span><span class=\"o\">(</span><span class=\"s\">\"You're a wizard, Harry!\"</span><span class=\"o\">);</span>\n<span class=\"n\">log</span><span class=\"o\">.</span><span class=\"na\">error</span><span class=\"o\">(</span><span class=\"s\">\"I'm a what?\"</span><span class=\"o\">);</span></code></figure>\n\n
The <code class=\"language-plaintext highlighter-rouge\">highlight</code> directive and code fences are separate features, but\nfunctionally very similar. If code fences are not working as you like,\ngive the <code class=\"language-plaintext highlighter-rouge\">highlight</code> directive a try to see if it does any better.
\n\n<h2 id=\"embedding-code-from-github\">Embedding code from GitHub</h2>\n\nIf you have a block of code in a GitHub repository, you can embed it\ndynamically into the page using the <code class=\"language-plaintext highlighter-rouge\">github-embed</code> include. This approach has\nthe advantage of avoiding copy-paste skew as the code evolves over time.
\n\n<div class=\"code-example\">\nCode
\n\n<figure class=\"highlight\"><code class=\"language-liquid\" data-lang=\"liquid\"><span class=\"p\">{%</span><span class=\"w\"> </span><span class=\"nt\">include</span><span class=\"w\"> </span><span class=\"nv\">github-embed</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">org</span><span class=\"o\">=</span><span class=\"s2\">\"duckythescientist\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">repo</span><span class=\"o\">=</span><span class=\"s2\">\"obfuscatedLife\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">branch</span><span class=\"o\">=</span><span class=\"s2\">\"original\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">path</span><span class=\"o\">=</span><span class=\"s2\">\"life.c\"</span><span class=\"err\">\n</span><span class=\"w\"> </span><span class=\"na\">label</span><span class=\"o\">=</span><span class=\"s2\">\"Conway's Obfuscated Game of Life\"</span><span class=\"w\"> </span><span class=\"p\">%}</span></code></figure>\n\n
Result
\n<div class=\"shadowed-box\">\n\n<a href=\"https://github.com/duckythescientist/obfuscatedLife/blob/original/life.c\">Conway’s Obfuscated Game of Life</a>
<script src=\"https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fduckythescientist%2FobfuscatedLife%2Fblob%2Foriginal%2Flife.c%23L1-99999&style=github&showBorder=on&showLineNumbers=on&showFileMeta=on&showCopy=on\"></script>
Other parameters supported by the <code class=\"language-plaintext highlighter-rouge\">github-embed</code> include are:
\n\nDefault | \n
---|
<code class=\"language-plaintext highlighter-rouge\">1</code> | \n
<code class=\"language-plaintext highlighter-rouge\">99999</code> | \n
no label | \n
<code class=\"language-plaintext highlighter-rouge\">github</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
<code class=\"language-plaintext highlighter-rouge\">true</code> | \n
* Valid style values are:
\n<ul style=\"display: flex; flex-wrap: wrap; list-style: none;\">\nThis page showcases the look of different header levels.
\n\n", "previous": { "path": "_pages/editing/debugging.md", "relative_path": "_pages/editing/debugging.md", "excerpt": "The best way to collect debugging information is to <a href=\"/editing/advanced\">build the site locally</a>. However if that isn’t an option, this page documents tags which can be helpful.
\n\n", "previous": { "path": "_pages/editing/code.md", "relative_path": "_pages/editing/code.md", "id": "/editing/code", "collection": "pages", "url": "/editing/code", "draft": false, "categories": [ ], "title": "Source Code", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "code", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "id": "/editing/debugging", "collection": "pages", "next": { "path": "_pages/editing/headers.md", "relative_path": "_pages/editing/headers.md", "id": "/editing/headers", "collection": "pages", "url": "/editing/headers", "draft": false, "categories": [ ], "title": "Headers", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "headers", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "output": null, "content": "The best way to collect debugging information is to [build the site locally](/editing/advanced). However if that isn't an option, this page documents tags which can be helpful.\n\n## Echo\n\nThis `echo` include just prints its arguments, for debugging/learning purposes. This can be helpful in understanding Liquid syntax and how strings are being read internally by an `include`.\n\nArguments are printed as a comma-separated list of `\"argument\"==>\"value\"` pairs.\n\nNote that liquid allows the passing of [arbitrary arguments](https://jekyllrb.com/docs/includes/) to `include` templates. All these arguments will be stored, but won't have any effect unless the `include`'s [source](https://github.com/micro-manager/micro-manager.github.io/tree/main/_includes) actually does something with those arguments.\n\n{% highlight liquid %}{% raw %}{% include echo content=\"This is the content argument\" bracket=\"what if I pass {}?\" gorilla=\"Why do we have a gorilla argument?\" %}{% endraw %}{% endhighlight %}\n{% include echo content=\"This is the content argument\" bracket=\"what if I pass {}?\" gorilla=\"Why do we have a gorilla argument?\" %}\n\n### What's in a `page`?\n\n{% include notice icon=\"tech\" content=\"Ever wonder what all is part of the `page` data structure? Let's find out!\n\n(You can also do this with the `site` data structure, but be warned: the output will include every page body across the whole site!)\" %}\n\n{% highlight liquid %}{% raw %}{% include echo p=page %}{% endraw %}{% endhighlight %}\n{% include echo p=page %}\n", "url": "/editing/debugging", "draft": false, "categories": [ ], "title": "Debugging", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "debugging", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "id": "/editing/headers", "collection": "pages", "next": { "path": "_pages/editing/icons.md", "relative_path": "_pages/editing/icons.md", "excerpt": "This page demonstrates how to use the <code class=\"language-plaintext highlighter-rouge\">icon</code> include tag.
\n\n", "previous": { "path": "_pages/editing/headers.md", "relative_path": "_pages/editing/headers.md", "id": "/editing/headers", "collection": "pages", "url": "/editing/headers", "draft": false, "categories": [ ], "title": "Headers", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "headers", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "id": "/editing/icons", "collection": "pages", "next": { "path": "_pages/editing/images.md", "relative_path": "_pages/editing/images.md", "id": "/editing/images", "collection": "pages", "url": "/editing/images", "draft": false, "categories": [ ], "title": "Images", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "images", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "output": null, "content": "This page demonstrates how to use the `icon` include tag.\n\n## Usage\n\nSpecify an icon by name.\n\n{% raw %}\n```\n{% include icon name='info' %}\n```\n{% endraw %}\n\n{% include icon name='info' %}\n\n{% raw %}\n```\n{% include icon name='ImageJ' %}\n```\n{% endraw %}\n\n{% include icon name='ImageJ' %}\n\nOptionally, override the icon size (default is `48px`):\n\n{% raw %}\n```\n{% include icon name='ImageJ' size='96px' %}\n```\n{% endraw %}\n\n{% include icon name='ImageJ' size='96px' %}\n\nUse `size=x96px` to set the height instead of the width:\n\n{% raw %}\n```\n{% include icon name='ImageJ' size='x96px' %}\n```\n{% endraw %}\n\n{% include icon name='ImageJ' size='x96px' %}\n\nYou can also override the horizontal alignment:\n\n{% raw %}\n```\n{% include icon name='Linux' size='96px' align='left' %}\n```\n{% endraw %}\n\n{% include icon name='Linux' size='96px' align='left' %}\nAlpha \nBeta \nGamma\n", "url": "/editing/icons", "draft": false, "categories": [ ], "title": "Icons", "layout": "page", "section": "Support:Editing the Wiki", "nav-links": true, "slug": "icons", "ext": ".md", "tags": [ ], "date": "2024-08-29 18:18:59 +0000" }, "output": null, "content": "This page showcases the look of different header levels.\n\nIn Markdown, you make a header by prefacing the section title with\na number of `#` symbols, up to a maximum of six (for `