Skip to content

Instantly share code, notes, and snippets.

@witt3rd
Last active October 13, 2020 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save witt3rd/7193a1e700b8a7a91e6248db19e7ec0d to your computer and use it in GitHub Desktop.
Save witt3rd/7193a1e700b8a7a91e6248db19e7ec0d to your computer and use it in GitHub Desktop.
Working in Pluto.jl

Pluto.jl

Watch this

Setup

Get Julia

macOS

brew install julia

Ubuntu

sudo apt install julia

Get Julia VS Code Extension

Julia Extension

code --install-extension julialang.language-julia

Get LaTeX

macOS

brew install mactex

Ubuntu

sudo apt install texlive-full

Get Pluto

tl;dr

julia> ]
(v1.5) pkg> add Pluto
julia> import Pluto
julia> Pluto.run()

Making (GitHub) Notebooks - Opinionated Tips

Create and save notebooks from the main Pluto UI

  • Create a folder in git project to manage docs, e.g., /my-proj/docs/literate
  • Files are stored as .jl, which allows them to be treated as standalone Julia code

Working in notebooks

begin
	import Pkg
	Pkg.activate(mktempdir())
	
	Pkg.add("Compose")
	using Compose
end

Export HTML and PDF

  • Save output files to /my-proj/docs/dist/ from the Pluto UI

Deploy Notebook to GitHub Pages

  • Create a folder /my-proj/docs/gh-deploy so you can deploy a static website to GitHub (gh-pages)

  • From within gh-deploy, run the script: npm run depoy and this will make whatever is in gh-deploy/dist your new GitHub site

TODOs:

  • Research Documenter.jl for a better way to convert, assemble, and deploy documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment