Améliorations gestion des images
This commit is contained in:
parent
ef3e875953
commit
3fdb2b7641
13 changed files with 542 additions and 10 deletions
|
@ -2,5 +2,6 @@ SECRET_KEY=
|
|||
USERNAME=
|
||||
PASS_HASH=
|
||||
#PASSWORD=only for testing
|
||||
FABRIQUEDOC_ENDPOINT=
|
||||
FABRIQUEDOC_ENDPOINT= # Use http://backend:8080 for Docker Compose, or http://127.0.0.1:8080 for local development
|
||||
FABRIQUEDOC_PUBLIC_ENDPOINT= # Use http://127.0.0.1:8080 for local development, or your public IP/domain for deployment
|
||||
ALGORITHM=HS256
|
||||
|
|
BIN
backend/.DS_Store
vendored
Normal file
BIN
backend/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -10,7 +10,7 @@ from models import User
|
|||
router = APIRouter()
|
||||
|
||||
@router.get("/")
|
||||
async def get_images(current_user: Annotated[User, Depends(get_current_active_user)]):
|
||||
async def get_images():
|
||||
# list all files in resources/images
|
||||
files = [f for f in os.listdir(f"{os.getcwd()}/resources/images") if os.path.isfile(os.path.join(f"{os.getcwd()}/resources/images", f))]
|
||||
# sort the files
|
||||
|
@ -18,7 +18,7 @@ async def get_images(current_user: Annotated[User, Depends(get_current_active_us
|
|||
return {"images": files}
|
||||
|
||||
@router.get("/{nom_image}")
|
||||
async def get_image(nom_image: str, current_user: Annotated[User, Depends(get_current_active_user)]):
|
||||
async def get_image(nom_image: str):
|
||||
return FileResponse(f"{os.getcwd()}/resources/images/{nom_image}")
|
||||
|
||||
@router.post("/")
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
|
@ -0,0 +1,156 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="1920"
|
||||
height="1080"
|
||||
viewBox="0 0 508 285.75"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.4 (e7c3feb1, 2024-10-09)"
|
||||
sodipodi:docname="atelier1-fullscreen-autohebergement-1080-1350-jaune.svg"
|
||||
xml:space="preserve"
|
||||
inkscape:export-filename="atelier1-fullscreen-autohebergement-1080-1350-jaune.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
inkscape:export-batch-path="linkedin"
|
||||
inkscape:export-batch-name=""
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="0.38448931"
|
||||
inkscape:cx="707.43189"
|
||||
inkscape:cy="741.24297"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="971"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="73"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer1"
|
||||
showguides="false"
|
||||
showgrid="false" /><defs
|
||||
id="defs1"><inkscape:path-effect
|
||||
effect="fillet_chamfer"
|
||||
id="path-effect13"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
nodesatellites_param="C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 | C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1"
|
||||
radius="3"
|
||||
unit="px"
|
||||
method="auto"
|
||||
mode="C"
|
||||
chamfer_steps="1"
|
||||
flexible="false"
|
||||
use_knot_distance="true"
|
||||
apply_no_radius="true"
|
||||
apply_with_radius="true"
|
||||
only_selected="false"
|
||||
hide_knots="false" /><style
|
||||
id="style1">
|
||||
.cls-1 {
|
||||
fill: #ccc;
|
||||
}
|
||||
</style><inkscape:path-effect
|
||||
effect="fillet_chamfer"
|
||||
id="path-effect13-8"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
nodesatellites_param="C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 | C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1"
|
||||
radius="3"
|
||||
unit="px"
|
||||
method="auto"
|
||||
mode="F"
|
||||
chamfer_steps="1"
|
||||
flexible="false"
|
||||
use_knot_distance="true"
|
||||
apply_no_radius="true"
|
||||
apply_with_radius="true"
|
||||
only_selected="false"
|
||||
hide_knots="false" /><style
|
||||
id="style1-6">
|
||||
.cls-1 {
|
||||
fill: #ccc;
|
||||
}
|
||||
</style></defs><g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(239.11618,210.6644)"
|
||||
style="display:inline"><rect
|
||||
style="fill:#00091a;fill-opacity:1;stroke-width:0.864124"
|
||||
id="rect1"
|
||||
width="508"
|
||||
height="285.75"
|
||||
x="-239.11618"
|
||||
y="-210.6644" /><text
|
||||
xml:space="preserve"
|
||||
style="font-weight:500;font-size:22.5778px;line-height:1.2;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Medium';text-align:center;writing-mode:lr-tb;direction:ltr;text-anchor:middle;fill:#1c1c1c;stroke:#d9a520;stroke-width:5.29391;stroke-linecap:round;stroke-linejoin:round"
|
||||
x="-51.819206"
|
||||
y="-143.01863"
|
||||
id="text1"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819206"
|
||||
y="-143.01863">ATELIER #1 </tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819202"
|
||||
y="-115.92527"
|
||||
id="tspan3">INTRODUCTION À </tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819202"
|
||||
y="-88.831909"
|
||||
id="tspan5">L'AUTOHÉBERGEMENT</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819206"
|
||||
y="-61.738544"
|
||||
id="tspan2"></tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819202"
|
||||
y="-34.645184"
|
||||
id="tspan6">15 AVRIL 2025 À 9H00</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819206"
|
||||
y="-7.5518212"
|
||||
id="tspan4"> </tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="-51.819202"
|
||||
y="19.54154"
|
||||
id="tspan31">JEVALIDE.CA/AUTO1</tspan></text><g
|
||||
id="g2"
|
||||
transform="matrix(2.0420053,0,0,2.0420053,131.23875,-100.46058)"
|
||||
style="fill:#d9a520;fill-opacity:1"><path
|
||||
d="M 9,9 C 8.199,9 7.446,8.688 6.88,8.122 6.312,7.555 6,6.802 6,6.001 6,5.2 6.312,4.446 6.878,3.879 7.445,3.312 8.198,3 8.999,3 9,3 9,3 9,3 9.801,3 10.554,3.312 11.12,3.878 11.687,4.445 12,5.198 12,5.999 12,6.8 11.688,7.554 11.122,8.121 10.555,8.688 9.802,9 9.001,9 Z M 9,4.5 c 0,0 0,0 0,0 C 8.599,4.5 8.222,4.656 7.938,4.94 7.656,5.223 7.5,5.6 7.5,6 7.5,6.401 7.656,6.778 7.94,7.061 8.223,7.344 8.6,7.5 9,7.5 c 0,0 0,0 0,0 0.401,0 0.778,-0.156 1.061,-0.44 C 10.344,6.777 10.5,6.4 10.5,6 10.5,5.599 10.344,5.222 10.06,4.939 9.777,4.656 9.4,4.5 9,4.5 Z"
|
||||
id="path1"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="m 25.5,26.96 c 0.69,1.19 0.66,2.5 -0.05,2.91 -0.72,0.42 -1.86,-0.22 -2.55,-1.41 -0.193,-0.333 -0.31,-0.662 -0.388,-0.986 0.906,-0.338 1.709,-0.761 2.418,-1.258 0.205,0.216 0.403,0.457 0.57,0.744 z"
|
||||
id="path2"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 9.488,27.474 C 9.41,27.798 9.293,28.127 9.1,28.46 8.41,29.65 7.27,30.29 6.55,29.87 5.84,29.46 5.81,28.15 6.5,26.96 c 0.167,-0.287 0.365,-0.528 0.57,-0.744 0.709,0.497 1.512,0.921 2.418,1.258 z"
|
||||
id="path3"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 13.182,10.5 C 13.07,10.182 13,9.848 13,9.501 13,8.7 13.312,7.946 13.878,7.379 14.445,6.812 15.198,6.5 15.999,6.5 c 0,0 10e-4,0 10e-4,0 0.801,0 1.554,0.312 2.12,0.878 0.567,0.567 0.88,1.32 0.88,2.121 0,0.348 -0.069,0.683 -0.182,1.001 H 17.11 C 17.359,10.224 17.5,9.874 17.5,9.5 17.5,9.099 17.344,8.722 17.06,8.439 16.777,8.156 16.4,8 16,8 16,8 16,8 16,8 15.599,8 15.222,8.156 14.939,8.44 14.656,8.723 14.5,9.1 14.5,9.5 c 0,0.374 0.141,0.724 0.39,1 z"
|
||||
id="path4"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 26.503,16.5 C 26.825,17.224 27,17.912 27,19 27,24.799 22.075,27 16,27 9.925,27 5,24.799 5,19 5,17.235 5.456,16.525 6.263,15 4,13 5,12 5,12 h 22 c 0,0 1,1 -1.263,3 H 8.75 C 8.336,15 8,15.336 8,15.75 8,16.164 8.336,16.5 8.75,16.5 Z"
|
||||
id="path5"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 28.445,2.788 C 26.957,4.94 25.153,8.52 24.38,10.5 h -3 C 22.21,8.121 23.783,4.379 24.858,2.274 24.945,2.105 25.12,2 25.31,2 h 2.729 c 0.405,0 0.635,0.455 0.406,0.788 z"
|
||||
id="path6"
|
||||
style="fill:#d9a520;fill-opacity:1" /></g></g></svg>
|
After Width: | Height: | Size: 8 KiB |
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="1920"
|
||||
height="384"
|
||||
viewBox="0 0 508 101.6"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.4 (e7c3feb1, 2024-10-09)"
|
||||
sodipodi:docname="banniere-autohebergement-1920-jaune.svg"
|
||||
xml:space="preserve"
|
||||
inkscape:export-filename="banniere-autohebergement-1920-jaune.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
inkscape:export-batch-path="linkedin"
|
||||
inkscape:export-batch-name=""
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="0.38448931"
|
||||
inkscape:cx="707.43189"
|
||||
inkscape:cy="741.24297"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="971"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="73"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer1"
|
||||
showguides="false"
|
||||
showgrid="false" /><defs
|
||||
id="defs1"><inkscape:path-effect
|
||||
effect="fillet_chamfer"
|
||||
id="path-effect13"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
nodesatellites_param="C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 | C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1"
|
||||
radius="3"
|
||||
unit="px"
|
||||
method="auto"
|
||||
mode="C"
|
||||
chamfer_steps="1"
|
||||
flexible="false"
|
||||
use_knot_distance="true"
|
||||
apply_no_radius="true"
|
||||
apply_with_radius="true"
|
||||
only_selected="false"
|
||||
hide_knots="false" /><style
|
||||
id="style1">
|
||||
.cls-1 {
|
||||
fill: #ccc;
|
||||
}
|
||||
</style><inkscape:path-effect
|
||||
effect="fillet_chamfer"
|
||||
id="path-effect13-8"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
nodesatellites_param="C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 | C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1"
|
||||
radius="3"
|
||||
unit="px"
|
||||
method="auto"
|
||||
mode="F"
|
||||
chamfer_steps="1"
|
||||
flexible="false"
|
||||
use_knot_distance="true"
|
||||
apply_no_radius="true"
|
||||
apply_with_radius="true"
|
||||
only_selected="false"
|
||||
hide_knots="false" /><style
|
||||
id="style1-6">
|
||||
.cls-1 {
|
||||
fill: #ccc;
|
||||
}
|
||||
</style></defs><g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(239.11618,210.6644)"
|
||||
style="display:inline"><rect
|
||||
style="fill:#00091a;fill-opacity:1;stroke-width:0.515264"
|
||||
id="rect1"
|
||||
width="508"
|
||||
height="101.6"
|
||||
x="-239.11618"
|
||||
y="-210.6644" /><text
|
||||
xml:space="preserve"
|
||||
style="font-weight:500;font-size:22.5778px;line-height:1.2;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Medium';text-align:center;writing-mode:lr-tb;direction:ltr;text-anchor:middle;fill:#1c1c1c;stroke:#d9a520;stroke-width:5.29391;stroke-linecap:round;stroke-linejoin:round"
|
||||
x="35.94632"
|
||||
y="-178.84103"
|
||||
id="text1"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="35.94632"
|
||||
y="-178.84103">Intro autohébergement</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="35.94632"
|
||||
y="-151.74767"
|
||||
id="tspan2">15 avril 2025 à 9h00 </tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:22.5778px;fill:#d9a520;fill-opacity:1;stroke:none;stroke-width:5.29391"
|
||||
x="35.946323"
|
||||
y="-124.65431"
|
||||
id="tspan31">jevalide.ca/auto1</tspan></text><g
|
||||
id="g2"
|
||||
transform="matrix(2.0420053,0,0,2.0420053,187.85958,-192.02548)"
|
||||
style="fill:#d9a520;fill-opacity:1"><path
|
||||
d="M 9,9 C 8.199,9 7.446,8.688 6.88,8.122 6.312,7.555 6,6.802 6,6.001 6,5.2 6.312,4.446 6.878,3.879 7.445,3.312 8.198,3 8.999,3 9,3 9,3 9,3 9.801,3 10.554,3.312 11.12,3.878 11.687,4.445 12,5.198 12,5.999 12,6.8 11.688,7.554 11.122,8.121 10.555,8.688 9.802,9 9.001,9 Z M 9,4.5 c 0,0 0,0 0,0 C 8.599,4.5 8.222,4.656 7.938,4.94 7.656,5.223 7.5,5.6 7.5,6 7.5,6.401 7.656,6.778 7.94,7.061 8.223,7.344 8.6,7.5 9,7.5 c 0,0 0,0 0,0 0.401,0 0.778,-0.156 1.061,-0.44 C 10.344,6.777 10.5,6.4 10.5,6 10.5,5.599 10.344,5.222 10.06,4.939 9.777,4.656 9.4,4.5 9,4.5 Z"
|
||||
id="path1"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="m 25.5,26.96 c 0.69,1.19 0.66,2.5 -0.05,2.91 -0.72,0.42 -1.86,-0.22 -2.55,-1.41 -0.193,-0.333 -0.31,-0.662 -0.388,-0.986 0.906,-0.338 1.709,-0.761 2.418,-1.258 0.205,0.216 0.403,0.457 0.57,0.744 z"
|
||||
id="path2"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 9.488,27.474 C 9.41,27.798 9.293,28.127 9.1,28.46 8.41,29.65 7.27,30.29 6.55,29.87 5.84,29.46 5.81,28.15 6.5,26.96 c 0.167,-0.287 0.365,-0.528 0.57,-0.744 0.709,0.497 1.512,0.921 2.418,1.258 z"
|
||||
id="path3"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 13.182,10.5 C 13.07,10.182 13,9.848 13,9.501 13,8.7 13.312,7.946 13.878,7.379 14.445,6.812 15.198,6.5 15.999,6.5 c 0,0 10e-4,0 10e-4,0 0.801,0 1.554,0.312 2.12,0.878 0.567,0.567 0.88,1.32 0.88,2.121 0,0.348 -0.069,0.683 -0.182,1.001 H 17.11 C 17.359,10.224 17.5,9.874 17.5,9.5 17.5,9.099 17.344,8.722 17.06,8.439 16.777,8.156 16.4,8 16,8 16,8 16,8 16,8 15.599,8 15.222,8.156 14.939,8.44 14.656,8.723 14.5,9.1 14.5,9.5 c 0,0.374 0.141,0.724 0.39,1 z"
|
||||
id="path4"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 26.503,16.5 C 26.825,17.224 27,17.912 27,19 27,24.799 22.075,27 16,27 9.925,27 5,24.799 5,19 5,17.235 5.456,16.525 6.263,15 4,13 5,12 5,12 h 22 c 0,0 1,1 -1.263,3 H 8.75 C 8.336,15 8,15.336 8,15.75 8,16.164 8.336,16.5 8.75,16.5 Z"
|
||||
id="path5"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 28.445,2.788 C 26.957,4.94 25.153,8.52 24.38,10.5 h -3 C 22.21,8.121 23.783,4.379 24.858,2.274 24.945,2.105 25.12,2 25.31,2 h 2.729 c 0.405,0 0.635,0.455 0.406,0.788 z"
|
||||
id="path6"
|
||||
style="fill:#d9a520;fill-opacity:1" /></g></g></svg>
|
After Width: | Height: | Size: 7.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
|
@ -0,0 +1,152 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="1920"
|
||||
height="1080"
|
||||
viewBox="0 0 508 285.74999"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.4 (e7c3feb1, 2024-10-09)"
|
||||
sodipodi:docname="slides-rituels-numeriques-1920-1080-jaune-top.svg"
|
||||
xml:space="preserve"
|
||||
inkscape:export-filename="slides-rituels-numeriques-1920-1080-jaune.pdf"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:zoom="0.38448931"
|
||||
inkscape:cx="704.83104"
|
||||
inkscape:cy="730.83956"
|
||||
inkscape:window-width="1200"
|
||||
inkscape:window-height="1027"
|
||||
inkscape:window-x="2560"
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="layer1"
|
||||
showguides="false" /><defs
|
||||
id="defs1"><inkscape:path-effect
|
||||
effect="fillet_chamfer"
|
||||
id="path-effect13"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
nodesatellites_param="C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 | C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1"
|
||||
radius="3"
|
||||
unit="px"
|
||||
method="auto"
|
||||
mode="C"
|
||||
chamfer_steps="1"
|
||||
flexible="false"
|
||||
use_knot_distance="true"
|
||||
apply_no_radius="true"
|
||||
apply_with_radius="true"
|
||||
only_selected="false"
|
||||
hide_knots="false" /><style
|
||||
id="style1">
|
||||
.cls-1 {
|
||||
fill: #ccc;
|
||||
}
|
||||
</style><inkscape:path-effect
|
||||
effect="fillet_chamfer"
|
||||
id="path-effect13-8"
|
||||
is_visible="true"
|
||||
lpeversion="1"
|
||||
nodesatellites_param="C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 | C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1 @ C,0,0,1,0,0.79375,0,1"
|
||||
radius="3"
|
||||
unit="px"
|
||||
method="auto"
|
||||
mode="F"
|
||||
chamfer_steps="1"
|
||||
flexible="false"
|
||||
use_knot_distance="true"
|
||||
apply_no_radius="true"
|
||||
apply_with_radius="true"
|
||||
only_selected="false"
|
||||
hide_knots="false" /><style
|
||||
id="style1-6">
|
||||
.cls-1 {
|
||||
fill: #ccc;
|
||||
}
|
||||
</style></defs><g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(239.11618,210.6644)"
|
||||
style="display:inline"><rect
|
||||
style="fill:#00091a;fill-opacity:1;stroke-width:0.864124"
|
||||
id="rect1"
|
||||
width="508"
|
||||
height="285.75"
|
||||
x="-239.11618"
|
||||
y="-210.6644" /><g
|
||||
inkscape:label="Calque 1"
|
||||
id="layer1-5"
|
||||
transform="matrix(0.59999999,0,0,0.59999999,-79.771474,-227.10426)"
|
||||
style="display:inline"><rect
|
||||
style="fill:#00091a;fill-opacity:1;stroke-width:0.264583"
|
||||
id="rect1-7"
|
||||
width="285.75"
|
||||
height="47.625"
|
||||
x="14.883826"
|
||||
y="27.399773" /><g
|
||||
id="g1"
|
||||
transform="matrix(1.4173946,0,0,1.4173946,27.924037,28.533734)"
|
||||
style="fill:#d9a520;fill-opacity:1"><path
|
||||
d="M 19.5,23 V 9.983 L 25.632,11.626 21.879,25.631 18.74,24.79 C 19.207,24.335 19.5,23.702 19.5,23 Z"
|
||||
id="path1"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 29.966,9.94 24.79,29.259 c -0.143,0.533 -0.691,0.85 -1.225,0.707 L 10.042,26.343 C 9.637,26.234 9.36,25.892 9.31,25.5 h 6.281 l 6.623,1.774 c 0.065,0.018 0.131,0.025 0.194,0.025 0.332,0 0.635,-0.221 0.725,-0.556 l 4.142,-15.455 c 0.052,-0.192 0.024,-0.397 -0.075,-0.569 -0.099,-0.172 -0.264,-0.298 -0.455,-0.35 L 19.5,8.43 V 6.101 l 9.759,2.615 c 0.533,0.142 0.85,0.691 0.707,1.224 z"
|
||||
id="path2"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
d="M 17,2 H 3 C 2.448,2 2,2.448 2,3 v 20 c 0,0.552 0.448,1 1,1 h 14 c 0.552,0 1,-0.448 1,-1 V 3 C 18,2.448 17.552,2 17,2 Z M 6,13 C 5.973,10.537 8.302,8.589 10.719,9.072 9.055,10.889 10.508,14.084 13,14 13.318,14 13.619,13.937 13.907,13.845 12.862,18.454 6.068,17.775 6,13 Z"
|
||||
id="path3"
|
||||
style="fill:#d9a520;fill-opacity:1" /></g><text
|
||||
xml:space="preserve"
|
||||
style="font-weight:500;font-size:16.9333px;line-height:1.2;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Medium';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#d9a520;fill-opacity:1;stroke-width:0.264583"
|
||||
x="157.34395"
|
||||
y="45.954483"
|
||||
id="text1"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan1"
|
||||
style="font-size:16.9333px;line-height:1.2;text-align:center;text-anchor:middle;fill:#d9a520;fill-opacity:1;stroke-width:0.264583"
|
||||
x="157.34395"
|
||||
y="45.954483">RITUELS</tspan><tspan
|
||||
sodipodi:role="line"
|
||||
style="font-size:16.9333px;line-height:1.2;text-align:center;text-anchor:middle;fill:#d9a520;fill-opacity:1;stroke-width:0.264583"
|
||||
x="157.34395"
|
||||
y="66.274445"
|
||||
id="tspan8">NUMÉRIQUES</tspan></text><g
|
||||
id="g13"
|
||||
transform="matrix(1.375,0,0,1.375,-99.508519,-17.220227)"
|
||||
style="fill:#d9a520;fill-opacity:1"><path
|
||||
d="m 260.94633,48.175766 v 2.50734 c 0,2.03835 1.05516,3.83223 2.64583,4.872571 v 1.176672 c 0,0.6731 -0.5035,1.237391 -1.17977,1.314649 l -4.09381,0.503845 c -1.93781,0.238125 -3.46063,1.771501 -3.68711,3.710368 l -0.56431,4.826062 h 4.23334 v -2.38125 c 0,-0.43815 0.3556,-0.79375 0.79375,-0.79375 0.43815,0 0.79375,0.3556 0.79375,0.79375 v 2.38125 h 13.75833 v -2.38125 c 0,-0.43815 0.3556,-0.79375 0.79375,-0.79375 0.43815,0 0.79375,0.3556 0.79375,0.79375 v 2.38125 h 4.23333 l -0.56379,-4.826062 c -0.22648,-1.938867 -1.74982,-3.471185 -3.68763,-3.710368 l -4.10104,-0.504879 c -0.66887,-0.0762 -1.17254,-0.640515 -1.17254,-1.313615 v -1.176672 c 1.59068,-1.040341 2.64584,-2.834221 2.64584,-4.872571 v -2.50734 c -0.52917,0.06773 -1.05834,0.124949 -1.5875,0.173633 v 2.333707 c 0,2.334684 -1.89865,4.233334 -4.23334,4.233334 -2.33468,0 -4.23333,-1.89865 -4.23333,-4.233334 v -2.333707 c -0.53023,-0.04868 -1.05833,-0.1059 -1.5875,-0.173633 z"
|
||||
style="fill:#d9a520;fill-opacity:1"
|
||||
id="path9" /><path
|
||||
d="m 267.29633,35.337273 c -2.64583,0 -4.41825,3.318933 -4.73046,5.291667 -0.17145,1.091141 -0.94516,2.659393 -1.36426,3.844726 -1.24566,-0.1651 -2.49015,-0.369213 -3.73052,-0.645438 -0.56727,-0.122767 -1.13494,0.23416 -1.26194,0.804602 -0.127,0.570441 0.23313,1.135455 0.80357,1.262455 3.23638,0.718608 6.49478,1.078487 9.75444,1.078487 3.25967,0 6.51858,-0.359879 9.75496,-1.078487 0.57044,-0.127 0.93005,-0.692014 0.80305,-1.262455 -0.127,-0.570442 -0.69413,-0.926311 -1.26245,-0.804602 -1.29646,0.287866 -2.59825,0.501476 -3.90105,0.668693 -0.7112,-1.325034 -2.00784,-3.57059 -1.69034,-4.397148 1.22661,0.700617 2.61962,0.266489 4.37751,-0.189653 0.45932,-0.119591 0.51733,-0.736422 0.0961,-0.955497 -3.04694,-1.585383 -4.38791,-3.61735 -7.64863,-3.61735 z"
|
||||
id="path8"
|
||||
sodipodi:nodetypes="scccscscscccccss"
|
||||
style="fill:#d9a520;fill-opacity:1" /><path
|
||||
id="path6"
|
||||
style="fill:#d9a520;fill-opacity:1;stroke-width:0.00489973"
|
||||
sodipodi:type="inkscape:offset"
|
||||
inkscape:radius="0.13371253"
|
||||
inkscape:original="M 268.03711 40.927734 C 267.76341 41.005194 267.53875 41.167256 267.36133 41.416016 C 267.07651 41.805594 266.85018 42.184435 266.68555 42.548828 C 266.5801 42.783379 266.49374 43.064295 266.42578 43.392578 L 266.41016 43.394531 C 266.21868 43.160863 265.96175 43.060971 265.63867 43.09375 L 265.14453 43.355469 L 265.15039 43.373047 L 265.2207 43.365234 C 265.65981 43.320054 266.02183 43.532608 266.30469 44.001953 C 266.33239 43.999453 266.46383 43.941851 266.70117 43.828125 C 266.73607 43.825725 266.75355 43.766413 266.75195 43.650391 C 266.80325 43.021853 267.12092 42.248862 267.70703 41.333984 C 267.78243 41.214969 267.89285 41.085543 268.03906 40.945312 L 268.03711 40.927734 z "
|
||||
d="m 268,40.798828 c -0.30227,0.08555 -0.55558,0.26921 -0.74805,0.539063 h 0.002 c -0.28928,0.395673 -0.52021,0.781642 -0.68946,1.15625 -0.0883,0.196387 -0.15313,0.442189 -0.21484,0.695312 -0.20183,-0.161208 -0.44203,-0.257185 -0.72461,-0.228516 a 0.1337259,0.1337259 0 0 0 -0.0488,0.01563 l -0.49414,0.261719 a 0.1337259,0.1337259 0 0 0 -0.0644,0.160156 l 0.006,0.01758 a 0.1337259,0.1337259 0 0 0 0.14258,0.08984 l 0.0684,-0.0078 c 0.3892,-0.04004 0.68905,0.130834 0.95508,0.572265 a 0.1337259,0.1337259 0 0 0 0.12696,0.06445 c 0.0433,-0.0039 0.0526,-0.01062 0.0762,-0.01953 0.0236,-0.0089 0.0517,-0.02014 0.0859,-0.03516 0.0685,-0.03003 0.16183,-0.07364 0.28125,-0.130859 l -0.0488,0.01172 c 0.0456,-0.0031 0.0908,-0.02968 0.11523,-0.05859 0.0245,-0.02891 0.0354,-0.05762 0.043,-0.08398 0.0152,-0.05273 0.0165,-0.104883 0.0156,-0.169922 v 0.01367 c 0.0484,-0.59279 0.35605,-1.351308 0.93554,-2.255859 0.0673,-0.106182 0.16973,-0.230174 0.31055,-0.365234 a 0.1337259,0.1337259 0 0 0 0.041,-0.111329 l -0.002,-0.01758 A 0.1337259,0.1337259 0 0 0 268,40.798828 Z"
|
||||
transform="matrix(0.83681088,0,0,0.83681088,43.545875,6.8364642)" /><path
|
||||
id="path4"
|
||||
style="fill:#d9a520;fill-opacity:1;stroke-width:0.00489973"
|
||||
sodipodi:type="inkscape:offset"
|
||||
inkscape:radius="0.25159839"
|
||||
inkscape:original="M 268.73242 40.082031 L 264.04297 40.5625 L 264.02539 40.580078 L 264.58789 44.814453 L 264.60938 44.832031 L 269.29883 44.353516 L 269.31836 44.330078 L 268.75586 40.095703 L 268.73242 40.082031 z M 268.43164 40.431641 L 268.91602 44.070312 L 264.9043 44.480469 L 264.41992 40.841797 L 268.43164 40.431641 z "
|
||||
d="m 268.70703,39.832031 -4.68945,0.480469 a 0.25162355,0.25162355 0 0 0 -0.15235,0.07227 l -0.0176,0.01758 a 0.25162355,0.25162355 0 0 0 -0.0723,0.210937 l 0.5625,4.234375 a 0.25162355,0.25162355 0 0 0 0.0898,0.16211 l 0.0215,0.01758 a 0.25162355,0.25162355 0 0 0 0.18555,0.05469 l 4.68945,-0.478515 a 0.25162355,0.25162355 0 0 0 0.16797,-0.08984 l 0.0195,-0.02344 a 0.25162355,0.25162355 0 0 0 0.0566,-0.193359 l -0.5625,-4.234375 a 0.25162355,0.25162355 0 0 0 -0.12305,-0.183594 l -0.0234,-0.01367 a 0.25162355,0.25162355 0 0 0 -0.15234,-0.0332 z m -0.49414,0.875 0.41797,3.140625 -3.50977,0.357422 -0.41797,-3.140625 z" /></g></g></g></svg>
|
After Width: | Height: | Size: 11 KiB |
|
@ -1,6 +1,8 @@
|
|||
# Importation des bibliothèques nécessaires
|
||||
import mdformat # Pour formater le texte Markdown
|
||||
import streamlit as st # Pour créer l'interface utilisateur web
|
||||
import requests # Pour effectuer des requêtes HTTP
|
||||
import re # Pour les expressions régulières
|
||||
|
||||
# Importation du texte de démonstration depuis un autre fichier
|
||||
from demo_text import demo_text
|
||||
|
@ -9,22 +11,76 @@ from demo_text import demo_text
|
|||
def app_tab1():
|
||||
# Fonction de rappel pour le bouton de formatage
|
||||
def button1_callback():
|
||||
# Récupère le texte Markdown actuel
|
||||
markdown_text = st.session_state['markdown']
|
||||
|
||||
# Vérifie si l'utilisateur veut ajouter des nouvelles pages
|
||||
if st.session_state.get('add_newpage_checkbox', False):
|
||||
header_level = st.session_state['header_level_select']
|
||||
|
||||
# 1. Insérer \newpage avant le niveau d'en-tête spécifié
|
||||
lines = markdown_text.split('\n')
|
||||
new_lines = []
|
||||
for line in lines:
|
||||
if line.startswith('#' * header_level + ' '):
|
||||
new_lines.append('\\newpage')
|
||||
new_lines.append(line)
|
||||
markdown_text = '\n'.join(new_lines)
|
||||
|
||||
# 2. Supprimer les \newpage trop proches, sauf s'il y a une image
|
||||
final_lines = []
|
||||
i = 0
|
||||
while i < len(new_lines):
|
||||
if new_lines[i] == '\\newpage':
|
||||
# Vérifier si la prochaine \newpage est trop proche
|
||||
next_newpage_index = -1
|
||||
for j in range(i + 1, min(i + 11, len(new_lines))): # Vérifier jusqu'à 10 lignes plus loin
|
||||
if new_lines[j] == '\\newpage':
|
||||
next_newpage_index = j
|
||||
break
|
||||
|
||||
if next_newpage_index != -1:
|
||||
# Vérifier s'il y a une image entre les deux \newpage
|
||||
image_found = False
|
||||
for k in range(i + 1, next_newpage_index):
|
||||
if '!' in new_lines[k] and '[' in new_lines[k] and ']' in new_lines[k] and '(' in new_lines[k] and ')' in new_lines[k]:
|
||||
image_found = True
|
||||
break
|
||||
|
||||
if not image_found:
|
||||
# Supprimer la \newpage actuelle si la prochaine est trop proche et pas d'image
|
||||
i += 1 # Passer la \newpage actuelle
|
||||
continue # Ne pas l'ajouter à final_lines
|
||||
|
||||
final_lines.append(new_lines[i])
|
||||
i += 1
|
||||
|
||||
markdown_text = '\n'.join(final_lines)
|
||||
|
||||
# Formate le texte Markdown stocké dans la session et active la numérotation
|
||||
st.session_state['markdown'] = mdformat.text(st.session_state['markdown'],
|
||||
st.session_state['markdown'] = mdformat.text(markdown_text,
|
||||
options={"number": True})
|
||||
|
||||
# Création d'une zone de texte pour entrer le contenu Markdown
|
||||
st.session_state['content'] = st.text_area(
|
||||
st.text_area(
|
||||
# Texte d'instruction pour l'utilisateur
|
||||
"Entre ton texte ici. Les images sont dans ./images/",
|
||||
# Texte par défaut (démonstration)
|
||||
demo_text,
|
||||
st.session_state.get('markdown', demo_text),
|
||||
# Hauteur de la zone de texte en pixels
|
||||
height=450,
|
||||
# Clé unique pour identifier cet élément dans la session
|
||||
key='markdown'
|
||||
)
|
||||
|
||||
# Menu déroulant pour choisir le niveau d'en-tête
|
||||
st.selectbox(
|
||||
"Insérer une nouvelle page avant les en-têtes de niveau :",
|
||||
options=[1, 2, 3, 4, 5, 6],
|
||||
index=1, # Par défaut, niveau 2
|
||||
key='header_level_select'
|
||||
)
|
||||
|
||||
# Création d'un bouton pour formater le texte
|
||||
st.button(
|
||||
# Texte affiché sur le bouton
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# Importation de la bibliothèque Streamlit
|
||||
# Streamlit est utilisé pour créer des applications web interactives en Python
|
||||
import streamlit as st
|
||||
import re # Pour les expressions régulières
|
||||
import requests # Pour effectuer des requêtes HTTP
|
||||
|
||||
# Définition de la fonction principale pour l'onglet 2 de l'application
|
||||
def app_tab2():
|
||||
|
@ -12,4 +14,29 @@ def app_tab2():
|
|||
# st.markdown() est utilisé pour rendre du texte formaté en Markdown
|
||||
# st.session_state est un dictionnaire qui conserve les données entre les rechargements de page
|
||||
# ['content'] fait référence à la clé où le contenu Markdown est stocké
|
||||
st.markdown(st.session_state['content'])
|
||||
|
||||
markdown_content = st.session_state['markdown']
|
||||
fabriquedoc_public_endpoint = st.session_state['fabriquedoc_public_endpoint']
|
||||
bearer_token = st.session_state['bearer_token']
|
||||
|
||||
# Regex pour trouver les images Markdown: 
|
||||
# Capture le chemin complet de l'image (y compris les répertoires si présents)
|
||||
image_pattern = re.compile(r'!\[.*?\]\((.*?)\)')
|
||||
|
||||
def replace_image_path(match):
|
||||
image_path = match.group(1)
|
||||
# Si le chemin est déjà une URL complète, ne rien faire
|
||||
if image_path.startswith('http://') or image_path.startswith('https://'):
|
||||
return match.group(0)
|
||||
|
||||
# Construire l'URL complète de l'image
|
||||
# On suppose que le chemin dans le markdown est juste le nom du fichier ou un chemin relatif simple
|
||||
# et que le backend sert les images via /images/{nom_fichier}
|
||||
image_name = image_path.split('/')[-1] # Prend juste le nom du fichier
|
||||
full_image_url = f"{fabriquedoc_public_endpoint}/images/{image_name}"
|
||||
return f"[0][2:]}]({full_image_url})"
|
||||
|
||||
# Remplacer tous les chemins d'images relatifs par des URLs complètes
|
||||
processed_markdown_content = image_pattern.sub(replace_image_path, markdown_content)
|
||||
|
||||
st.markdown(processed_markdown_content)
|
|
@ -48,8 +48,8 @@ Ceci est centré
|
|||
|
||||
## Images
|
||||
|
||||
- 
|
||||
- [](url-de-l-image-complete.jpg)
|
||||
- 
|
||||
- [](https://jevalide.ca)
|
||||
|
||||
## Citations
|
||||
|
||||
|
|
|
@ -32,7 +32,11 @@ def init_session_state():
|
|||
if 'fabriquedoc_endpoint' not in st.session_state:
|
||||
load_dotenv() # Charge les variables d'environnement depuis un fichier .env
|
||||
# Définit l'URL du backend, avec une valeur par défaut si non spécifiée
|
||||
st.session_state['fabriquedoc_endpoint'] = os.environ.get("FABRIQUEDOC_ENDPOINT", "http://127.0.0.1:8080")
|
||||
# Définit l'URL du backend. Utilise 'http://backend:8080' pour Docker Compose,
|
||||
# ou 'http://127.0.0.1:8080' pour un développement local sans Docker Compose.
|
||||
st.session_state['fabriquedoc_endpoint'] = os.environ.get("FABRIQUEDOC_ENDPOINT", "http://backend:8080")
|
||||
|
||||
st.session_state['fabriquedoc_public_endpoint'] = os.environ.get("FABRIQUEDOC_PUBLIC_ENDPOINT", "http://127.0.0.1:8080")
|
||||
|
||||
# Initialise d'autres variables de session avec des valeurs par défaut
|
||||
for key, default_value in [('options', ""), ('bearer_token', ""), ('logged_in', False)]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue