Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/src/frompackage/basic_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Loading