-
Notifications
You must be signed in to change notification settings - Fork 19
[DO NOT MERGE - EXPERIMENT] Import markdown to AsciiDoc #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DonaghBr
wants to merge
6
commits into
main
Choose a base branch
from
import-markdown
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
84c7a03
Add import-markdown design spec
DonaghBr 9392f4c
feat(docs-tools): add import-markdown skill for Google Docs round-trip
DonaghBr 178a7b1
fix(docs-tools): enforce verbatim content preservation in import mode
DonaghBr b0c925b
feat(docs-tools): add deterministic assembly wiring for import pipeline
DonaghBr 292f890
fix(docs-tools): preserve trailing heading text in import-markdown ma…
DonaghBr 3a4a61e
Merge main into import-markdown; resolve conflict and bump version
DonaghBr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../plugins/docs-tools/skills/docs-workflow-import-markdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
plugins/docs-tools/skills/docs-orchestrator/defaults/docs-import.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| workflow: | ||
| name: docs-import | ||
| description: Import edited markdown back into AsciiDoc modules, creating a merge request for review. | ||
|
|
||
| steps: | ||
| - name: import-markdown | ||
| skill: docs-tools:docs-workflow-import-markdown | ||
| description: Split markdown and match sections to AsciiDoc modules | ||
|
|
||
| - name: prepare-branch | ||
| skill: docs-tools:docs-workflow-prepare-branch | ||
| description: Create feature branch | ||
| inputs: [import-markdown] | ||
|
|
||
| - name: writing | ||
| skill: docs-tools:docs-workflow-writing | ||
| description: Apply content updates to matched modules | ||
| inputs: [import-markdown, prepare-branch] | ||
|
|
||
| - name: commit | ||
| skill: docs-tools:docs-workflow-commit | ||
| description: Commit and push changes | ||
| inputs: [writing] | ||
|
|
||
| - name: create-mr | ||
| skill: docs-tools:docs-workflow-create-mr | ||
| description: Create merge request | ||
| inputs: [commit] |
66 changes: 66 additions & 0 deletions
66
plugins/docs-tools/skills/docs-workflow-import-markdown/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| name: docs-workflow-import-markdown | ||
| description: Split an edited markdown file by headings and match sections to existing AsciiDoc modules using URL fragment IDs. Produces a match manifest for the writing step. | ||
| argument-hint: <ticket> --markdown <path> --base-path <path> [--repo-path <path>] | ||
| allowed-tools: Bash, Read | ||
| --- | ||
|
|
||
| # Import Markdown Step | ||
|
|
||
| Step skill for the docs-orchestrator import pipeline. Follows the step skill contract: **run script → verify output**. | ||
|
|
||
| ## Execution | ||
|
|
||
| ### 1. Run the script | ||
|
|
||
| ```bash | ||
| python3 ${CLAUDE_SKILL_DIR}/scripts/import_markdown.py <args> | ||
| ``` | ||
|
|
||
| Pass through the full args string. The script: | ||
|
|
||
| 1. Reads the markdown file | ||
| 2. Splits it into sections by heading level (`##`, `###`, `####`) | ||
| 3. Extracts `docs.redhat.com` URL fragment IDs from heading links | ||
| 4. Matches each section to an `.adoc` module in the target repo (by ID stem grep, then heading text fallback) | ||
| 5. Writes `match-manifest.json` to `<base-path>/import-markdown/` | ||
|
|
||
| The script emits JSON on stdout: | ||
|
|
||
| ```json | ||
| { | ||
| "manifest_path": "<base-path>/import-markdown/match-manifest.json", | ||
| "output_dir": "<base-path>/import-markdown", | ||
| "summary": { | ||
| "matched": 12, | ||
| "new": 3, | ||
| "skipped": 1, | ||
| "preamble_skipped": 1, | ||
| "total": 17 | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| If the script exits non-zero, stop and report the error from stderr. | ||
|
|
||
| ### 2. Verify output | ||
|
|
||
| Check that the `manifest_path` from the JSON output exists. | ||
|
|
||
| ### 3. Report summary | ||
|
|
||
| Print the summary to the user: | ||
|
|
||
| ``` | ||
| Import matching complete: <matched> matched, <new> new, <skipped> skipped | ||
| ``` | ||
|
|
||
| If there are skipped sections, add: | ||
|
|
||
| ``` | ||
| Skipped sections require manual attention — see match-manifest.json for details. | ||
| ``` | ||
|
|
||
| ## Known limitations | ||
|
|
||
| **Structural changes redistribute content.** When SMEs add new sub-headings and move existing content under them (e.g., splitting section 4.3 into 4.3 + 4.3.1), the parent section's content becomes empty while the child gets the content. The matched parent module will be updated with a near-empty body, and the child will be created as a new module. The content is not lost — it moves to the new module — but the writer should review the MR diff carefully to verify the restructuring is correct. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add required
step-result.jsonsidecar instructions for this step skill.This step currently documents verify/report only; it should also emit
<base-path>/import-markdown/step-result.jsonwithschema_version,step,ticket, andcompleted_at.Based on learnings: “All docs-workflow-* step skills must write a step-result.json sidecar alongside their primary output with schema_version, step, ticket, and completed_at fields.”
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 54-54: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
[warning] 60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents