Documentation for PlutoReport.jl
Make awesome reports and talk slides in Pluto!
Why
Pluto is already an awesome platform to make interactive notebooks in julia. Along with the markdown and latex support, one can harness the interactivity of PlutoUI to make anything that they wish to make. This has lead to a rise in Pluto being used as an educational tool. With PlutoReport, we envision pluto notebooks being used for scientific publishing too.
Whereas LaTeX has become the de facto standard for publishing, it is inherently a two step process, to first generate the data and plots, and then to insert these along with the content. Such a separation is naturally more time consuming for the writers. I believe that such a separation is not a necessity in the publishing worklow. Further, the seperation of data and content also shows up in the lack of codes being available for readers.
Another use of Pluto is in making presentations for talks. A common drawback of pdf slides in, say beamer, is the complexity of adding interactivity in the slides.
While Pluto already provides most of the things we need in terms of interactivity, and also the hidden present()
feature, there are certain things like citations, arbitrary slide breaks, presentation controls etc which are missing. This package attempts to add these features without users having to write them out themselves.
The end goal is this: A single document, which is code, documentation, talk slides and a full fledged report which the reader can interact with on any device, with easy ways to export and publish static html, active notebooks, and pdfs, and with opt in features to display cited papers so the reader can quickly look at the reference without losing context, all while being easy to learn and write for the author of the paper, but nearly as powerful as LaTeX. Yeah, ambitious, but possible. CSS/JS, Julia, Pluto/UI with export features already make it halfway, this package does the rest.
Features
- A fancy title for your report - Title
- A floating control panel to set the amount of time of your talk, and toggle presentation mode - presentation_controls. Control slide movement with the mouse, scroll or
PlutoUI.TableOfContents
- A nice clock to show you how much time you have left - presentation_ui
- Add inline citations with
@cite
. You can even style them according to your wish, following the norms of your referencing style viastyle_citations
- Generates a References list from a bibtex file and actually cited works automatically. See the docs for
References
. - Multiple aesthetic fixes for the report to look professional.
apply_css_fixes
- A cute little laser pointer in presentation mode
Experimental and Future Features
- Display abstracts from the references on a single click
- Share DOI of a refernce to Zotero, Mendeley etc. Maybe even Mastodon just for fun
- Sections that are hidden in presentations
- Speaker Notes ??
- Making papers accessible to ScreenReaders and such.
- Integration with DrWatson.jl
Installation
In any cell of your Pluto notebook,
using PlutoReport
And you are done!!
Examples of reports and talks
You can find example notebooks here with the associated bibtex files. Make sure you have the notebook and bibtex files in the same folder!
If you just want to see how it looks like, look at the hosted example page. This however will not have all the fancy features that makes this package useful.
I've also made a repo for more examples of PlutoReport - PlutoReport-Examples, website
Send a PR to feature your works in PlutoReports.jl!!
API Documentation
PlutoReport.PresentationControls
— TypePresentationControls
alias for NamedTuple{(:presentation_mode, :max_time, :clock),Tuple{Bool,Int64,Int64}}
, which is used in presentation_ui
See also presentation_ui
, presentation_controls
PlutoReport.presentation
— Methodpresentation(pvals::PresentationControls) :: HypertextLiteral.Result
Returns htl string which turns UI into presentation mode. Must be the last statement in a cell.
See also presentation_ui
, presentation_controls
, PresentationControls
PlutoReport.presentation_controls
— Methodpresentation_controls(aside::Bool = true) :: PlutoUI.CombineNotebook.CombinedBonds
Returns a PlutoUI widget which returns a PresentationControls
, and acts as a control panel for presentation_ui
. Must be bound to a variable using PlutoUI.bind
.
Arguments
aside::Bool
: Whether control panel is floating
See also presentation_ui
, PresentationControls
PlutoReport.presentation_ui
— Methodpresentation_ui(pvals::PresentationControls) :: HypertextLiteral.Result
Returns htl string with presentation
and timeleft
Must be the last statement in a cell.
See also presentation_controls
, PresentationControls
PlutoReport.timeleft
— Methodtimeleft(pvals::PresentationControls) :: HypertextLiteral.Result
Returns string which displays the time left in talk. Must be the last statement in a cell.
See also presentation_ui
, presentation_controls
, PresentationControls
PlutoReport.CiteCSS
— TypeCiteCSS
An Enum
with values Superscript and Highlighted to control styling of inline citations.
See also style_citations
PlutoReport.CiteStyle
— TypeCiteStyle
An Enum
with values ByNumber and ById to control content of inline citations.
See also style_citations
PlutoReport.References
— MethodReferences() :: HypertextLiteral.Result
Returns a PlutoUI widget which updates a Bond with the list of all citations (with repetition) in the report. Use with display_bibliography
, with this bound to a variable using @bind
See also display_bibliography
, @cite_str
PlutoReport.display_bibentry
— Methoddisplay_bibentry(entry::Bibliography.BibInternal.Entry)::HypertextLiteral.Result
Returns a display for a bibentry.
See also display_bibliography
PlutoReport.display_bibliography
— Methoddisplay_bibliography(bibtexpath::String, citations) ::HypertextLiteral.Result
Returns all cited references from a reference BibTex file at bibtexpath
and citations
. It can also be bound to a variable to be used with show_abstract
See also @cite_str
, References
PlutoReport.nice_bib
— Methodnice_title(raw_title::String)::String
Removes any curly braces in titles
PlutoReport.style_citations
— Methodstyle_citations(citations, bibtexpath::String; css::Union{CiteCSS, HypertextLiteral.Result}=Superscript, content::Union{CiteStyle, Function}=By_Id) :: HypertextLiteral.Result
Style inline citations. citations
is a Bond to References
, bibtexpath
is path to the bibtex file. content
can either be a CiteStyle
or a Function, that is of the form (citeid::String, bibtexpath::String)::String
, whose output will replace the id in the citations
See also CiteStyle
PlutoReport.@cite_str
— Macro@cite_str -> HypertextLiteral.Result
Create an inline citation from string
Example
cite"test1"
This creates a citation for bibtex entry with id as test1
See also display_bibliography
, References
PlutoReport.Title
— MethodTitle(title::String, subtitle::String, author::String, affiliation::String) :: HypertextLiteral.Result
Makes the title for the report. Must be the last statement in a cell.
See also make_title
PlutoReport.make_title
— Functionmake_title
is an alias for Title
PlutoReport.get_abstract
— Methodget_abstract(link)
Try all possible APIs and methods to get reference information
PlutoReport.search_semantic_scholar
— Methodsearch_semantic_scholar(doi)
Query the Semantic Scholar API to get abstract information
PlutoReport.show_abstract
— Methodshow_abstract(link; aside=true)
Show the abstract of the link clicked in the References section. If unable to query the information, just show the reference link
See also display_bibliography
, @cite_str
PlutoReport.PlutoReport
— ModulePlutoReport
A Package to make reports and talks in Pluto.jl.
Usage
using PlutoReport
@bind pval presentation_controls(aside=true)
presentation_ui(pval)
apply_css_fixes()
Title("A test title", "some subtitle", "Some person", "Some institution")
md"## A beautiful Report"
@bind references References()
display_bibliography("./bibliography.bibtex", references)
PlutoReport.centerslidebreak
— Constantcenterslidebreak
Start a new slide here, slide content is centered.
See also slidebreak
and topslidebreak
PlutoReport.seperator
— Constantseperator
Visual seperator for any location
PlutoReport.slidebreak
— Constantslidebreak
Start a new slide here, slide content is centered.
See also centerslidebreak
and topslidebreak
PlutoReport.topslidebreak
— Constanttopslidebreak
Start a new slide here, slide content is aligned top.
See also slidebreak
and centerslidebreak
PlutoReport.apply_css_fixes
— Methodapply_css_fixes(;helpbox=true, logs=true, footer=true, print=true)
Apply fixes to Pluto's UI to make it better for reports and presentations. Set any of the parameters to false if you do not want to apply those. Must be the last statement in a cell.