diff --git a/README.md b/README.md index 04992d1..9f7c993 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,16 @@ This is a package containing macros/functions to help develop Packages using [Pluto](https://github.com/fonsp/Pluto.jl) notebooks testing/prototyping aids. +## Quickstart + +```julia +using PlutoDevMacros + +@fromparent import * +``` + +## Overview + The major feature contribution of this package is the `@fromparent` macro, which allows to load a local package in Pluto and have its code re-parsed and updated upon manual re-run of the cell containing the macro call. This is simlar to a `Revise`-based workflow but provides a few notable advantages: - Package code can be re-evaluated correctly without requiring a julia restart even when re-defining structs or constants diff --git a/docs/src/frompackage/basic_use.md b/docs/src/frompackage/basic_use.md index 9208a42..03c3bf0 100644 --- a/docs/src/frompackage/basic_use.md +++ b/docs/src/frompackage/basic_use.md @@ -37,7 +37,7 @@ The main module of the package identified by the `target` path will be used as t The second argument to the macro is supposed to be either a single `using`/`import` statement, or multiple statements wrapped inside a `begin...end` block. -These statements are used to select which parts of the loaded Package module have to be evaluated and which of its variables have te be imported within the notebook scope. +These statements are used to select which parts of the loaded Package module have to be evaluated and which of its variables have to be imported within the notebook scope. Most of these import statements are only relevant when called within Pluto, so `@frompackage` simply avoid loading the target Package and deletes these import statements **in most cases** when called oustide of Pluto. There is a specific diff --git a/docs/src/index.md b/docs/src/index.md index 7d86257..b1492a5 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -2,6 +2,24 @@ Documentation for [PlutoDevMacros](https://github.com/disberd/PlutoDevMacros.jl). +This is a package containing macros/functions to help develop Packages using [Pluto](https://github.com/fonsp/Pluto.jl) notebooks testing/prototyping aids. + +The major feature contribution of this package is the @fromparent macro, which allows to load a local package in Pluto and have its code re-parsed and updated upon manual re-run of the cell containing the macro call. + +## Quickstart + +To load the parent package of a notebook, i.e. the package that is in the same directory or parent directory of a notebook file use: + +```julia +using PlutoDevMacros + +@fromparent import * +``` + +In Pluto you will then see a `Reload` button which can be used to reload the module on any changes. + +For more information please refer to the explanations linked below. + ## @frompackage/@fromparent ```@contents Pages = [