-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Describe the bug
Its a little similar to #2503 but this time its not working in html as well.
Well i organize my requirements in multiple files and link to the different sections. In this case I even link to whole documents. Perhaps its wrong to do it that way and i should instead create a section instead of linking to the document itself, but since its not reported as an error nor a warning i guess its ok to do it.
To Reproduce
Create the files needed to reproduce the above:
main.sdoc:
[DOCUMENT]
TITLE: Main title
[TEXT]
STATEMENT: Main file
[DOCUMENT_FROM_FILE]
FILE: included.sdoc
[REQUIREMENT]
UID: REQ-003
TITLE: Third one
STATEMENT: >>>
Link to included doc: [LINK: INCLUDED-DOC]
<<<
included.sdoc:
[DOCUMENT]
TITLE: Included doc
UID: INCLUDED-DOC
[REQUIREMENT]
UID: REQ-001
TITLE: First one
STATEMENT: >>>
Link to myself start: [LINK: INCLUDED-DOC]
<<<
strictdoc_config.py:
from strictdoc.core.project_config import ProjectConfig
def create_config() -> ProjectConfig:
config = ProjectConfig(
project_title = "POC Bug",
project_features = [
"SEARCH",
"HTML2PDF",
],
server_host = "localhost",
server_port = 5000,
)
return config
using a docker with the --pre version from #2503 :
to create the pdf:
docker run --rm -v $(pwd):/data -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) -p 5000:5000 -it strictdoc:latest /bin/bash -c 'cd /data && strictdoc export . --output-dir output --formats html2pdf'
output:
strictdoc/docker: running a Docker container entrypoint.
strictdoc/docker: ensuring strictdoc user with UID=1000 and GID=1000 exists
strictdoc/docker: creating new group strictdoc with GID=1000
strictdoc/docker: creating new user strictdoc with UID=1000
strictdoc/docker: show created user info:
uid=1000(strictdoc) gid=1000(strictdoc) groups=1000(strictdoc)
Parallelization: Enabled
Step 'Parse SDoc project tree' start.
Step 'Find and read SDoc files' start.
Find asset directories ...................................... 0.00s
Find SDoc files ............................................. 0.00s
Completed finding SDoc and assets ........................... 0.00s
Reading SDOC: included.sdoc ................................. 0.01s
Reading SDOC: main.sdoc ..................................... 0.01s
Completed parsing all documents ............................. 0.03s
Completed building document tree ............................ 0.03s
Step 'Find and read SDoc files' took: 0.04 sec.
Step 'Build traceability graph' start.
Step 'Build traceability graph' took: 0.01 sec.
Step 'Parse SDoc project tree' took: 0.06 sec.
Step 'Export SDoc' start.
Copying StrictDoc's assets: 51 files.
Copying HTML2PDF.js: 1 files.
Generating printable HTML document .......................... 0.20s
html2pdf4doc: version 0.0.22
html2pdf4doc: creating ChromeDriver service.
html2pdf4doc: Installed Chrome version: 141.0.7390
html2pdf4doc: OS system: Linux, OS type: linux64.
html2pdf4doc: ChromeDriver does not exist in the local cache: /data/output/_cache/0.14.1a3/html2pdf/141/chromedriver-linux64/chromedriver
html2pdf4doc: sending GET request attempt 1: https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
html2pdf4doc: downloading ChromeDriver from: https://storage.googleapis.com/chrome-for-testing-public/141.0.7390.122/linux64/chromedriver-linux64.zip
html2pdf4doc: sending GET request attempt 1: https://storage.googleapis.com/chrome-for-testing-public/141.0.7390.122/linux64/chromedriver-linux64.zip
html2pdf4doc: saving downloaded ChromeDriver to path: /data/output/_cache/0.14.1a3/html2pdf/141/chromedriver.zip
html2pdf4doc: ChromeDriver downloaded to: /data/output/_cache/0.14.1a3/html2pdf/141/chromedriver-linux64/chromedriver
html2pdf4doc: ChromeDriver available at path: /data/output/_cache/0.14.1a3/html2pdf/141/chromedriver-linux64/chromedriver
html2pdf4doc: creating ChromeDriver.
html2pdf4doc: opening URL with ChromeDriver: file:///data/output/html2pdf/html/data/main-PDF.html
success: HTML2PDF4Doc completed its job.
html2pdf4doc: JS logs from the print session:
"""
{'level': 'INFO', 'message': 'file:///data/output/html2pdf/html/_static/html2pdf4doc.min.js 1:92978 "[HTML2PDF4DOC] Version:" "0.2.3"', 'source': 'console-api', 'timestamp': 1761518592076}
{'level': 'INFO', 'message': 'file:///data/output/html2pdf/html/_static/html2pdf4doc.min.js 1:2956 "[HTML2PDF4DOC] Config:" Object', 'source': 'console-api', 'timestamp': 1761518592082}
{'level': 'INFO', 'message': 'file:///data/output/html2pdf/html/_static/html2pdf4doc.min.js 1:97011 "[HTML2PDF4DOC] Page count:" 4', 'source': 'console-api', 'timestamp': 1761518592172}
{'level': 'DEBUG', 'message': 'file:///data/output/html2pdf/html/_static/html2pdf4doc.min.js 1:97063 "[HTML2PDF4DOC] Total time: 92.091064453125 ms"', 'source': 'console-api', 'timestamp': 1761518592172}
"""
html2pdf4doc: executing print command with ChromeDriver.
html2pdf4doc: validating page count ......................... 0.00s
html2pdf4doc: exit handler: quitting the ChromeDriver.
PDFPrintDriver: printing HTML to PDF using HTML2PDF and Chrome Driver . 2.35s
Step 'Export SDoc' took: 2.57 sec.
to create the html output:
docker run --rm -v $(pwd):/data -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) -p 5000:5000 -it strictdoc:latest /bin/bash -c 'cd /data && strictdoc export . --output-dir output'
output:
strictdoc/docker: running a Docker container entrypoint.
strictdoc/docker: ensuring strictdoc user with UID=1000 and GID=1000 exists
strictdoc/docker: creating new group strictdoc with GID=1000
strictdoc/docker: creating new user strictdoc with UID=1000
strictdoc/docker: show created user info:
uid=1000(strictdoc) gid=1000(strictdoc) groups=1000(strictdoc)
Parallelization: Enabled
Step 'Parse SDoc project tree' start.
Step 'Find and read SDoc files' start.
Find asset directories ...................................... 0.00s
Find SDoc files ............................................. 0.00s
Completed finding SDoc and assets ........................... 0.00s
Reading SDOC: included.sdoc ................................. 0.00s
Reading SDOC: main.sdoc ..................................... 0.00s
Completed parsing all documents ............................. 0.03s
Completed building document tree ............................ 0.03s
Step 'Find and read SDoc files' took: 0.04 sec.
Step 'Build traceability graph' start.
Step 'Build traceability graph' took: 0.01 sec.
Step 'Parse SDoc project tree' took: 0.06 sec.
Step 'Export SDoc' start.
Copying StrictDoc's assets: 51 files.
Copying HTML2PDF.js: 1 files.
Step 'Export static HTML search index' start.
Build search index .......................................... 0.00s
Serialize search index to JS ................................ 0.00s
Serialize lookup map {MID => node} to JS .................... 0.00s
Step 'Export static HTML search index' took: 0.01 sec.
Published: Main title ....................................... 0.21s
Export completed. Documentation tree can be found at:
/data/output/html
Step 'Export SDoc' took: 0.36 sec.
Expected behavior
Screenshots
If I click on the link in the pdf:

If I click on the link in the html output
