You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For consistency (and because this seems like a useful feature, making it easier to move around/rename .md files in the documentation), it would be nice if Documenter itself would also support this in the Pages attribute of @content and @index blocks. Probably also in @autodocs, although Pages in @autodocs is handled differently from @content and @index.
The function I'm using to handle @__FILE__ in DocumenterCitations is this:
# Deal with `@__FILE__` in `Pages`, convert it to the name of the current file.function_resolve__FILE__(Pages, page)
__FILE__ =let ex = Meta.parse("_ = @__FILE__", 1; raise=false)[1]
# What does a `@__FILE__` in the Pages list evaluate to?# Cf. `Core.eval` in `parse_bibliography_block`.# Should be the string "none", but that's an implementation detail.
Core.eval(Main, ex.args[2])
end
result = String[]
for name in Pages
if name == __FILE__
# Replace @__FILE__ in Pages with the current file:
name =basename(page.source)
@debug"__@FILE__ -> $(repr(name)) in Pages attribute of @bibliography block on page $(page.source)"endpush!(result, name)
endreturn result
end
JuliaDocs/DocumenterCitations.jl#22 (comment) proposed accepting
@__FILE__
in thePages
attribute of a@bibliography
block to indicate the current page. I've implemented this in JuliaDocs/DocumenterCitations.jl#48.For consistency (and because this seems like a useful feature, making it easier to move around/rename
.md
files in the documentation), it would be nice ifDocumenter
itself would also support this in thePages
attribute of@content
and@index
blocks.Probably also in.@autodocs
, althoughPages
in@autodocs
is handled differently from@content
and@index
The function I'm using to handle
@__FILE__
inDocumenterCitations
is this:It's applied to the parsed/eval'ed
Pages
list.Issue #760 is related, but seems mostly about
@example
and@eval
(which probably need pre-processing instead of post-processing)The text was updated successfully, but these errors were encountered: