Closed dontlaugh closed 2 months ago
What would cause this error?
Failed to open file /opt/rakuast-rakudoc-render/resources/compliance-rendering/rakudociem-ipsum.rakudoc: No such file or directory
This installs dependencies via zef
, but it doesn't quite work yet as a "containerized executable" for the bin/RenderDocs
script.
It would also be good if you could modify your assumptions in the multi sub MAIN
that accepts two parameters. Specifically here
render-files([$file,], '.', :$to)
We need to be able to accept absolute paths here and not make assumptions about the names of directories, where they're run, names of input files, etc.
For example, I cloned your example rakudoc repo and ran this
podman run -w /opt/rakuast-rakudoc-render -v $PWD:/src --rm localhost/rakuast-rakudoc-render:latest RenderDocs /src/docs/README
Processing 「.//src/docs/README.rakudoc」 to 「/src/docs/README.md」
Could not open .//src/docs/README.rakudoc. Failed to stat file: no such file or directory
/src/docs/README.rakudoc
is a valid path in the container because I've mounted it there. But it's unclear how to target it.
@dontlaugh These errors are occurring because of ad hoc links that I have not eliminated.
rakudociem-ipsum.rakudoc
is from Raku/RakuDoc-GAMMA
and is changing as I find corner cases to be checked.
bin/get-compliance
in this repo that pulls the file from the Raku/RakuDoc-GAMMA
repo. --format='md'
$cwd/docs
and can be specified by --src='/src'
$cwd
and can be overridden by --to='/output-files'
?This means that
render-files
without any arguments will take all the rakudoc sources in ./docs
and render them into .md
files in the cwdrender-files --src='/src'
will take all the rakudoc sources in /src
and render them to the current working directoryrender-files --to='/output-files'
will take all from './docs' and output to '/output-files' render-files SOME-random-name
will only render that file in the default src and output to the default dirrender-files --src='/src' --to='./somewhere/' filename
uses all threeI'm just writing it all out fo flesh out the design. I think (!) the named parameters (eg. --src) have to come before the unnamed ones, in this case the filename.
I like the "uses all three" variant for writing things like scripts and CI workflows, because when I revisit things like this in 6 months the flags are scriptive and help me understand what's going on.
@dontlaugh I'll rewrite. each variant can be used.
This is a simple take on a docker build that uses the rakudo base container.
Test from the root of the directory like this
The
podman
executable can be used instead ofdocker
, as well.Details on usage are TBD, but it will involve users mounting their source code inside as a volume mount.