Suppose I am running scribble on the file example.scrbl:
scribble example.scrbl
I want to figure out the path, or at least the name, of the file which is being processed (in this case example.scrbl), programmatically inside the file itself. I thought it would be
(vector-ref 0 (current-command-line-arguments))
but this does not work. Actually, (current-command-line-arguments) returns empty vector. What is the right way? I want a function which would return the string "example.scrbl".
As I very recently blogged about you can use
(syntax-source #'here)
to get the pathname of the current source file.To adapt that to Scribble you simply need to:
path
to astring
for Scribble.So: