Skip to content

Commit

Permalink
Include found doc strings instead of
Browse files Browse the repository at this point in the history
bailing completely in at-docs block,
fixes #799 and fixes #474.
  • Loading branch information
fredrikekre committed Jan 24, 2019
1 parent 2add0e6 commit dd823c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
`@eval`, `@example` and `@setup` blocks now include information about the source location
of the block. ([#929][github-929])

* ![Enhancement][badge-enhancement] Docstrings from `@docs`-blocks are now included in the
rendered docs even if some part(s) of the block failed. ([#928][github-928])

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

Expand Down Expand Up @@ -192,6 +195,7 @@
[github-923]: https://github.com/JuliaDocs/Documenter.jl/pull/923
[github-926]: https://github.com/JuliaDocs/Documenter.jl/pull/926
[github-927]: https://github.com/JuliaDocs/Documenter.jl/pull/927
[github-928]: https://github.com/JuliaDocs/Documenter.jl/pull/928
[github-929]: https://github.com/JuliaDocs/Documenter.jl/pull/929

[documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl
Expand Down
7 changes: 1 addition & 6 deletions src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ end
# -----

function Selectors.runner(::Type{DocsBlocks}, x, page, doc)
failed = false
nodes = DocsNode[]
curmod = get(page.globals.meta, :CurrentModule, Main)
lines = Utilities.find_block_in_file(x.code, page.source)
Expand All @@ -276,7 +275,6 @@ function Selectors.runner(::Type{DocsBlocks}, x, page, doc)
```
""",
exception = err)
failed = true
continue
end
# Undefined `Bindings` get discarded.
Expand All @@ -288,7 +286,6 @@ function Selectors.runner(::Type{DocsBlocks}, x, page, doc)
$(x.code)
```
""")
failed = true
continue
end
typesig = Core.eval(curmod, Documenter.DocSystem.signature(ex, str))
Expand All @@ -303,7 +300,6 @@ function Selectors.runner(::Type{DocsBlocks}, x, page, doc)
$(x.code)
```
""")
failed = true
continue
end

Expand All @@ -324,7 +320,6 @@ function Selectors.runner(::Type{DocsBlocks}, x, page, doc)
$(x.code)
```
""")
failed = true
continue
end

Expand All @@ -345,7 +340,7 @@ function Selectors.runner(::Type{DocsBlocks}, x, page, doc)
end
# When a `@docs` block fails we need to remove the `.language` since some markdown
# parsers have trouble rendering it correctly.
page.mapping[x] = failed ? (x.language = ""; x) : DocsNodes(nodes)
page.mapping[x] = DocsNodes(nodes)
end

# @autodocs
Expand Down

0 comments on commit dd823c6

Please sign in to comment.