-
A sample julia code data loader would be much appreciated. For example printing a text "Hello world" I had a file with
and named it "test.csv.jl" in /docs/data
I was expecting a file to be generated in /docs/.observablehq/cache but nothing is there when I run npm run build. Any help would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
Beta Was this translation helpful? Give feedback.
-
Thank you!!
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I'll download latest one and try again. Thanks for your patience. |
Beta Was this translation helpful? Give feedback.
-
ok, it works now! I was probably using the older version without support. Would the results have been the same if I had the data loader hello-julia.txt.sh?
in the older version? I seem to remember that being the case. |
Beta Was this translation helpful? Give feedback.
Yes, you can have a data loader named
test.csv.jl
and not have it generate CSV — it’s just a little confusing. If you just want a test, maybe call ittest.txt.jl
instead?No, the
#!/usr/bin/env julia
shebang is not necessary if you use the.jl
extension for your data loader. A shebang is only necessary when using an executable (.exe
) data loader rather than an interpreted one (and in that case, your data loader must also have the executable bit set).Data loaders are only run if you reference their output. So in addition to writing the data loader, you’ll need to load the file in a Markdown page (or in a JavaScript module that is imported by a Markdown page). If you visit that page in you…