Skip to content

Commit

Permalink
fix #923: setting ans to a expression in REPLBlocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jan 23, 2019
1 parent 46abe28 commit d2eb037
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* ![Enhancement][badge-enhancement] Documentation is no longer deployed on Travis CI cron jobs. ([#917][github-917])

* ![Bugfix][badge-bugfix] `@repl` blocks now work correctly together with quoted
expressions. ([#923][github-923], [#926][github-926])

## Version `v0.21.0`

* ![Deprecation][badge-deprecation] ![Enhancement][badge-enhancement] The symbol values to the `format` argument of `makedocs` (`:html`, `:markdown`, `:latex`) have been deprecated in favor of the `Documenter.HTML`, `Markdown` and `LaTeX`
Expand All @@ -12,15 +15,15 @@

**For upgrading:** If you don't specify `format` (i.e. you rely on the default) you don't have to do anything.
Otherwise update calls to `makedocs` to use struct instances instead of symbols, e.g.

```
makedocs(
format = :markdown
)
```

should be changed to

```
using DocumenterMarkdown
makedocs(
Expand All @@ -47,7 +50,7 @@
...
)
```

_**Note:** It is technically possible to specify the same argument twice with different values by passing both variants. In that case the value to the deprecated `html_*` variant takes precedence._

* ![Feature][badge-feature] Packages extending Documenter can now define subtypes of `Documenter.Plugin`,
Expand Down Expand Up @@ -177,6 +180,8 @@
[github-898]: https://github.com/JuliaDocs/Documenter.jl/pull/898
[github-905]: https://github.com/JuliaDocs/Documenter.jl/pull/905
[github-907]: https://github.com/JuliaDocs/Documenter.jl/pull/907
[github-923]: https://github.com/JuliaDocs/Documenter.jl/pull/923
[github-926]: https://github.com/JuliaDocs/Documenter.jl/pull/926

[documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl
[documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl
Expand Down
2 changes: 1 addition & 1 deletion src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
input = droplines(str)
(value, success, backtrace, text) = Utilities.withoutput() do
cd(dirname(page.build)) do
Core.eval(mod, :(ans = $(Core.eval(mod, ex))))
Core.eval(mod, Expr(:(=), :ans, ex))
end
end
result = value
Expand Down
5 changes: 5 additions & 0 deletions test/examples/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ ex = :(1 + 5)
eval(ex)
```

```@example
a = 1
:(a + 1)
```

# Issue #793
```jldoctest
julia> write("issue793.jl", "\"Hello!\"");
Expand Down

0 comments on commit d2eb037

Please sign in to comment.