Skip to content

Commit

Permalink
Merge pull request #17 from j-fu/no_append_build_context
Browse files Browse the repository at this point in the history
Pass append_build_context to PlutoStaticHTML
  • Loading branch information
j-fu authored Nov 5, 2024
2 parents 017f247 + 8d5ffa4 commit 231e163
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- 'lts' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
- 'nightly'
- 'pre'
os:
- ubuntu-latest
- windows-latest
Expand All @@ -33,13 +33,11 @@ jobs:
arch: aarch64
- os: macOS-13
arch: aarch64
- os: macOS-14
version: 1.6
- os: macOS-14
arch: x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExampleJuggler"
uuid = "3bbe58f8-ed81-4c4e-a134-03e85fcf4a1a"
authors = ["Jürgen Fuhrmann <juergen-fuhrmann@web.de>"]
version = "2.0.1"
version = "2.1.0"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand All @@ -27,9 +27,9 @@ Compat = "4.10"
DocStringExtensions = "0.8,0.9"
Literate = "2"
Pkg = "1.6"
Pluto = "0.19.30"
PlutoSliderServer = "0.3.28"
PlutoStaticHTML = "6"
Pluto = "0.19.30, 0.20"
PlutoSliderServer = "0.3.28, 1"
PlutoStaticHTML = "6, 7"
Requires = "1"
Test = "1.6"
UUIDs = "1.6"
Expand Down
6 changes: 4 additions & 2 deletions ext/ExampleJugglerPlutoStaticHTMLExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ isdefined(Base, :get_extension) ? import PlutoStaticHTML : import ..PlutoStaticH



function docplutostatichtml(example_dir, notebooks; distributed=true, force=true, pluto_project = Base.active_project())
function docplutostatichtml(example_dir, notebooks; append_build_context = true,
distributed=true, force=true, pluto_project = Base.active_project())
project = Base.active_project()
if pluto_project != nothing
Pkg.activate(pluto_project)
Expand All @@ -16,7 +17,8 @@ function docplutostatichtml(example_dir, notebooks; distributed=true, force=true

notebookmd = [splitext(notebook)[1] * ".md" for notebook in notebooks]

oopts = OutputOptions(; append_build_context = true)
oopts = OutputOptions(; append_build_context)
@show oopts
bopts = BuildOptions(example_dir; output_format = documenter_output)
session = PlutoStaticHTML.Pluto.ServerSession()
session.options.server.disable_writing_notebook_files = true
Expand Down
6 changes: 5 additions & 1 deletion src/plutoext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Keyword arguments:
Documenter, but are (as of now) unable to show active javascript content. Graphics is best prepared
with CairoMakie. Prerequisite is `import PlutoStaticHTML` in `docs/make.jl`.
- `distributed`: Use parallel evaluation when `iframe==false`
- `append_build_context`: pass this to [PlutoStaticHTML.OutputOptions](https://plutostatichtml.huijzer.xyz/dev/#PlutoStaticHTML.OutputOptions).
Possibly needed when running the notebook in external environment.
- `source_prefix`: Path prefix to the notebooks on github (for generating download links)
Default: "/~https://github.com/j-fu/ExampleJuggler.jl/blob/main/examples".
- `iframe_height`: Height of the iframe generated. Default: "500px".
Expand All @@ -107,6 +109,7 @@ function docplutonotebooks(example_dir, notebooklist;
source_prefix = "/~https://github.com/j-fu/ExampleJuggler.jl/blob/main/examples",
iframe_height = "500px",
distributed = true,
append_build_context = true,
pluto_project = Base.active_project())
startroot!(pwd())
thisdir=pwd()
Expand All @@ -127,7 +130,8 @@ function docplutonotebooks(example_dir, notebooklist;
error("Please have Pluto in the environment and import/use PlutoStaticHTML.jl in order to use docplutonotebooks with `iframe=false`")
end
end
mdpaths = docplutostatichtml(example_dir, notebooks; distributed, pluto_project)
@show distributed
mdpaths = docplutostatichtml(example_dir, notebooks;append_build_context, distributed, pluto_project)
end
cd(thisdir)
Pair.(first.(notebooklist), mdpaths)
Expand Down

2 comments on commit 231e163

@j-fu
Copy link
Owner Author

@j-fu j-fu commented on 231e163 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118784

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.1.0 -m "<description of version>" 231e16318481c3adccbd7d86bc54bd6bb91e26dc
git push origin v2.1.0

Please sign in to comment.