hdoc-tools 0.18.3 → 0.18.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/hdoc-build.js
CHANGED
@@ -451,7 +451,7 @@
|
|
451
451
|
else html_txt = `${fm_header_content}\n${doc_header}\n${html_txt}`;
|
452
452
|
|
453
453
|
// Wrap h2 and h3 tags, plus content, in id'd divs
|
454
|
-
|
454
|
+
const h_html_txt = hdoc.wrapHContent(html_txt);
|
455
455
|
|
456
456
|
let relative_path = file_path.relativePath;
|
457
457
|
if (
|
@@ -461,7 +461,7 @@
|
|
461
461
|
relative_path = relative_path.replace("/index.html", "");
|
462
462
|
}
|
463
463
|
|
464
|
-
const index_data = hdoc_index.transform_html_for_index(
|
464
|
+
const index_data = hdoc_index.transform_html_for_index(h_html_txt);
|
465
465
|
|
466
466
|
index_data.sections.forEach(section => {
|
467
467
|
index_records.push({
|
@@ -812,7 +812,7 @@
|
|
812
812
|
else html_txt = `${fm_header}\n${doc_header}\n${html_txt}`;
|
813
813
|
|
814
814
|
// Wrap h2 and h3 tags, plus content, in id'd divs
|
815
|
-
|
815
|
+
const h_html_txt = hdoc.wrapHContent(html_txt);
|
816
816
|
|
817
817
|
// Save HTML into HTML file
|
818
818
|
const target_file = file_path.path.replace(
|
@@ -836,7 +836,7 @@
|
|
836
836
|
relative_path = relative_path.replace("/index.html", "");
|
837
837
|
}
|
838
838
|
|
839
|
-
const index_data = hdoc_index.transform_html_for_index(
|
839
|
+
const index_data = hdoc_index.transform_html_for_index(h_html_txt);
|
840
840
|
|
841
841
|
index_data.sections.forEach(section => {
|
842
842
|
index_records.push({
|
package/package.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
name: HDocBuildPull
|
2
|
+
|
2
3
|
on:
|
3
4
|
# Triggers the workflow on pull request opened or reopened events
|
4
5
|
pull_request_target:
|
@@ -6,49 +7,11 @@ on:
|
|
6
7
|
paths-ignore:
|
7
8
|
- '.github/**'
|
8
9
|
|
9
|
-
|
10
10
|
jobs:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
# Checkout the relevant content for pull_request_target
|
20
|
-
- name: Checkout For Pull Request Target
|
21
|
-
uses: actions/checkout@v4
|
22
|
-
with:
|
23
|
-
ref: ${{ github.event.pull_request.head.sha }}
|
24
|
-
|
25
|
-
# Install hdoc-tools globally
|
26
|
-
- name: Install hdoc-tools
|
27
|
-
run: npm install hdoc-tools -g
|
28
|
-
|
29
|
-
# Run hdoc validate against checked-out content
|
30
|
-
- name: Perform Validation
|
31
|
-
id: hdocbuild
|
32
|
-
run: |
|
33
|
-
if result=`hdoc validate 2>&1`; then
|
34
|
-
printf "Build Success!\n\n"
|
35
|
-
printf "$result"
|
36
|
-
exit 0
|
37
|
-
else
|
38
|
-
valout=$(echo "$result" | awk '/Validation Output/,0')
|
39
|
-
printf "Build Failed!\n\n-----------------------\n"
|
40
|
-
printf "$valout"
|
41
|
-
exit 1
|
42
|
-
fi
|
43
|
-
|
44
|
-
# If build validation fails, and event trigger was a pull request then close the pull request
|
45
|
-
- name: Reject Pull Request
|
46
|
-
if: failure()
|
47
|
-
uses: superbrothers/close-pull-request@v3
|
48
|
-
with:
|
49
|
-
comment: "Your pull request has been rejected as build validation has failed. See the Perform Validation step of the build job for more information: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
50
|
-
|
51
|
-
# If build validation is successful, echo message
|
52
|
-
- name: Build Success
|
53
|
-
if: success()
|
54
|
-
run: echo "::notice::Build validation passed successfully."
|
11
|
+
call-workflow-pull-validate:
|
12
|
+
uses: Hornbill-Docs/hdoc-library/.github/workflows/hdocbuild_shared_pull.yml@main
|
13
|
+
with:
|
14
|
+
branch: ${{ github.event.pull_request.head.sha }}
|
15
|
+
server_url: ${{ github.server_url }}
|
16
|
+
repo: ${{ github.repository }}
|
17
|
+
run_id: ${{ github.run_id }}
|
@@ -9,41 +9,7 @@ on:
|
|
9
9
|
workflow_dispatch:
|
10
10
|
|
11
11
|
jobs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
- uses: actions/setup-node@v4
|
17
|
-
with:
|
18
|
-
node-version: 22
|
19
|
-
|
20
|
-
# Checkout the relevant content for push or workflow_dispatch
|
21
|
-
- name: Checkout For Push or Workflow Dispatch
|
22
|
-
uses: actions/checkout@v4
|
23
|
-
with:
|
24
|
-
ref: ${{ github.event.inputs.branch }}
|
25
|
-
fetch-depth: 0
|
26
|
-
|
27
|
-
# Install hdoc-tools globally
|
28
|
-
- name: Install hdoc-tools
|
29
|
-
run: npm install hdoc-tools -g
|
30
|
-
|
31
|
-
# Run hdoc validate against checked-out content
|
32
|
-
- name: Perform Validation
|
33
|
-
id: hdocbuild
|
34
|
-
run: |
|
35
|
-
if result=`hdoc validate 2>&1`; then
|
36
|
-
printf "Build Success!\n\n"
|
37
|
-
printf "$result"
|
38
|
-
exit 0
|
39
|
-
else
|
40
|
-
valout=$(echo "$result" | awk '/Validation Output/,0')
|
41
|
-
printf "Build Failed!\n\n-----------------------\n"
|
42
|
-
printf "$valout"
|
43
|
-
exit 1
|
44
|
-
fi
|
45
|
-
|
46
|
-
# If build validation is successful, echo message
|
47
|
-
- name: Build Success
|
48
|
-
if: success()
|
49
|
-
run: echo "::notice::Build validation passed successfully."
|
12
|
+
call-workflow-push-validate:
|
13
|
+
uses: Hornbill-Docs/hdoc-library/.github/workflows/hdocbuild_shared_push.yml@main
|
14
|
+
with:
|
15
|
+
branch: ${{ github.event.inputs.branch }}
|