Skip to content

Commit

Permalink
πŸ“š Docs for module members
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Jun 3, 2020
1 parent 2686df6 commit 6652365
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Pluto"
uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
license = "MIT"
authors = ["Fons van der Plas <[email protected]>", "MikoΕ‚aj Bochenski <[email protected]>"]
version = "0.9.2"
version = "0.9.3"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
19 changes: 13 additions & 6 deletions assets/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,19 @@ function createCodeMirrorInsideCell(cellNode, code) {
})

cm.on("cursorActivity", (cm) => {
const token = cm.getTokenAt(cm.getCursor())

if (token.type != null && token.type != "string") {
updateDocQuery(token.string)
if (cm.somethingSelected()) {
let sel = cm.getSelection()
if (!/[\s]/.test(sel)){
// no whitespace
updateDocQuery(sel)
}
} else {
let token = cm.getTokenAt(cm.getCursor())
if (token.type != null && token.type != "string") {
updateDocQuery(token.string)
}
}
});
})

cm.on("blur", (cm, e) => {
if (document.hasFocus()) {
Expand Down Expand Up @@ -234,7 +241,6 @@ function renderOutput(msg, ctx) {
}
} else {
const result = Function(script.innerHTML).bind(newContainer)()
console.log(result)
if (result && result.nodeType === Node.ELEMENT_NODE) {
script.parentElement.insertBefore(result, script)
}
Expand Down Expand Up @@ -299,6 +305,7 @@ function updateLocalCellOutput(cellNode, msg) {
)
cellNode.classList.toggle("inline-output",
!msg.errored &&
!!msg.output &&
(msg.mime == "application/vnd.pluto.tree+xml" || msg.mime == "text/plain")
)
cellNode.classList.toggle("error",
Expand Down
8 changes: 6 additions & 2 deletions src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,12 @@ end

function doc_fetcher(query, workspace::Module=current_module)
try
obj = getfield(workspace, Symbol(query))
(repr(MIME"text/html"(), Docs.doc(obj)), :πŸ‘)
obj = Core.eval(workspace, Meta.parse(query))
if obj isa Expr
(nothing, :πŸ‘Ž)
else
(repr(MIME"text/html"(), Docs.doc(obj)), :πŸ‘)
end
catch ex
(nothing, :πŸ‘Ž)
end
Expand Down

3 comments on commit 6652365

@fonsp
Copy link
Owner Author

@fonsp fonsp commented on 6652365 Jun 3, 2020

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/15796

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 v0.9.3 -m "<description of version>" 6652365fee90917f42883298f333471965f54776
git push origin v0.9.3

@fonsp
Copy link
Owner Author

@fonsp fonsp commented on 6652365 Jun 3, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.