Bug in package building and web site

Hi,

when updating Scheme+ the package system initially failed to build the package because doc had an error:

if i insert an image in the doc, which is rarely done but feature exists, then if i put the image in the scribbling subdirectory of the project it will build the html page from scribble file correctly with the good local link to the image but then the package manager will fail to find the image.

By reading the log error of the failed build i understood that the images need to be also at the root directory of the project.
So, if my project is: Scheme-PLUS-for-Racket and my doc in Scheme-PLUS-for-Racket/scribbling and i have an image :
Scheme-PLUS-for-Racket/scribbling/neural-harmonic-oscillator-and-equation-computed-harmonic-oscillator.png , the image for package manager need to be too in Scheme-PLUS-for-Racket/neural-harmonic-oscillator-and-equation-computed-harmonic-oscillator.png.

This would be better to have the image in the same documentation subdirectory, not at the root of project , where generally source code is.

I think it is a bug or perheaps there is a way to better describe the documentation in my project, for now i use a tag like this in my scribble file:

@centerline{@image[#:scale 1.1 "neural-harmonic-oscillator-and-equation-computed-harmonic-oscillator.png"]}

Regards,

Damien

My understanding is that you should use define-runtime-path to access resource files.

(Early reading this morning) I do not know how it could work because i'm not in a code program but in a document scribble file. (anyway the topic is of minor importance, the documentation is good like that, but with images in code source directory too...)

seems i need to import some definitions in the scribble document to test it:

mattei@mac scribblings % /Applications/Racket/bin/scribble +m  --redirect-main http://docs.racket-lang.org Scheme-PLUS-for-Racket.scrbl
Scheme-PLUS-for-Racket.scrbl:1263:2: define-runtime-path: unbound identifier
  in: define-runtime-path
  location...:
   Scheme-PLUS-for-Racket.scrbl:1263:2
  context...:
   /Applications/Racket/share/pkgs/scribble-lib/scribble/run.rkt:175:26: go
   .../private/map.rkt:40:19: loop
   .../racket/cmdline.rkt:191:51
   body of "/Applications/Racket/share/pkgs/scribble-lib/scribble/run.rkt"

i tried @(define-runtime-path ....... ) but i do not know how to import definitions in scribble document?

@(require racket/runtime-path)

i commited the change, removed the image from root, just leave the one in scribble dir ,will see in a few hours if the Racket package still build online and if the link to the image is not broken.... just have to wait now....

Yes it worked.
So i removed all the images at root of package project and just keeped the ones in scribbling sub directory:

mattei@mac Scheme-PLUS-for-Racket % rm *.png
mattei@mac Scheme-PLUS-for-Racket % ls scribblings/*.png
scribblings/BepiColombo-Mercury-Planet.png
scribblings/neural-harmonic-oscillator-and-equation-computed-harmonic-oscillator.png
scribblings/neural-sine-and-sine.png
scribblings/Scheme+.png

so, solution is to code as this in general for an image:

#lang scribble/manual
@(require scribble/core)
@(require scribble-code-examples)
@(require scriblib/footnote)
@(require racket/runtime-path)

@(define-runtime-path Scheme+ "Scheme+.png")
@centerline{@image[#:scale 1.0 Scheme+]}

to have it available at root of URL documentation of package while being in the scribbling sub-directory:

https://docs.racket-lang.org/Scheme-PLUS-for-Racket/Scheme%2B.png

Scheme+
thank you all,
it is really great to have some help from the Racket discourse users.

update: currently not working because i had removed Scheme+.rkt ah ah ah with Scheme+.png... but sure it will works in a few hours.....i just restored the delted file.

update 2:

yes it works:

https://docs.racket-lang.org/Scheme-PLUS-for-Racket/neural-harmonic-oscillator-and-equation-computed-harmonic-oscillator.png

https://docs.racket-lang.org/Scheme-PLUS-for-Racket/neural-harmonic-oscillator-and-equation-computed-harmonic-oscillator.png