Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default module to Main #131

Merged
merged 7 commits into from
Jun 23, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into eval-module
rikhuijzer authored Jun 23, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d15bf8d866607c746a14718b81bfe684c995702c
6 changes: 4 additions & 2 deletions src/generate.jl
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ function expand_path(p)
end

"""
gen(paths::Vector{String}; M=Main, fail_on_error=false, project="default")
gen(paths::Vector; M=Main, fail_on_error=false, project="default")

Populate the files in `$(Books.GENERATED_DIR)/` by calling the required methods.
These methods are specified by the filename and will output to that filename.
@@ -208,8 +208,10 @@ After calling the methods, this method will also call `html()` to update the sit
just load them inside your REPL (module `Main`) and call `gen()`.
For example, you can define `M = YourModule` to shorten calls to methods in your module.
"""

function gen(paths::Vector{String};
M=Main, fail_on_error=false, project="default", call_html=true)

mkpath(GENERATED_DIR)
paths = [contains(dirname(p), "contents") ? p : expand_path(p) for p in paths]
included_expr = vcat([extract_expr(read(p, String)) for p in paths]...)
@@ -224,7 +226,7 @@ end
"""
gen(path::AbstractString; kwargs...)

Convenience method for passing `path::AbstractString` instead of `paths::Vector{AbstractString}`.
Convenience method for passing `path::AbstractString` instead of `paths::Vector`.
"""
function gen(path::AbstractString; kwargs...)
path = string(path)::String
You are viewing a condensed version of this merge commit. You can view the full changes here.