Skip to content

Commit 67117f0

Browse files
authored
Migration: html2print -> html2pdf4doc (#38)
To avoid collisions with numerous PyPI and NPM packages and to better emphasize the purpose of the project we decided to rename the project as follows: - html2pdf4doc (Pip) - HTML2PDF4Doc (full name) The rest of the migration will be performed gradually with separate PRs.
1 parent 58b880a commit 67117f0

File tree

19 files changed

+125
-119
lines changed

19 files changed

+125
-119
lines changed

.github/workflows/ci-linux-ubuntu-latest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "HTML2PDF on Linux"
1+
name: "HTML2PDF4Doc on Linux"
22

33
on:
44
pull_request:
@@ -30,21 +30,21 @@ jobs:
3030
run: |
3131
pip install -r requirements.development.txt
3232
33-
- name: Clone HTML2PDF.js
33+
- name: Clone HTML2PDF4Doc.js
3434
run: |
3535
invoke bootstrap
3636
env:
3737
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838

3939
- name: Install HPDF dependencies.
4040
run: |
41-
python developer/pip_install_html2print_deps.py
41+
python developer/pip_install_html2pdf4doc_deps.py
4242
4343
- name: Run Lint tasks
4444
run: |
4545
invoke lint
4646
47-
- name: Build HTML2PDF.js
47+
- name: Build HTML2PDF4Doc.js
4848
run: |
4949
invoke build
5050

.github/workflows/ci-mac.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "HTML2PDF on macOS"
1+
name: "HTML2PDF4Doc on macOS"
22

33
on:
44
pull_request:
@@ -30,19 +30,19 @@ jobs:
3030
run: |
3131
pip install -r requirements.development.txt
3232
33-
- name: Clone HTML2PDF.js
33+
- name: Clone HTML2PDF4Doc.js
3434
run: |
3535
invoke bootstrap
3636
3737
- name: Install HPDF dependencies.
3838
run: |
39-
python developer/pip_install_html2print_deps.py
39+
python developer/pip_install_html2pdf4doc_deps.py
4040
4141
- name: Run Lint tasks
4242
run: |
4343
invoke lint
4444
45-
- name: Build HTML2PDF.js
45+
- name: Build HTML2PDF4Doc.js
4646
run: |
4747
invoke build
4848

.github/workflows/ci-windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NOTE: In contrast to Linux and macOS, the Windows build machines do not have Chrome installed.
22

3-
name: "HTML2PDF on Windows"
3+
name: "HTML2PDF4Doc on Windows"
44

55
on:
66
pull_request:
@@ -39,25 +39,25 @@ jobs:
3939
run: |
4040
pip install -r requirements.development.txt
4141
42-
- name: Clone HTML2PDF.js
42+
- name: Clone HTML2PDF4Doc.js
4343
run: |
4444
invoke bootstrap
4545
4646
- name: Install HPDF dependencies.
4747
run: |
48-
python developer/pip_install_html2print_deps.py
48+
python developer/pip_install_html2pdf4doc_deps.py
4949
5050
- name: Run Lint tasks
5151
run: |
5252
invoke lint
5353
54-
- name: Build HTML2PDF.js
54+
- name: Build HTML2PDF4Doc.js
5555
run: |
5656
invoke build
5757
5858
- name: Download ChromeDriver
5959
run: |
60-
python html2print/html2print.py get_driver
60+
python html2pdf4doc/html2pdf4doc.py get_driver
6161
6262
- name: Run tests (Bash)
6363
run: |

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# HTML2PDF JS file.
2-
# html2print/html2pdf_js/
1+
# HTML2PDF4Doc JS file.
2+
# html2pdf4doc/html2pdf4doc_js/
33

44
.idea/
55
**/.wdm/

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ ENV PATH="/opt/venv/bin:$PATH"
2727

2828
# Install StrictDoc. Set default StrictDoc installation from PyPI but allow
2929
# overriding it with an environment variable.
30-
ARG HTML2PRINT_SOURCE="pypi"
31-
ENV HTML2PRINT_SOURCE=${HTML2PRINT_SOURCE}
30+
ARG HTML2PDF4DOC_SOURCE="pypi"
31+
ENV HTML2PDF4DOC_SOURCE=${HTML2PDF4DOC_SOURCE}
3232

33-
RUN if [ "$HTML2PRINT_SOURCE" = "pypi" ]; then \
33+
RUN if [ "$HTML2PDF4DOC_SOURCE" = "pypi" ]; then \
3434
pip install --no-cache-dir --upgrade pip && \
35-
pip install --no-cache-dir html2print; \
35+
pip install --no-cache-dir html2pdf4doc; \
3636
else \
3737
pip install --no-cache-dir --upgrade pip && \
38-
pip install --no-cache-dir git+https://github.com/mettta/html2pdf_python.git@${HTML2PRINT_SOURCE}; \
38+
pip install --no-cache-dir git+https://github.com/mettta/html2pdf_python.git@${HTML2PDF4DOC_SOURCE}; \
3939
fi; \
4040
chmod -R 777 /opt/venv;
4141

developer/pip_install_html2print_deps.py renamed to developer/pip_install_html2pdf4doc_deps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def check_if_package_installed(package_name: str):
2929

3030

3131
print( # noqa: T201
32-
"pip_install_html2print_deps.py: "
32+
"pip_install_html2pdf4doc_deps.py: "
3333
"checking if the current Python environment has all packages installed"
3434
".",
3535
flush=True,
@@ -48,7 +48,7 @@ def check_if_package_installed(package_name: str):
4848
check_if_package_installed(dependency)
4949
except PackageNotFound:
5050
print( # noqa: T201
51-
f"pip_install_html2print_deps.py: "
51+
f"pip_install_html2pdf4doc_deps.py: "
5252
f"Package is not installed: '{dependency}'.",
5353
flush=True,
5454
)
@@ -57,8 +57,8 @@ def check_if_package_installed(package_name: str):
5757
except PackageVersionConflict as exception_:
5858
print( # noqa: T201
5959
(
60-
f"pip_install_html2print_deps.py: version conflict between "
61-
f"html2print's requirement '{dependency}' "
60+
f"pip_install_html2pdf4doc_deps.py: version conflict between "
61+
f"html2pdf4doc's requirement '{dependency}' "
6262
f"and the already installed package: "
6363
f"{exception_.args[0]}."
6464
),
@@ -69,13 +69,13 @@ def check_if_package_installed(package_name: str):
6969

7070
if not needs_installation:
7171
print( # noqa: T201
72-
"pip_install_html2print_deps.py: all packages seem to be installed.",
72+
"pip_install_html2pdf4doc_deps.py: all packages seem to be installed.",
7373
flush=True,
7474
)
7575
sys.exit(0)
7676

7777
print( # noqa: T201
78-
"pip_install_html2print_deps.py: will install packages.", flush=True
78+
"pip_install_html2pdf4doc_deps.py: will install packages.", flush=True
7979
)
8080

8181
all_packages = "\n".join(dependencies) + "\n"

entrypoint.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ if [ -z "$HOST_UID" ] || [ -z "$HOST_GID" ]; then
1515
exit 1
1616
fi
1717

18-
echo "html2print/docker: running a Docker container entrypoint."
19-
echo "html2print/docker: ensuring html2print user with UID=$HOST_UID and GID=$HOST_GID exists"
18+
echo "html2pdf4doc/docker: running a Docker container entrypoint."
19+
echo "html2pdf4doc/docker: ensuring html2pdf4doc user with UID=$HOST_UID and GID=$HOST_GID exists"
2020

2121
# Check if a user with this UID already exists (e.g., "ubuntu")
2222
EXISTING_USER=$(getent passwd "$HOST_UID" | cut -d: -f1)
2323

2424
if [ -n "$EXISTING_USER" ]; then
25-
echo "error: html2print/docker: detected a wrong user: '$EXISTING_USER'. Ensure that any default users are removed from the Dockerfile. This entrypoint script is supposed to create a new user 'html2print'."
25+
echo "error: html2pdf4doc/docker: detected a wrong user: '$EXISTING_USER'. Ensure that any default users are removed from the Dockerfile. This entrypoint script is supposed to create a new user 'html2pdf4doc'."
2626
exit 1
2727
else
2828
# Ensure the group exists.
2929
EXISTING_GROUP=$(getent group "$HOST_GID" | cut -d: -f1)
3030
if [ -z "$EXISTING_GROUP" ]; then
31-
echo "html2print/docker: creating new group html2print with GID=$HOST_GID"
32-
groupadd -g "$HOST_GID" html2print
31+
echo "html2pdf4doc/docker: creating new group html2pdf4doc with GID=$HOST_GID"
32+
groupadd -g "$HOST_GID" html2pdf4doc
3333
else
34-
echo "html2print/docker: group with GID=$HOST_GID already exists: $EXISTING_GROUP, reusing it."
34+
echo "html2pdf4doc/docker: group with GID=$HOST_GID already exists: $EXISTING_GROUP, reusing it."
3535
fi
3636

3737
# Create the user.
38-
echo "html2print/docker: creating new user html2print with UID=$HOST_UID"
39-
useradd -m -u "$HOST_UID" -g "$HOST_GID" -s /bin/bash html2print
38+
echo "html2pdf4doc/docker: creating new user html2pdf4doc with UID=$HOST_UID"
39+
useradd -m -u "$HOST_UID" -g "$HOST_GID" -s /bin/bash html2pdf4doc
4040

4141
# Give the user root privileges. Useful for debugging.
42-
echo "html2print ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/html2print
42+
echo "html2pdf4doc ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/html2pdf4doc
4343
fi
4444

45-
echo "html2print/docker: show created user info:"
46-
id html2print
45+
echo "html2pdf4doc/docker: show created user info:"
46+
id html2pdf4doc
4747

4848
# Run as the correct user. If no command is provided, run a shell.
4949
if [ $# -eq 0 ]; then
50-
echo "html2print/docker: no command provided, opening an interactive shell."
51-
exec gosu html2print /bin/bash
50+
echo "html2pdf4doc/docker: no command provided, opening an interactive shell."
51+
exec gosu html2pdf4doc /bin/bash
5252
else
5353
# Otherwise, run the provided command.
54-
exec gosu html2print "$@"
54+
exec gosu html2pdf4doc "$@"
5555
fi

0 commit comments

Comments
 (0)