Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- closed

env:
DOCKER_HUB_BASE_NAME: honkit/honkit
IMAGE_NAME: ghcr.io/honkit/honkit
NODE_VERSION: 24

jobs:
Expand Down Expand Up @@ -136,6 +136,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -157,25 +158,24 @@ jobs:
docker buildx build \
--build-arg NODE_VERSION=${NODE_VERSION} \
--build-arg PACKAGE_VERSION=${PACKAGE_VERSION} \
--tag ${DOCKER_HUB_BASE_NAME}:v${PACKAGE_VERSION} \
--tag ${IMAGE_NAME}:v${PACKAGE_VERSION} \
--cache-from type=local,src=/tmp/.buildx-cache \
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \
--load \
.
working-directory: ./docker
- name: Print node version in container image
run: docker run --rm ${DOCKER_HUB_BASE_NAME}:v${PACKAGE_VERSION} --version
run: docker run --rm ${IMAGE_NAME}:v${PACKAGE_VERSION} --version
- name: Set latest tag
run: docker tag ${DOCKER_HUB_BASE_NAME}:v${PACKAGE_VERSION} ${DOCKER_HUB_BASE_NAME}:latest
run: docker tag ${IMAGE_NAME}:v${PACKAGE_VERSION} ${IMAGE_NAME}:latest
- name: Set major version tag
run: docker tag ${DOCKER_HUB_BASE_NAME}:v${PACKAGE_VERSION} ${DOCKER_HUB_BASE_NAME}:v$(echo $PACKAGE_VERSION | cut -f 1 -d . | tr -d "\n")
- name: Login to Registries
run: echo "${DOCKER_HUB_TOKEN}" | docker login -u ${DOCKER_HUB_USER} --password-stdin
run: docker tag ${IMAGE_NAME}:v${PACKAGE_VERSION} ${IMAGE_NAME}:v$(echo $PACKAGE_VERSION | cut -f 1 -d . | tr -d "\n")
- name: Login to GitHub Container Registry
run: echo "${GITHUB_TOKEN}" | docker login ghcr.io -u ${GITHUB_ACTOR} --password-stdin
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Push to Docker Hub
run: docker push ${DOCKER_HUB_BASE_NAME} --all-tags
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Container Registry
run: docker push ${IMAGE_NAME} --all-tags
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ jobs:
run: pnpm run build
working-directory: examples/benchmark

trace-install-deprecations:
name: "Trace install deprecations"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: 'pnpm'
node-version: ${{ env.NODE_VERSION }}
- name: Trace deprecation warnings during install
run: NODE_OPTIONS=--trace-deprecation pnpm install --frozen-lockfile

docker-image:
name: "Build docker image and generate pdf"
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ For more details, see [HonKit's documentation](https://honkit.netlify.app/).

## Docker support

Honkit provide docker image at [honkit/honkit](https://hub.docker.com/r/honkit/honkit).
Honkit provide docker image at [ghcr.io/honkit/honkit](https://github.com/honkit/honkit/pkgs/container/honkit).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix subject-verb agreement in the Docker support sentence.

Line 61 should read “HonKit provides …” for correct user-facing grammar.

✏️ Proposed fix
-Honkit provide docker image at [ghcr.io/honkit/honkit](https://github.com/honkit/honkit/pkgs/container/honkit).
+HonKit provides a Docker image at [ghcr.io/honkit/honkit](https://github.com/honkit/honkit/pkgs/container/honkit).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Honkit provide docker image at [ghcr.io/honkit/honkit](https://github.com/honkit/honkit/pkgs/container/honkit).
HonKit provides a Docker image at [ghcr.io/honkit/honkit](https://github.com/honkit/honkit/pkgs/container/honkit).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 61, Edit the README sentence that currently reads "Honkit
provide docker image at [ghcr.io/honkit/honkit]" and correct the subject-verb
agreement and casing by changing it to "HonKit provides docker image at
[ghcr.io/honkit/honkit]"; locate the exact string "Honkit provide docker image"
and replace it with "HonKit provides docker image" to fix the grammar and proper
project name capitalization.


This docker image includes built-in dependencies for PDF/epub.

```
docker pull honkit/honkit
docker run -v `pwd`:`pwd` -w `pwd` --rm -it honkit/honkit honkit build
docker run -v `pwd`:`pwd` -w `pwd` --rm -it honkit/honkit honkit pdf
docker pull ghcr.io/honkit/honkit
docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit build
docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit pdf
```
Comment on lines 65 to 69
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language to the fenced command block.

The fenced block is missing a language marker, which triggers markdownlint (MD040).

🧩 Proposed fix
-```
+```bash
 docker pull ghcr.io/honkit/honkit
 docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit build
 docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit pdf
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>

[warning] 65-65: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @README.md around lines 65 - 69, Update the fenced code block containing the
three docker commands so it includes a language identifier (e.g., add bash at the opening fence) instead of a plain ; specifically modify the block that
currently wraps the docker pull/run lines to start with bash and keep the closing unchanged so markdownlint MD040 is satisfied.


</details>

<!-- fingerprinting:phantom:poseidon:hawk -->

<!-- This is an auto-generated comment by CodeRabbit -->


For more details, see [docker/](./docker/).
Expand Down
14 changes: 7 additions & 7 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Docker Container

- https://hub.docker.com/r/honkit/honkit
- https://github.com/honkit/honkit/pkgs/container/honkit

## Installation

docker pull honkit/honkit
docker pull ghcr.io/honkit/honkit

## Usage

Show help

$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it honkit/honkit honkit --help
$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit --help
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove leading $ from command examples to satisfy markdownlint.

These lines trigger MD014; dropping prompt symbols keeps docs lint-clean without changing meaning.

🧹 Proposed fix
-    $ docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit --help
+    docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit --help
-    $ docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit build
+    docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit build
-    $ docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit pdf
+    docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit pdf
-    $ docker run -it --init -p 4000:4000  -v `pwd`:`pwd` -w `pwd` --rm  ghcr.io/honkit/honkit honkit serve
+    docker run -it --init -p 4000:4000  -v `pwd`:`pwd` -w `pwd` --rm  ghcr.io/honkit/honkit honkit serve

Also applies to: 17-17, 21-21, 25-25

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 13-13: Dollar signs used before commands without showing output

(MD014, commands-show-output)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/README.md` at line 13, The markdown examples currently include a
leading shell prompt "$" which triggers MD014; remove the leading "$" from each
command example (e.g., change "$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it
ghcr.io/honkit/honkit honkit --help" and the other similar lines) so the README
contains plain command lines without prompt symbols, keeping output semantics
the same while satisfying markdownlint.


Build

$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it honkit/honkit honkit build
$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit build

PDF build

$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it honkit/honkit honkit pdf
$ docker run -v `pwd`:`pwd` -w `pwd` --rm -it ghcr.io/honkit/honkit honkit pdf

Serve on port 4000

$ docker run -it --init -p 4000:4000 -v `pwd`:`pwd` -w `pwd` --rm honkit/honkit honkit serve
$ docker run -it --init -p 4000:4000 -v `pwd`:`pwd` -w `pwd` --rm ghcr.io/honkit/honkit honkit serve

## Tips

Expand All @@ -31,7 +31,7 @@ Serve on port 4000
You can create new image includes custom font based on honkit image.

```
FROM honkit/honkit:latest
FROM ghcr.io/honkit/honkit:latest
LABEL maintainer="your@example.com"

# Install fonts
Expand Down
6 changes: 1 addition & 5 deletions examples/benchmark/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"anchors",
"canonical-link",
"ga",
"js-console",
"github-issue-feedback"
"js-console"
],
"variables": {
"esversion": "2019",
Expand All @@ -37,9 +36,6 @@
"apiKey": "fd28ebaba94be0c39fb9fa1b2fed4f23",
"index": "asciidwango"
},
"github-issue-feedback": {
"repo": "asciidwango/js-primer"
},
"edit-link": {
"base": "https://github.com/asciidwango/js-primer/edit/master/source/",
"label": "Edit"
Expand Down
3 changes: 1 addition & 2 deletions examples/benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/benchmark",
"version": "6.1.7",
"version": "6.2.1",
"private": true,
"description": "benchmark book",
"license": "MIT",
Expand All @@ -23,7 +23,6 @@
"gitbook-plugin-canonical-link": "^2.0.3",
"gitbook-plugin-custom-favicon": "0.0.4",
"gitbook-plugin-ga": "^1.0.1",
"gitbook-plugin-github-issue-feedback": "^1.4.0",
"gitbook-plugin-include-codeblock": "^3.2.3",
"gitbook-plugin-js-console": "^2.0.5",
"gitbook-plugin-page-toc-button": "^0.1.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/book/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/book",
"version": "6.1.7",
"version": "6.2.1",
"private": true,
"description": "",
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple-languages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@example/multiple-languages",
"version": "6.1.7",
"version": "6.2.1",
"private": true,
"description": "",
"keywords": [],
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "honkit-root",
"version": "6.1.7",
"version": "6.2.1",
"private": true,
"homepage": "https://github.com/honkit/honkit",
"bugs": {
Expand All @@ -26,6 +26,7 @@
"build": "pnpm -r --filter \"!@example/*\" run build",
"clean": "pnpm -r --filter \"!@example/*\" run clean",
"clean-deps": "rm -rf node_modules && pnpm -r exec rm -rf node_modules",
"report:install": "pnpm run clean-deps && rm -f pnpm-lock.yaml && mkdir -p reports && echo \"$ pnpm install\" > reports/install.log && pnpm install >> reports/install.log 2>&1",
"test": "pnpm -r --filter \"!@example/*\" run test",
"updateSnapshot": "pnpm -r --filter \"!@example/*\" run updateSnapshot",
"versionup": "echo 'Error: Please use CI for versioning. Run gh workflow run create-release-pr instead.' && exit 1",
Expand All @@ -47,5 +48,10 @@
"prettier --write"
]
},
"packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca"
"packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca",
"pnpm": {
"overrides": {
"glob": "^13.0.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/@honkit/asciidoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/asciidoc",
"version": "6.1.7",
"version": "6.2.1",
"description": "Parse AsciiDoc content for gitbook",
"homepage": "https://github.com/honkit/honkit",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/cleaning-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/cleaning-tools",
"version": "6.1.7",
"version": "6.2.1",
"type": "module",
"description": "Shared eslint and prettier configs for HonKit packages.",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/honkit-plugin-fontsettings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@honkit/honkit-plugin-fontsettings",
"description": "Fonts and colors themes settings the website for a better reading experience",
"main": "index.js",
"version": "6.1.7",
"version": "6.2.1",
"license": "Apache-2.0",
"homepage": "https://github.com/honkit/honkit",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/honkit-plugin-highlight/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@honkit/honkit-plugin-highlight",
"description": "Default code highlighter for HonKit",
"version": "6.1.7",
"version": "6.2.1",
"homepage": "https://github.com/honkit/honkit",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/@honkit/html/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/html",
"version": "6.1.7",
"version": "6.2.1",
"description": "Parse HTML content for gitbook",
"homepage": "https://github.com/honkit/honkit",
"bugs": {
Expand Down Expand Up @@ -42,7 +42,7 @@
"lodash": "^4.17.23"
},
"devDependencies": {
"mocha": "^10.8.2",
"mocha": "^11.7.4",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
Expand Down
9 changes: 9 additions & 0 deletions packages/@honkit/html/src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ type CheerioOptions = cheerio.CheerioOptions & {
export function loadHtml(html: string): cheerio.CheerioAPI {
return cheerio.load(html, { _useHtmlParser2: true } as CheerioOptions);
}

/**
* Load an XML/SVG fragment (e.g. for inline SVG).
*/
export function loadXml(html: string): cheerio.CheerioAPI {
return cheerio.load(html, { _useHtmlParser2: true, xmlMode: true } as CheerioOptions);
}

export type { CheerioAPI as HtmlDom } from "cheerio";
/**
Parse an HTML string and return its content

Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const htmlParser = {
/**
* Utility for loading HTML content
*/
export { loadHtml } from "./dom";
export { loadHtml, loadXml, type HtmlDom } from "./dom";
export type ToHTMLOptions = {
baseDirectory: string;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/internal-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/internal-test-utils",
"version": "6.1.7",
"version": "6.2.1",
"description": "Internal utility for testing.",
"homepage": "https://github.com/honkit/honkit/tree/master/packages/@honkit/internal-test-utils/",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/markdown-legacy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/markdown-legacy",
"version": "6.1.7",
"version": "6.2.1",
"description": "Parse markdown content for HonKit",
"homepage": "https://github.com/honkit/honkit",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@honkit/markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/markdown",
"version": "6.1.7",
"version": "6.2.1",
"description": "Parse markdown content for honkit",
"homepage": "https://github.com/honkit/honkit",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@honkit/markup-it/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/markup-it",
"version": "6.1.7",
"version": "6.2.1",
"description": "Pipeline for working with markup input (for example Markdown)",
"keywords": [
"draft-js",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@types/node": "^22.7.4",
"eslint": "^9.39.4",
"jest": "^29.7.0",
"jsdom": "^20.0.3",
"jsdom": "^26.1.0",
"rimraf": "^6.0.1",
"should": "^13.2.3",
"ts-jest": "^29.2.5"
Expand Down
13 changes: 7 additions & 6 deletions packages/@honkit/theme-default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/honkit-plugin-theme-default",
"version": "6.1.7",
"version": "6.2.1",
"description": "Default theme for HonKit",
"bugs": {
"url": "https://github.com/honkit/honkit/issues"
Expand Down Expand Up @@ -39,8 +39,8 @@
"build:css:pdf": "lessc -clean-css src/less/pdf.less _assets/ebook/pdf.css",
"build:css:website": "lessc -clean-css src/less/website.less _assets/website/style.css",
"build:js": "npm-run-all -p build:js:*",
"build:js:gitbook": "browserify src/js/core/index.js | uglifyjs -mc > _assets/website/gitbook.js",
"build:js:theme": "browserify src/js/theme/index.js | uglifyjs -mc > _assets/website/theme.js",
"build:js:gitbook": "esbuild src/js/core/index.js --bundle --minify --platform=browser --alias:path=path-browserify --alias:url=url/ --outfile=_assets/website/gitbook.js",
"build:js:theme": "esbuild src/js/theme/index.js --bundle --minify --platform=browser --outfile=_assets/website/theme.js",
"clean": "rimraf _assets && mkdirp _assets/ebook/ _assets/website/ _assets/website/fonts _assets/website/images",
"cp": "npm-run-all -p cp:*",
"cp:favicon": "cpy --flat logo/favicon.ico _assets/website/images/",
Expand All @@ -51,19 +51,20 @@
},
"devDependencies": {
"@honkit/cleaning-tools": "workspace:*",
"browserify": "^17.0.0",
"cpy-cli": "^4.2.0",
"esbuild": "^0.27.4",
"eslint": "^9.39.4",
"font-awesome": "^4.6.3",
"gitbook-markdown-css": "^1.0.1",
"jquery": "^3.5.1",
"less": "^2.7.1",
"less": "^4.2.0",
"less-plugin-clean-css": "^1.6.0",
"mkdirp": "^1.0.4",
"mousetrap": "^1.6.0",
"npm-run-all": "^4.1.5",
"path-browserify": "^1.0.1",
"rimraf": "^6.0.1",
"uglify-js": "^3.17.0"
"url": "^0.11.4"
},
"engines": {
"gitbook": ">=3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/@honkit/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@honkit/honkit-plugin-theme",
"version": "6.1.7",
"version": "6.2.1",
"description": "Default theme for HonKit",
"bugs": {
"url": "https://github.com/honkit/honkit/issues"
Expand Down Expand Up @@ -39,7 +39,7 @@
"cpy-cli": "^4.2.0",
"esbuild": "^0.27.4",
"gitbook-markdown-css": "^1.1.0",
"less": "^2.7.1",
"less": "^4.2.0",
"less-plugin-clean-css": "^1.6.0",
"mkdirp": "^1.0.4",
"npm-run-all": "^4.1.5",
Expand Down
Loading