Skip to content

Commit 2e28ef7

Browse files
authored
Merge pull request #2097 from strictdoc-project/stanislaw/docs
docs: update release notes and Docker instructions
2 parents 5bf5069 + 6393552 commit 2e28ef7

File tree

3 files changed

+63
-14
lines changed

3 files changed

+63
-14
lines changed

docs/strictdoc_01_user_guide.sdoc

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,25 +267,59 @@ TITLE: Installing StrictDoc into a Docker container
267267
[TEXT]
268268
MID: 32e04944c2a14ead93248ff1ea37a68d
269269
STATEMENT: >>>
270-
StrictDoc can be invoked inside of a Docker container. To make data available
271-
to the Docker container (here: ``strictdoc:latest``) as well as to the host
272-
system, one needs to mount a volume via ``-v`` option.
270+
StrictDoc can be installed with a dedicated Docker image.
273271

274-
In the host operating system terminal:
272+
To build the image:
275273

276274
.. code-block:: text
277275

278-
docker build . -t strictdoc:latest
279-
docker run --name strictdoc --rm -v "$(pwd)/docs:/data" -i -t strictdoc:latest
276+
docker build . \
277+
--build-arg STRICTDOC_SOURCE=pypi \
278+
-t strictdoc:latest
280279

281-
In the container terminal:
280+
The ``STRICTDOC_SOURCE`` argument is optional (default value is ``pypi``) and can be used to specify which Git revision the container shall check out when installing StrictDoc with ``pip install``. Possible values: a branch name, e.g., ``main``, or a commit hash.
281+
282+
To run the container:
283+
284+
.. code-block:: text
285+
286+
docker run \
287+
--name strictdoc \
288+
--rm \
289+
-e HOST_UID=$(id -u) \
290+
-e HOST_GID=$(id -g) \
291+
-v "$(pwd):/data" \
292+
-i -t \
293+
strictdoc:latest \
294+
/bin/bash -c "strictdoc export --formats=html"
295+
296+
.. list-table:: ``docker run`` options breakdown
297+
:widths: 40 60
298+
:header-rows: 1
299+
300+
* - **Option**
301+
- **Description**
302+
303+
* - ``--rm``
304+
- Remove container when it is exited.
305+
306+
* - ``HOST_UID`` and ``HOST_GID``
307+
- These environment variables are used to tell the container that it should create a ``strictdoc`` user that has these values. This enables the content generated by the container to be visible outside the container under the permissions of the host user.
308+
309+
* - ``-v "<folder on host>:/data"``
310+
- Normally the folder on the host should be the folder with the StrictDoc documentation. The ``/data`` folder must always be specified without change because that's where the Docker container is designed to operate.
311+
312+
* - ``/bin/bash -c "..."``
313+
- This command shall typically be ``strictdoc export`` but it can also be skipped in which case the ``docker run`` will enter the container with SSH.
314+
315+
If entering the container manually, the ``strictdoc`` command can be run as follows:
282316

283317
.. code-block:: text
284318

285319
bash-5.1# strictdoc export .
286320
bash-5.1# exit
287321

288-
The documentation resides in ``./docs/output/html``.
322+
The documentation shall be generated to ``./output/html`` which is accessible both on the host and inside the container.
289323
<<<
290324

291325
[/SECTION]

docs/strictdoc_04_release_notes.sdoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ TITLE: Unreleased work
3333
[TEXT]
3434
MID: c5725f24fcd24d54929e155f6ad47b44
3535
STATEMENT: >>>
36-
The autocompletion dropdown has been added to the relation editor in the Web GUI. Thanks to @thseiler for contributing this work.
36+
This release includes the following enhancements.
37+
38+
The autocompletion dropdown has been added to the relation editor in the Web GUI. [@thseiler]
39+
40+
Link anchors are no longer generated using section numbers, which improves their stability when StrictDoc documentation is linked from external sources. If a requirement is moved to another section within the same document, the original link will still correctly resolve to the UID [@thseiler].
41+
42+
The legacy FREETEXT parsing has been completely removed from Document and Section. The [FREETEXT] marker is no longer recognized by StrictDoc, allowing for the removal of a significant amount of legacy code.
43+
44+
Based on user feedback, the StrictDoc's Dockerfile now supports the HTML2PDF feature. The container file was refactored to be based on Ubuntu 24 which is the default Linux platform for StrictDoc development and testing. The image installs Google Chrome which enables the HTML2PDF to work out of the box without any other installation steps.
45+
46+
Over the years, StrictDoc has been transitioning to a 100% statically-typed codebase. As part of the ongoing refactoring of StrictDoc's type system, more type annotations have been added to the core StrictDoc model classes (Document, Node, Section, DocumentFromFile, etc.). These improvements should further reduce the risk of future regressions due to stronger static type checking.
3747
<<<
3848

3949
[/SECTION]

tasks.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,14 @@ def test_docker(context, image: str = "strictdoc:latest"):
889889
image=image,
890890
command="strictdoc export --formats=html,html2pdf .",
891891
)
892-
run_invoke(
893-
context,
894-
"""
895-
[ "$(stat -c "%U" output/html2pdf/pdf/docs/strictdoc_01_user_guide.pdf)" = "$(whoami)" ]
896-
""",
892+
893+
def check_file_owner(filepath):
894+
import pwd
895+
896+
file_owner = pwd.getpwuid(os.stat(filepath).st_uid).pw_name
897+
current_user = os.environ.get("USER", "")
898+
return file_owner == current_user
899+
900+
assert check_file_owner(
901+
"output/html2pdf/pdf/docs/strictdoc_01_user_guide.pdf"
897902
)

0 commit comments

Comments
 (0)