@litfamily/litmuse 0.1.11 → 0.1.12
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/CHANGELOG.md +12 -0
- package/README.md +76 -10
- package/README_ko-KR.md +76 -10
- package/bin/litmuse.mjs +0 -4
- package/lib/bundle.mjs +1 -1
- package/lib/doctor.mjs +20 -31
- package/lib/install.mjs +26 -1
- package/lib/paths.mjs +1 -0
- package/lib/safe-write.mjs +1 -1
- package/package.json +2 -2
- package/plugin/.muse-plugin/plugin.json +11 -11
- package/plugin/hooks/lib/digest.mjs +4 -7
- package/plugin/hooks/lib/extensions.mjs +80 -0
- package/plugin/hooks/lib/moved.mjs +42 -0
- package/plugin/hooks/post-tool-use.mjs +0 -4
- package/plugin/hooks/session-start.mjs +6 -1
- package/plugin/hooks/stop.mjs +1 -7
- package/plugin/hooks/user-prompt-submit.mjs +4 -4
- package/plugin/skills/frontend-ui-ux/SKILL.md +33 -228
- package/plugin/skills/lit-diagram-drawer/SKILL.md +35 -212
- package/plugin/skills/lit-docx/SKILL.md +33 -239
- package/plugin/skills/lit-pptx/SKILL.md +33 -281
- package/plugin/skills/lit-schematic/SKILL.md +35 -224
- package/plugin/skills/lit-scientific-visualization/SKILL.md +34 -219
- package/plugin/skills/lit-typographic-motion/SKILL.md +33 -165
- package/plugin/skills/readme-studio/SKILL.md +35 -100
- package/plugin/skills/visual-qa/SKILL.md +35 -175
- package/lib/runtime.mjs +0 -73
- package/plugin/hooks/lib/motion.mjs +0 -156
- package/plugin/lib/office-runtime-lock/package-lock.json +0 -793
- package/plugin/lib/office-runtime-lock/package.json +0 -12
- package/plugin/lib/office-runtime-lock/requirements.lock +0 -15
- package/plugin/lib/office-runtime.mjs +0 -274
- package/plugin/lib/office_data.py +0 -493
- package/plugin/lib/office_runtime_bootstrap.py +0 -76
- package/plugin/lib/ooxml_integrity.py +0 -199
- package/plugin/lib/pdf_fonts.py +0 -91
- package/plugin/lib/render_pages.py +0 -133
- package/plugin/lib/strict-json.mjs +0 -143
- package/plugin/skills/frontend-ui-ux/ATTRIBUTION.md +0 -23
- package/plugin/skills/frontend-ui-ux/LICENSE +0 -21
- package/plugin/skills/frontend-ui-ux/PROVENANCE.json +0 -38
- package/plugin/skills/frontend-ui-ux/SOURCE-MANIFEST.json +0 -1060
- package/plugin/skills/frontend-ui-ux/THIRD-PARTY-NOTICE.txt +0 -14
- package/plugin/skills/frontend-ui-ux/data/design-intelligence.json +0 -1
- package/plugin/skills/frontend-ui-ux/examples/design-contract.example.json +0 -186
- package/plugin/skills/frontend-ui-ux/examples/phase-3-readme-ab/README.md +0 -9
- package/plugin/skills/frontend-ui-ux/kit/components.css +0 -414
- package/plugin/skills/frontend-ui-ux/kit/fonts.json +0 -22
- package/plugin/skills/frontend-ui-ux/kit/layouts/landing.html +0 -164
- package/plugin/skills/frontend-ui-ux/kit/layouts/settings.html +0 -114
- package/plugin/skills/frontend-ui-ux/kit/layouts/workspace.html +0 -115
- package/plugin/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +0 -227
- package/plugin/skills/frontend-ui-ux/kit/styles/field-notes.json +0 -205
- package/plugin/skills/frontend-ui-ux/kit/styles/graphite.json +0 -200
- package/plugin/skills/frontend-ui-ux/kit/styles/meadow.json +0 -199
- package/plugin/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +0 -222
- package/plugin/skills/frontend-ui-ux/kit/ui.js +0 -226
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/frontend-ATTRIBUTION.md +0 -217
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/frontend-LICENSE-Apache-2.0.txt +0 -201
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/legal/root-LICENSE +0 -21
- package/plugin/skills/frontend-ui-ux/references/_canonical-corpus/manifest.json +0 -873
- package/plugin/skills/frontend-ui-ux/references/adaptive-layout.md +0 -92
- package/plugin/skills/frontend-ui-ux/references/brand-and-imagery.md +0 -93
- package/plugin/skills/frontend-ui-ux/references/complete-contract.md +0 -579
- package/plugin/skills/frontend-ui-ux/references/composition.md +0 -85
- package/plugin/skills/frontend-ui-ux/references/craft-floor.md +0 -264
- package/plugin/skills/frontend-ui-ux/references/creative-directions.md +0 -80
- package/plugin/skills/frontend-ui-ux/references/default-editorial-pixel.json +0 -79
- package/plugin/skills/frontend-ui-ux/references/design/README.md +0 -248
- package/plugin/skills/frontend-ui-ux/references/design/_INDEX.md +0 -191
- package/plugin/skills/frontend-ui-ux/references/design/airbnb.md +0 -393
- package/plugin/skills/frontend-ui-ux/references/design/airtable.md +0 -92
- package/plugin/skills/frontend-ui-ux/references/design/apple.md +0 -250
- package/plugin/skills/frontend-ui-ux/references/design/aside.md +0 -209
- package/plugin/skills/frontend-ui-ux/references/design/binance.md +0 -348
- package/plugin/skills/frontend-ui-ux/references/design/bmw.md +0 -183
- package/plugin/skills/frontend-ui-ux/references/design/brutalist-skill.md +0 -92
- package/plugin/skills/frontend-ui-ux/references/design/bugatti.md +0 -271
- package/plugin/skills/frontend-ui-ux/references/design/cal.md +0 -262
- package/plugin/skills/frontend-ui-ux/references/design/claude.md +0 -315
- package/plugin/skills/frontend-ui-ux/references/design/clay.md +0 -307
- package/plugin/skills/frontend-ui-ux/references/design/clickhouse.md +0 -284
- package/plugin/skills/frontend-ui-ux/references/design/clone-from-url.md +0 -65
- package/plugin/skills/frontend-ui-ux/references/design/cohere.md +0 -269
- package/plugin/skills/frontend-ui-ux/references/design/coinbase.md +0 -132
- package/plugin/skills/frontend-ui-ux/references/design/composio.md +0 -310
- package/plugin/skills/frontend-ui-ux/references/design/cursor.md +0 -312
- package/plugin/skills/frontend-ui-ux/references/design/design-system-architecture.md +0 -244
- package/plugin/skills/frontend-ui-ux/references/design/elevenlabs.md +0 -268
- package/plugin/skills/frontend-ui-ux/references/design/expo.md +0 -284
- package/plugin/skills/frontend-ui-ux/references/design/ferrari.md +0 -317
- package/plugin/skills/frontend-ui-ux/references/design/figma.md +0 -223
- package/plugin/skills/frontend-ui-ux/references/design/framer.md +0 -249
- package/plugin/skills/frontend-ui-ux/references/design/gpt-tasteskill.md +0 -74
- package/plugin/skills/frontend-ui-ux/references/design/hashicorp.md +0 -281
- package/plugin/skills/frontend-ui-ux/references/design/ibm.md +0 -335
- package/plugin/skills/frontend-ui-ux/references/design/image-to-code-skill.md +0 -1228
- package/plugin/skills/frontend-ui-ux/references/design/imagegen-brandkit.md +0 -798
- package/plugin/skills/frontend-ui-ux/references/design/imagegen-frontend-mobile.md +0 -1465
- package/plugin/skills/frontend-ui-ux/references/design/imagegen-frontend-web.md +0 -987
- package/plugin/skills/frontend-ui-ux/references/design/intercom.md +0 -149
- package/plugin/skills/frontend-ui-ux/references/design/kraken.md +0 -128
- package/plugin/skills/frontend-ui-ux/references/design/lamborghini.md +0 -291
- package/plugin/skills/frontend-ui-ux/references/design/layout-skill.md +0 -107
- package/plugin/skills/frontend-ui-ux/references/design/lazyweb.md +0 -77
- package/plugin/skills/frontend-ui-ux/references/design/linear.app.md +0 -370
- package/plugin/skills/frontend-ui-ux/references/design/lovable.md +0 -301
- package/plugin/skills/frontend-ui-ux/references/design/mastercard.md +0 -368
- package/plugin/skills/frontend-ui-ux/references/design/meta.md +0 -369
- package/plugin/skills/frontend-ui-ux/references/design/minimalist-skill.md +0 -85
- package/plugin/skills/frontend-ui-ux/references/design/minimax.md +0 -260
- package/plugin/skills/frontend-ui-ux/references/design/mintlify.md +0 -329
- package/plugin/skills/frontend-ui-ux/references/design/miro.md +0 -111
- package/plugin/skills/frontend-ui-ux/references/design/mistral.ai.md +0 -264
- package/plugin/skills/frontend-ui-ux/references/design/mongodb.md +0 -269
- package/plugin/skills/frontend-ui-ux/references/design/nike.md +0 -366
- package/plugin/skills/frontend-ui-ux/references/design/notion.md +0 -312
- package/plugin/skills/frontend-ui-ux/references/design/nvidia.md +0 -296
- package/plugin/skills/frontend-ui-ux/references/design/ollama.md +0 -270
- package/plugin/skills/frontend-ui-ux/references/design/opencode.ai.md +0 -284
- package/plugin/skills/frontend-ui-ux/references/design/output-skill.md +0 -49
- package/plugin/skills/frontend-ui-ux/references/design/pinterest.md +0 -233
- package/plugin/skills/frontend-ui-ux/references/design/playstation.md +0 -367
- package/plugin/skills/frontend-ui-ux/references/design/posthog.md +0 -259
- package/plugin/skills/frontend-ui-ux/references/design/raycast.md +0 -271
- package/plugin/skills/frontend-ui-ux/references/design/react-dev-tooling-skill.md +0 -230
- package/plugin/skills/frontend-ui-ux/references/design/redesign-skill.md +0 -178
- package/plugin/skills/frontend-ui-ux/references/design/renault.md +0 -314
- package/plugin/skills/frontend-ui-ux/references/design/replicate.md +0 -264
- package/plugin/skills/frontend-ui-ux/references/design/resend.md +0 -306
- package/plugin/skills/frontend-ui-ux/references/design/revolut.md +0 -188
- package/plugin/skills/frontend-ui-ux/references/design/runwayml.md +0 -247
- package/plugin/skills/frontend-ui-ux/references/design/sanity.md +0 -360
- package/plugin/skills/frontend-ui-ux/references/design/sentry.md +0 -265
- package/plugin/skills/frontend-ui-ux/references/design/shopify.md +0 -353
- package/plugin/skills/frontend-ui-ux/references/design/soft-skill.md +0 -98
- package/plugin/skills/frontend-ui-ux/references/design/spacex.md +0 -197
- package/plugin/skills/frontend-ui-ux/references/design/spotify.md +0 -249
- package/plugin/skills/frontend-ui-ux/references/design/starbucks.md +0 -583
- package/plugin/skills/frontend-ui-ux/references/design/stitch-design-example.md +0 -121
- package/plugin/skills/frontend-ui-ux/references/design/stitch-skill.md +0 -184
- package/plugin/skills/frontend-ui-ux/references/design/stripe.md +0 -325
- package/plugin/skills/frontend-ui-ux/references/design/supabase.md +0 -258
- package/plugin/skills/frontend-ui-ux/references/design/superhuman.md +0 -255
- package/plugin/skills/frontend-ui-ux/references/design/taste-skill.md +0 -1206
- package/plugin/skills/frontend-ui-ux/references/design/tesla.md +0 -289
- package/plugin/skills/frontend-ui-ux/references/design/theverge.md +0 -342
- package/plugin/skills/frontend-ui-ux/references/design/together.ai.md +0 -266
- package/plugin/skills/frontend-ui-ux/references/design/uber.md +0 -298
- package/plugin/skills/frontend-ui-ux/references/design/vercel.md +0 -313
- package/plugin/skills/frontend-ui-ux/references/design/vodafone.md +0 -426
- package/plugin/skills/frontend-ui-ux/references/design/voltagent.md +0 -326
- package/plugin/skills/frontend-ui-ux/references/design/warp.md +0 -256
- package/plugin/skills/frontend-ui-ux/references/design/webflow.md +0 -95
- package/plugin/skills/frontend-ui-ux/references/design/wired.md +0 -281
- package/plugin/skills/frontend-ui-ux/references/design/wise.md +0 -176
- package/plugin/skills/frontend-ui-ux/references/design/x.ai.md +0 -260
- package/plugin/skills/frontend-ui-ux/references/design/zapier.md +0 -331
- package/plugin/skills/frontend-ui-ux/references/designpowers/EVIDENCE.md +0 -97
- package/plugin/skills/frontend-ui-ux/references/designpowers/README.md +0 -48
- package/plugin/skills/frontend-ui-ux/references/designpowers/UPSTREAM.md +0 -80
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-a-direction.md +0 -64
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-b-execution.md +0 -65
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-c-review.md +0 -65
- package/plugin/skills/frontend-ui-ux/references/designpowers/lane-d-memory.md +0 -83
- package/plugin/skills/frontend-ui-ux/references/designpowers/orchestration.md +0 -80
- package/plugin/skills/frontend-ui-ux/references/designpowers/routing.md +0 -79
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/LICENSE +0 -21
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/accessibility-reviewer.md +0 -83
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/content-writer.md +0 -132
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-builder.md +0 -109
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-critic.md +0 -89
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-lead.md +0 -113
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-scout.md +0 -78
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/design-strategist.md +0 -121
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/heuristic-evaluator.md +0 -268
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/inspiration-scout.md +0 -107
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/agents/motion-designer.md +0 -120
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/accessible-content/reference.md +0 -101
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/adaptive-interfaces/reference.md +0 -109
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/cognitive-accessibility/reference.md +0 -107
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-debate/reference.md +0 -199
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-debt-tracker/reference.md +0 -174
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-handoff/reference.md +0 -125
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-md/reference.md +0 -106
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-retrospective/reference.md +0 -266
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-review/reference.md +0 -123
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/design-system-alignment/reference.md +0 -120
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/designpowers-critique/reference.md +0 -164
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/heuristic-evaluation/reference.md +0 -85
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/inclusive-personas/reference.md +0 -98
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/inspiration-scouting/reference.md +0 -165
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/interaction-design/reference.md +0 -122
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/motion-choreography/reference.md +0 -81
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/research-planning/reference.md +0 -96
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/responsive-patterns/reference.md +0 -77
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/synthetic-user-testing/reference.md +0 -192
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/taste-feedback/reference.md +0 -165
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/taste-report/reference.md +0 -78
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/token-architecture/reference.md +0 -75
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/ui-composition/reference.md +0 -117
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/usability-testing/reference.md +0 -78
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/verification-before-shipping/reference.md +0 -125
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/voice-and-tone/reference.md +0 -79
- package/plugin/skills/frontend-ui-ux/references/designpowers/vendor/skills/writing-design-plans/reference.md +0 -119
- package/plugin/skills/frontend-ui-ux/references/evidence-review.md +0 -126
- package/plugin/skills/frontend-ui-ux/references/house-styles.md +0 -234
- package/plugin/skills/frontend-ui-ux/references/implementation-platforms.md +0 -109
- package/plugin/skills/frontend-ui-ux/references/inclusive-interface.md +0 -92
- package/plugin/skills/frontend-ui-ux/references/interaction-motion.md +0 -47
- package/plugin/skills/frontend-ui-ux/references/motion-guide.md +0 -130
- package/plugin/skills/frontend-ui-ux/references/operating-lanes.md +0 -92
- package/plugin/skills/frontend-ui-ux/references/perfection/README.md +0 -160
- package/plugin/skills/frontend-ui-ux/references/perfection/react-perf-tooling.md +0 -127
- package/plugin/skills/frontend-ui-ux/references/performance-delivery.md +0 -93
- package/plugin/skills/frontend-ui-ux/references/product-direction.md +0 -84
- package/plugin/skills/frontend-ui-ux/references/production-interview.md +0 -17
- package/plugin/skills/frontend-ui-ux/references/redesign-playbook.md +0 -97
- package/plugin/skills/frontend-ui-ux/references/slop-register.md +0 -150
- package/plugin/skills/frontend-ui-ux/references/system-foundations.md +0 -84
- package/plugin/skills/frontend-ui-ux/references/taste-direction.md +0 -86
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/README.md +0 -659
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/charts.csv +0 -26
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/colors.csv +0 -162
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/icons.csv +0 -106
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/landing.csv +0 -35
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/products.csv +0 -162
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/react-performance.csv +0 -45
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/astro.csv +0 -54
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/flutter.csv +0 -53
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/html-tailwind.csv +0 -56
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/jetpack-compose.csv +0 -53
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nextjs.csv +0 -53
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nuxt-ui.csv +0 -51
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/nuxtjs.csv +0 -59
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/react-native.csv +0 -52
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/react.csv +0 -54
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/shadcn.csv +0 -61
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/svelte.csv +0 -54
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/swiftui.csv +0 -51
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/stacks/vue.csv +0 -50
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/styles.csv +0 -85
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/typography.csv +0 -74
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/ui-reasoning.csv +0 -162
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/ux-guidelines.csv +0 -100
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/data/web-interface.csv +0 -31
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/core.py +0 -262
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/design_system.py +0 -1148
- package/plugin/skills/frontend-ui-ux/references/ui-ux-db/scripts/search.py +0 -114
- package/plugin/skills/frontend-ui-ux/references/visual-language.md +0 -84
- package/plugin/skills/frontend-ui-ux/references/visual-reconstruction.md +0 -51
- package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1alpha1.schema.json +0 -306
- package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1beta1.schema.json +0 -291
- package/plugin/skills/frontend-ui-ux/schemas/design-contract-v1beta2.schema.json +0 -311
- package/plugin/skills/frontend-ui-ux/scripts/chrome-driver.mjs +0 -202
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-format.mjs +0 -286
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-inventory-rules.mjs +0 -354
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-rules.mjs +0 -361
- package/plugin/skills/frontend-ui-ux/scripts/design-contract-surface-rules.mjs +0 -313
- package/plugin/skills/frontend-ui-ux/scripts/design-data.mjs +0 -68
- package/plugin/skills/frontend-ui-ux/scripts/design-lock.mjs +0 -400
- package/plugin/skills/frontend-ui-ux/scripts/errors.mjs +0 -12
- package/plugin/skills/frontend-ui-ux/scripts/import-design-intelligence.mjs +0 -124
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +0 -196
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +0 -1555
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +0 -153
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-server.mjs +0 -57
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-static.mjs +0 -133
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +0 -341
- package/plugin/skills/frontend-ui-ux/scripts/json-boundary.mjs +0 -63
- package/plugin/skills/frontend-ui-ux/scripts/pixel-art.mjs +0 -60
- package/plugin/skills/frontend-ui-ux/scripts/query-design-intelligence.mjs +0 -106
- package/plugin/skills/frontend-ui-ux/scripts/search.mjs +0 -43
- package/plugin/skills/frontend-ui-ux/scripts/source-replay.mjs +0 -153
- package/plugin/skills/frontend-ui-ux/scripts/validate-design-contract.mjs +0 -52
- package/plugin/skills/frontend-ui-ux/scripts/verify-corpus.mjs +0 -90
- package/plugin/skills/lit-diagram-drawer/NOTICE +0 -33
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-architecture-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bar-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-beeswarm-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bubble-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-bump-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-data-flow-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-datalake-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-db-schema-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dependency-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-deployment-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-integration-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-er-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-fishbone-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-flowchart-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-gantt-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-heatmap-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-drawio-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-it-state-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-journey-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-kanban-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-layers-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-line-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-marimekko-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-medallion-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-nested-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-org-chart-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-polar-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-process-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-pyramid-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-quadrant-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-queue-animated-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-radar-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-ridgeline-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sankey-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-scatter-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-slopegraph-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-state-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-story-map-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-streamgraph-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-swimlane-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-timeline-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-tree-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-treemap-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-uml-class-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-venn-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-wardley-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-dark.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-full.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/examples/type-waterfall-light.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/fonts/OFL.txt +0 -94
- package/plugin/skills/lit-diagram-drawer/assets/fonts/PretendardVariable.woff2 +0 -0
- package/plugin/skills/lit-diagram-drawer/assets/fonts/provenance.json +0 -22
- package/plugin/skills/lit-diagram-drawer/assets/icons.html +0 -231
- package/plugin/skills/lit-diagram-drawer/assets/index.html +0 -1
- package/plugin/skills/lit-diagram-drawer/assets/licenses/devicon-MIT.txt +0 -20
- package/plugin/skills/lit-diagram-drawer/assets/licenses/diagram-design-MIT.txt +0 -21
- package/plugin/skills/lit-diagram-drawer/assets/licenses/log-z-MIT.txt +0 -21
- package/plugin/skills/lit-diagram-drawer/assets/licenses/simple-icons-CC0.md +0 -30
- package/plugin/skills/lit-diagram-drawer/assets/licenses/tabler-MIT.txt +0 -21
- package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/brief.md +0 -33
- package/plugin/skills/lit-diagram-drawer/examples/01-service-architecture/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/brief.md +0 -18
- package/plugin/skills/lit-diagram-drawer/examples/02-release-decision/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/brief.md +0 -19
- package/plugin/skills/lit-diagram-drawer/examples/03-data-retention/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/brief.md +0 -17
- package/plugin/skills/lit-diagram-drawer/examples/04-oauth-sequence/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/brief.md +0 -17
- package/plugin/skills/lit-diagram-drawer/examples/05-review-lanes/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/brief.md +0 -17
- package/plugin/skills/lit-diagram-drawer/examples/06-rollout-gates/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/brief.md +0 -19
- package/plugin/skills/lit-diagram-drawer/examples/07-deployment-boundary/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/after.html +0 -1
- package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/brief.md +0 -20
- package/plugin/skills/lit-diagram-drawer/examples/08-policy-traces/constructed-naive-foil.html +0 -1
- package/plugin/skills/lit-diagram-drawer/references/accessibility.md +0 -37
- package/plugin/skills/lit-diagram-drawer/references/export.md +0 -29
- package/plugin/skills/lit-diagram-drawer/references/import-drawio.md +0 -21
- package/plugin/skills/lit-diagram-drawer/references/import-excalidraw.md +0 -14
- package/plugin/skills/lit-diagram-drawer/references/import-mermaid.md +0 -18
- package/plugin/skills/lit-diagram-drawer/references/import-schema.md +0 -28
- package/plugin/skills/lit-diagram-drawer/references/korean-typography.md +0 -34
- package/plugin/skills/lit-diagram-drawer/references/motion.md +0 -29
- package/plugin/skills/lit-diagram-drawer/references/office-pptx-docx.md +0 -42
- package/plugin/skills/lit-diagram-drawer/references/output-spec.md +0 -48
- package/plugin/skills/lit-diagram-drawer/references/primitive-annotation.md +0 -12
- package/plugin/skills/lit-diagram-drawer/references/primitive-icons.md +0 -21
- package/plugin/skills/lit-diagram-drawer/references/primitive-sketchy.md +0 -11
- package/plugin/skills/lit-diagram-drawer/references/primitive-terminal.md +0 -11
- package/plugin/skills/lit-diagram-drawer/references/profiles.md +0 -24
- package/plugin/skills/lit-diagram-drawer/references/semantic-patterns.md +0 -27
- package/plugin/skills/lit-diagram-drawer/references/style-guide.md +0 -67
- package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +0 -51
- package/plugin/skills/lit-diagram-drawer/references/type-bar.md +0 -51
- package/plugin/skills/lit-diagram-drawer/references/type-beeswarm.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-bubble.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-bump.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-catalog.json +0 -1433
- package/plugin/skills/lit-diagram-drawer/references/type-data-flow.md +0 -51
- package/plugin/skills/lit-diagram-drawer/references/type-datalake.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-db-schema.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-deployment.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-dp-integration.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-dp-security-matrix.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-er.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-fishbone.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-flowchart.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-gantt.md +0 -49
- package/plugin/skills/lit-diagram-drawer/references/type-heatmap.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-high-level-vertical.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-high-level.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-import-drawio.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-import-excalidraw.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-import-mermaid.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-it-state.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-journey.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-kanban.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-layers.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-line.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-loop-terminal.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-loop.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-marimekko.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-medallion.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-nested.md +0 -59
- package/plugin/skills/lit-diagram-drawer/references/type-org-chart.md +0 -58
- package/plugin/skills/lit-diagram-drawer/references/type-paved-road-animated.md +0 -72
- package/plugin/skills/lit-diagram-drawer/references/type-polar.md +0 -67
- package/plugin/skills/lit-diagram-drawer/references/type-policy-trace-animated.md +0 -69
- package/plugin/skills/lit-diagram-drawer/references/type-process.md +0 -58
- package/plugin/skills/lit-diagram-drawer/references/type-pyramid.md +0 -59
- package/plugin/skills/lit-diagram-drawer/references/type-quadrant-consultant.md +0 -60
- package/plugin/skills/lit-diagram-drawer/references/type-quadrant.md +0 -57
- package/plugin/skills/lit-diagram-drawer/references/type-queue-animated.md +0 -63
- package/plugin/skills/lit-diagram-drawer/references/type-radar.md +0 -57
- package/plugin/skills/lit-diagram-drawer/references/type-ridgeline.md +0 -63
- package/plugin/skills/lit-diagram-drawer/references/type-sankey.md +0 -68
- package/plugin/skills/lit-diagram-drawer/references/type-scatter.md +0 -60
- package/plugin/skills/lit-diagram-drawer/references/type-sequence-oauth.md +0 -66
- package/plugin/skills/lit-diagram-drawer/references/type-sequence.md +0 -63
- package/plugin/skills/lit-diagram-drawer/references/type-slopegraph.md +0 -65
- package/plugin/skills/lit-diagram-drawer/references/type-state-lifecycle.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-state.md +0 -59
- package/plugin/skills/lit-diagram-drawer/references/type-story-map.md +0 -52
- package/plugin/skills/lit-diagram-drawer/references/type-streamgraph.md +0 -53
- package/plugin/skills/lit-diagram-drawer/references/type-swimlane.md +0 -52
- package/plugin/skills/lit-diagram-drawer/references/type-timeline.md +0 -52
- package/plugin/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +0 -57
- package/plugin/skills/lit-diagram-drawer/references/type-tree.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-treemap.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/type-uml-class.md +0 -52
- package/plugin/skills/lit-diagram-drawer/references/type-venn.md +0 -51
- package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +0 -52
- package/plugin/skills/lit-diagram-drawer/references/type-waterfall.md +0 -54
- package/plugin/skills/lit-diagram-drawer/references/verifier-guide.md +0 -59
- package/plugin/skills/lit-diagram-drawer/scripts/block-registry.mjs +0 -43
- package/plugin/skills/lit-diagram-drawer/scripts/brief-contract.mjs +0 -94
- package/plugin/skills/lit-diagram-drawer/scripts/check-visible-text.mjs +0 -15
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +0 -13
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-metrics.mjs +0 -219
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-runtime-lock/package.json +0 -9
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-runtime.mjs +0 -275
- package/plugin/skills/lit-diagram-drawer/scripts/doctor.mjs +0 -25
- package/plugin/skills/lit-diagram-drawer/scripts/drawio-model.mjs +0 -162
- package/plugin/skills/lit-diagram-drawer/scripts/drawio-source.mjs +0 -147
- package/plugin/skills/lit-diagram-drawer/scripts/drawio-xml.mjs +0 -148
- package/plugin/skills/lit-diagram-drawer/scripts/export.mjs +0 -119
- package/plugin/skills/lit-diagram-drawer/scripts/import-common.mjs +0 -85
- package/plugin/skills/lit-diagram-drawer/scripts/import-drawio.mjs +0 -48
- package/plugin/skills/lit-diagram-drawer/scripts/import-excalidraw.mjs +0 -234
- package/plugin/skills/lit-diagram-drawer/scripts/import-mermaid.mjs +0 -104
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-common.mjs +0 -115
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-er.mjs +0 -70
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-flowchart.mjs +0 -178
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-sequence.mjs +0 -137
- package/plugin/skills/lit-diagram-drawer/scripts/mermaid-state.mjs +0 -80
- package/plugin/skills/lit-diagram-drawer/scripts/office-safety.mjs +0 -54
- package/plugin/skills/lit-diagram-drawer/scripts/runtime-probes.mjs +0 -11
- package/plugin/skills/lit-diagram-drawer/scripts/verify-all.mjs +0 -85
- package/plugin/skills/lit-diagram-drawer/scripts/verify-brief.mjs +0 -16
- package/plugin/skills/lit-diagram-drawer/scripts/verify-diagram.mjs +0 -27
- package/plugin/skills/lit-diagram-drawer/scripts/verify-motion.mjs +0 -12
- package/plugin/skills/lit-diagram-drawer/scripts/verify-type.mjs +0 -48
- package/plugin/skills/lit-diagram-drawer/scripts/visual-quality-geometry.mjs +0 -226
- package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +0 -146
- package/plugin/skills/lit-docx/NOTICE +0 -33
- package/plugin/skills/lit-docx/references/components.md +0 -207
- package/plugin/skills/lit-docx/references/direction-step.md +0 -277
- package/plugin/skills/lit-docx/references/examples/01-report-ko.md +0 -166
- package/plugin/skills/lit-docx/references/examples/02-brief-ko.md +0 -105
- package/plugin/skills/lit-docx/references/examples/03-manual-ko.md +0 -164
- package/plugin/skills/lit-docx/references/examples/04-proposal-ko.md +0 -138
- package/plugin/skills/lit-docx/references/examples/05-memo-en.md +0 -55
- package/plugin/skills/lit-docx/references/examples/06-journal-en.md +0 -130
- package/plugin/skills/lit-docx/references/examples/07-report-en.md +0 -123
- package/plugin/skills/lit-docx/references/examples/08-proposal-en.md +0 -123
- package/plugin/skills/lit-docx/references/examples/09-memo-ko.md +0 -45
- package/plugin/skills/lit-docx/references/frontmatter_schema.md +0 -42
- package/plugin/skills/lit-docx/references/journal_style_spec.md +0 -17
- package/plugin/skills/lit-docx/references/markdown_quality_checklist.md +0 -37
- package/plugin/skills/lit-docx/references/page-composition.md +0 -221
- package/plugin/skills/lit-docx/references/slop_phrase_list.yaml +0 -58
- package/plugin/skills/lit-docx/references/slop_rules.md +0 -35
- package/plugin/skills/lit-docx/references/tonalities/brief.md +0 -143
- package/plugin/skills/lit-docx/references/tonalities/journal.md +0 -142
- package/plugin/skills/lit-docx/references/tonalities/manual.md +0 -148
- package/plugin/skills/lit-docx/references/tonalities/memo.md +0 -137
- package/plugin/skills/lit-docx/references/tonalities/proposal.md +0 -140
- package/plugin/skills/lit-docx/references/tonalities/report.md +0 -156
- package/plugin/skills/lit-docx/scripts/clean_markdown.py +0 -95
- package/plugin/skills/lit-docx/scripts/convert_md_to_docx.py +0 -1395
- package/plugin/skills/lit-docx/scripts/convert_md_to_pdf.py +0 -302
- package/plugin/skills/lit-docx/scripts/convert_pdf.py +0 -139
- package/plugin/skills/lit-docx/scripts/docx_design.py +0 -2449
- package/plugin/skills/lit-docx/scripts/docx_layout.py +0 -959
- package/plugin/skills/lit-docx/scripts/edit_docx.py +0 -306
- package/plugin/skills/lit-docx/scripts/embed_images.py +0 -78
- package/plugin/skills/lit-docx/scripts/generate_docx_templates.py +0 -500
- package/plugin/skills/lit-docx/scripts/qa_docx.py +0 -234
- package/plugin/skills/lit-docx/scripts/slop_lint.py +0 -573
- package/plugin/skills/lit-docx/scripts/visual_audit.py +0 -48
- package/plugin/skills/lit-docx/templates/docx/acs.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/elsevier.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/ieee.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/korean-generic.docx +0 -0
- package/plugin/skills/lit-docx/templates/docx/nature.docx +0 -0
- package/plugin/skills/lit-docx/templates/latex/acs/README.md +0 -5
- package/plugin/skills/lit-docx/templates/latex/acs/template.tex +0 -39
- package/plugin/skills/lit-docx/templates/latex/elsevier/README.md +0 -5
- package/plugin/skills/lit-docx/templates/latex/elsevier/template.tex +0 -40
- package/plugin/skills/lit-docx/templates/latex/ieee/README.md +0 -5
- package/plugin/skills/lit-docx/templates/latex/ieee/template.tex +0 -39
- package/plugin/skills/lit-docx/templates/latex/korean-generic/README.md +0 -5
- package/plugin/skills/lit-docx/templates/latex/korean-generic/template.tex +0 -39
- package/plugin/skills/lit-docx/templates/latex/nature/README.md +0 -5
- package/plugin/skills/lit-docx/templates/latex/nature/template.tex +0 -39
- package/plugin/skills/lit-docx/templates/registry.yaml +0 -1366
- package/plugin/skills/lit-docx/templates/tonalities/brief.yaml +0 -28
- package/plugin/skills/lit-docx/templates/tonalities/journal.yaml +0 -25
- package/plugin/skills/lit-docx/templates/tonalities/manual.yaml +0 -26
- package/plugin/skills/lit-docx/templates/tonalities/memo.yaml +0 -26
- package/plugin/skills/lit-docx/templates/tonalities/proposal.yaml +0 -26
- package/plugin/skills/lit-docx/templates/tonalities/report.yaml +0 -26
- package/plugin/skills/lit-pptx/NOTICE +0 -38
- package/plugin/skills/lit-pptx/assets/azure/circle-lg.png +0 -0
- package/plugin/skills/lit-pptx/assets/azure/circle-md.png +0 -0
- package/plugin/skills/lit-pptx/assets/azure/circle-sm.png +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Black.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Bold.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Light.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Medium.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/A2Z-Regular.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/a2z/OFL.txt +0 -94
- package/plugin/skills/lit-pptx/fonts/a2z/SOURCE.md +0 -29
- package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
- package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
- package/plugin/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +0 -93
- package/plugin/skills/lit-pptx/fonts/pretendard/OFL.txt +0 -94
- package/plugin/skills/lit-pptx/fonts/pretendard/Pretendard-Bold.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/pretendard/Pretendard-Regular.otf +0 -0
- package/plugin/skills/lit-pptx/fonts/provenance.json +0 -109
- package/plugin/skills/lit-pptx/references/agents/analyst.md +0 -49
- package/plugin/skills/lit-pptx/references/agents/antithesis.md +0 -59
- package/plugin/skills/lit-pptx/references/agents/architect.md +0 -44
- package/plugin/skills/lit-pptx/references/agents/critic.md +0 -42
- package/plugin/skills/lit-pptx/references/agents/synthesizer.md +0 -47
- package/plugin/skills/lit-pptx/references/agents/thesis.md +0 -33
- package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +0 -110
- package/plugin/skills/lit-pptx/references/authoring-guide.md +0 -250
- package/plugin/skills/lit-pptx/references/consensus-protocol.md +0 -125
- package/plugin/skills/lit-pptx/references/data-display-cookbook.md +0 -52
- package/plugin/skills/lit-pptx/references/density-and-fill.md +0 -164
- package/plugin/skills/lit-pptx/references/design-system-azure.md +0 -61
- package/plugin/skills/lit-pptx/references/direction-step.md +0 -203
- package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +0 -210
- package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +0 -147
- package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +0 -199
- package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +0 -203
- package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +0 -178
- package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +0 -199
- package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +0 -194
- package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +0 -175
- package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +0 -204
- package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +0 -179
- package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +0 -164
- package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +0 -174
- package/plugin/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +0 -173
- package/plugin/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +0 -154
- package/plugin/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +0 -139
- package/plugin/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +0 -158
- package/plugin/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +0 -179
- package/plugin/skills/lit-pptx/references/interview-protocol.md +0 -113
- package/plugin/skills/lit-pptx/references/layout-families.md +0 -198
- package/plugin/skills/lit-pptx/references/stages/autopilot.md +0 -48
- package/plugin/skills/lit-pptx/references/stages/interview.md +0 -52
- package/plugin/skills/lit-pptx/references/stages/plan.md +0 -42
- package/plugin/skills/lit-pptx/references/title-treatments.md +0 -109
- package/plugin/skills/lit-pptx/references/tonalities/atlas.md +0 -139
- package/plugin/skills/lit-pptx/references/tonalities/bauhaus.md +0 -112
- package/plugin/skills/lit-pptx/references/tonalities/chalk.md +0 -148
- package/plugin/skills/lit-pptx/references/tonalities/computational-brutalism.md +0 -118
- package/plugin/skills/lit-pptx/references/tonalities/gazette.md +0 -149
- package/plugin/skills/lit-pptx/references/tonalities/ledger.md +0 -149
- package/plugin/skills/lit-pptx/references/tonalities/neo-brutalism.md +0 -125
- package/plugin/skills/lit-pptx/references/tonalities/newsroom.md +0 -115
- package/plugin/skills/lit-pptx/references/tonalities/night.md +0 -147
- package/plugin/skills/lit-pptx/references/tonalities/paper.md +0 -151
- package/plugin/skills/lit-pptx/references/tonalities/riso.md +0 -109
- package/plugin/skills/lit-pptx/references/tonalities/signal.md +0 -150
- package/plugin/skills/lit-pptx/references/tonalities/studio.md +0 -132
- package/plugin/skills/lit-pptx/scripts/compile-deck.js +0 -462
- package/plugin/skills/lit-pptx/scripts/craft_extras.py +0 -1078
- package/plugin/skills/lit-pptx/scripts/deck_craft.py +0 -363
- package/plugin/skills/lit-pptx/scripts/embed_fonts.py +0 -227
- package/plugin/skills/lit-pptx/scripts/forbidden-terms.json +0 -55
- package/plugin/skills/lit-pptx/scripts/layout_inventory.py +0 -418
- package/plugin/skills/lit-pptx/scripts/learn_template.py +0 -446
- package/plugin/skills/lit-pptx/scripts/lib/derive-palette.js +0 -176
- package/plugin/skills/lit-pptx/scripts/lib/directive-parser.js +0 -244
- package/plugin/skills/lit-pptx/scripts/lib/font-map.js +0 -79
- package/plugin/skills/lit-pptx/scripts/lib/gen-bg.js +0 -86
- package/plugin/skills/lit-pptx/scripts/lib/gen-gradient-assets.js +0 -37
- package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +0 -510
- package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +0 -1113
- package/plugin/skills/lit-pptx/scripts/lib/markdown-loader.js +0 -138
- package/plugin/skills/lit-pptx/scripts/lib/render-adapter-html.js +0 -356
- package/plugin/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +0 -2240
- package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +0 -3366
- package/plugin/skills/lit-pptx/scripts/lib/runtime-require.js +0 -28
- package/plugin/skills/lit-pptx/scripts/lib/slide-ast.js +0 -565
- package/plugin/skills/lit-pptx/scripts/lib/slide-grid.js +0 -104
- package/plugin/skills/lit-pptx/scripts/lib/spec-validator.js +0 -94
- package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +0 -730
- package/plugin/skills/lit-pptx/scripts/package.json +0 -4
- package/plugin/skills/lit-pptx/scripts/qa_deck.py +0 -795
- package/plugin/skills/lit-pptx/scripts/validate_pptx.py +0 -230
- package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +0 -251
- package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +0 -214
- package/plugin/skills/lit-pptx/specs/slide-ast-v1.schema.json +0 -229
- package/plugin/skills/lit-pptx/specs/slide-ast-v2.schema.json +0 -144
- package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +0 -382
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/capabilities.yaml +0 -146
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +0 -454
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +0 -40
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/capabilities.yaml +0 -154
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +0 -475
- package/plugin/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +0 -40
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/capabilities.yaml +0 -179
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/layout-mapping.yaml +0 -299
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/template.yaml +0 -45
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml +0 -181
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml +0 -299
- package/plugin/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml +0 -44
- package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +0 -92
- package/plugin/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +0 -98
- package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +0 -97
- package/plugin/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +0 -99
- package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +0 -93
- package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +0 -94
- package/plugin/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +0 -107
- package/plugin/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +0 -99
- package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +0 -93
- package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +0 -98
- package/plugin/skills/lit-pptx/templates/tonalities/riso/pack.yaml +0 -99
- package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +0 -94
- package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +0 -92
- package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +0 -14
- package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +0 -8
- package/plugin/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +0 -22
- package/plugin/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +0 -81
- package/plugin/skills/lit-schematic/references/cutaway-outputs.md +0 -25
- package/plugin/skills/lit-schematic/references/isometric-craft.md +0 -24
- package/plugin/skills/lit-schematic/references/journal-figures.md +0 -19
- package/plugin/skills/lit-schematic/references/kit-api.md +0 -42
- package/plugin/skills/lit-schematic/references/pfd-and-layout.md +0 -20
- package/plugin/skills/lit-schematic/references/pid-drafting.md +0 -30
- package/plugin/skills/lit-schematic/references/pid-symbols.md +0 -35
- package/plugin/skills/lit-schematic/references/verification.md +0 -31
- package/plugin/skills/lit-schematic/scripts/doctor.mjs +0 -13
- package/plugin/skills/lit-schematic/scripts/lib/figure.mjs +0 -49
- package/plugin/skills/lit-schematic/scripts/lib/isa.mjs +0 -18
- package/plugin/skills/lit-schematic/scripts/lib/iso.mjs +0 -58
- package/plugin/skills/lit-schematic/scripts/lib/legend-sheet.mjs +0 -10
- package/plugin/skills/lit-schematic/scripts/lib/qa-core.mjs +0 -349
- package/plugin/skills/lit-schematic/scripts/lib/sheet.mjs +0 -497
- package/plugin/skills/lit-schematic/scripts/lib/svg.mjs +0 -39
- package/plugin/skills/lit-schematic/scripts/lib/theme.mjs +0 -25
- package/plugin/skills/lit-schematic/scripts/motion.mjs +0 -8
- package/plugin/skills/lit-schematic/scripts/qa.mjs +0 -21
- package/plugin/skills/lit-schematic/scripts/render.mjs +0 -38
- package/plugin/skills/lit-schematic/scripts/scaffold.mjs +0 -73
- package/plugin/skills/lit-scientific-visualization/LICENSE +0 -21
- package/plugin/skills/lit-scientific-visualization/assets/color_palettes.py +0 -197
- package/plugin/skills/lit-scientific-visualization/assets/nature.mplstyle +0 -75
- package/plugin/skills/lit-scientific-visualization/assets/presentation.mplstyle +0 -74
- package/plugin/skills/lit-scientific-visualization/assets/publication.mplstyle +0 -78
- package/plugin/skills/lit-scientific-visualization/evals/evals.json +0 -158
- package/plugin/skills/lit-scientific-visualization/references/canonical-workflow.md +0 -283
- package/plugin/skills/lit-scientific-visualization/references/color_palettes.md +0 -380
- package/plugin/skills/lit-scientific-visualization/references/journal_requirements.md +0 -359
- package/plugin/skills/lit-scientific-visualization/references/matplotlib_examples.md +0 -608
- package/plugin/skills/lit-scientific-visualization/references/mdanalysis_martini_visualization.md +0 -85
- package/plugin/skills/lit-scientific-visualization/references/publication_guidelines.md +0 -217
- package/plugin/skills/lit-scientific-visualization/references/seaborn_for_publications.md +0 -293
- package/plugin/skills/lit-scientific-visualization/scripts/figure_export.py +0 -238
- package/plugin/skills/lit-scientific-visualization/scripts/sciviz-runtime-requirements.lock +0 -23
- package/plugin/skills/lit-scientific-visualization/scripts/sciviz-runtime.mjs +0 -225
- package/plugin/skills/lit-scientific-visualization/scripts/style_presets.py +0 -467
- package/plugin/skills/lit-scientific-visualization/tests/test_figure_export.py +0 -51
- package/plugin/skills/lit-scientific-visualization/tests/test_style_presets.py +0 -114
- package/plugin/skills/lit-typographic-motion/engine/NOTICE +0 -23
- package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +0 -73
- package/plugin/skills/lit-typographic-motion/engine/audio/beat_grid.py +0 -56
- package/plugin/skills/lit-typographic-motion/engine/audio/requirements.lock +0 -1084
- package/plugin/skills/lit-typographic-motion/engine/blender/runner.py +0 -218
- package/plugin/skills/lit-typographic-motion/engine/core/constants.mjs +0 -246
- package/plugin/skills/lit-typographic-motion/engine/core/contrast.mjs +0 -90
- package/plugin/skills/lit-typographic-motion/engine/core/events.mjs +0 -46
- package/plugin/skills/lit-typographic-motion/engine/core/flash.mjs +0 -211
- package/plugin/skills/lit-typographic-motion/engine/core/gate-rules.mjs +0 -550
- package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +0 -123
- package/plugin/skills/lit-typographic-motion/engine/core/text.mjs +0 -100
- package/plugin/skills/lit-typographic-motion/engine/core/timeline.mjs +0 -142
- package/plugin/skills/lit-typographic-motion/engine/core/util.mjs +0 -167
- package/plugin/skills/lit-typographic-motion/engine/core/voices.mjs +0 -19
- package/plugin/skills/lit-typographic-motion/engine/models/word-timing.json +0 -198
- package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +0 -108
- package/plugin/skills/lit-typographic-motion/engine/node/assets.mjs +0 -218
- package/plugin/skills/lit-typographic-motion/engine/node/blender.mjs +0 -144
- package/plugin/skills/lit-typographic-motion/engine/node/board.mjs +0 -136
- package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +0 -158
- package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +0 -330
- package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +0 -102
- package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +0 -213
- package/plugin/skills/lit-typographic-motion/engine/node/cover-gate.mjs +0 -346
- package/plugin/skills/lit-typographic-motion/engine/node/cover-image.mjs +0 -141
- package/plugin/skills/lit-typographic-motion/engine/node/cover-sheet.mjs +0 -76
- package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +0 -106
- package/plugin/skills/lit-typographic-motion/engine/node/cover-worker.mjs +0 -32
- package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +0 -373
- package/plugin/skills/lit-typographic-motion/engine/node/coverage.mjs +0 -83
- package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +0 -209
- package/plugin/skills/lit-typographic-motion/engine/node/encode.mjs +0 -102
- package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +0 -36
- package/plugin/skills/lit-typographic-motion/engine/node/gallery.mjs +0 -120
- package/plugin/skills/lit-typographic-motion/engine/node/house.mjs +0 -44
- package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +0 -164
- package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +0 -603
- package/plugin/skills/lit-typographic-motion/engine/node/png.mjs +0 -112
- package/plugin/skills/lit-typographic-motion/engine/node/report.mjs +0 -66
- package/plugin/skills/lit-typographic-motion/engine/node/runtime.mjs +0 -348
- package/plugin/skills/lit-typographic-motion/engine/node/scaffold.mjs +0 -210
- package/plugin/skills/lit-typographic-motion/engine/node/score.mjs +0 -639
- package/plugin/skills/lit-typographic-motion/engine/node/session.mjs +0 -145
- package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +0 -77
- package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +0 -740
- package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +0 -179
- package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +0 -123
- package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +0 -295
- package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +0 -430
- package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +0 -572
- package/plugin/skills/lit-typographic-motion/engine/node/stills.mjs +0 -100
- package/plugin/skills/lit-typographic-motion/engine/node/styles.mjs +0 -214
- package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +0 -645
- package/plugin/skills/lit-typographic-motion/engine/node/webp.mjs +0 -145
- package/plugin/skills/lit-typographic-motion/engine/node/ws-server.mjs +0 -132
- package/plugin/skills/lit-typographic-motion/engine/package-lock.json +0 -25
- package/plugin/skills/lit-typographic-motion/engine/package.json +0 -10
- package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +0 -37
- package/plugin/skills/lit-typographic-motion/engine/stage/init.js +0 -288
- package/plugin/skills/lit-typographic-motion/engine/stage/loop-kit.js +0 -106
- package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +0 -157
- package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +0 -741
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/LICENSE +0 -21
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +0 -144
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +0 -155
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/three.module.js +0 -54571
- package/plugin/skills/lit-typographic-motion/engine/web/boot.mjs +0 -123
- package/plugin/skills/lit-typographic-motion/engine/web/engine.mjs +0 -281
- package/plugin/skills/lit-typographic-motion/engine/web/gl.mjs +0 -319
- package/plugin/skills/lit-typographic-motion/engine/web/glsl-common.mjs +0 -78
- package/plugin/skills/lit-typographic-motion/engine/web/index.html +0 -6
- package/plugin/skills/lit-typographic-motion/engine/web/lines.mjs +0 -112
- package/plugin/skills/lit-typographic-motion/engine/web/passes/crt.mjs +0 -98
- package/plugin/skills/lit-typographic-motion/engine/web/passes/dither.mjs +0 -49
- package/plugin/skills/lit-typographic-motion/engine/web/passes/glitch.mjs +0 -77
- package/plugin/skills/lit-typographic-motion/engine/web/passes/swiss-grid.mjs +0 -61
- package/plugin/skills/lit-typographic-motion/engine/web/passes/terminal-ui.mjs +0 -88
- package/plugin/skills/lit-typographic-motion/engine/web/passes/tidal-gradient.mjs +0 -86
- package/plugin/skills/lit-typographic-motion/engine/web/post.mjs +0 -165
- package/plugin/skills/lit-typographic-motion/engine/web/scale.mjs +0 -15
- package/plugin/skills/lit-typographic-motion/engine/web/scene.mjs +0 -82
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/end-card.mjs +0 -30
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/index.mjs +0 -16
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/karaoke-line.mjs +0 -47
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/kinetic-list.mjs +0 -45
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/number-counter.mjs +0 -29
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/signature.mjs +0 -73
- package/plugin/skills/lit-typographic-motion/engine/web/scenes/title-slam.mjs +0 -73
- package/plugin/skills/lit-typographic-motion/engine/web/stroke.mjs +0 -236
- package/plugin/skills/lit-typographic-motion/engine/web/type.mjs +0 -180
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-400.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-700.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-900.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-400.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-700.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-900.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-400.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-700.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-900.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/archivo/OFL.txt +0 -93
- package/plugin/skills/lit-typographic-motion/fonts/jetbrains-mono/JetBrainsMono-wght-latin.woff2 +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/jetbrains-mono/OFL.txt +0 -93
- package/plugin/skills/lit-typographic-motion/fonts/manifest.json +0 -455
- package/plugin/skills/lit-typographic-motion/fonts/silkscreen/OFL.txt +0 -93
- package/plugin/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Bold.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/silkscreen/Silkscreen-Regular.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/fonts/stroke/CREDITS +0 -42
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSAllure.svg +0 -216
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSFelix.svg +0 -216
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSOsmotron.svg +0 -216
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSReadability.svg +0 -216
- package/plugin/skills/lit-typographic-motion/fonts/stroke/EMSTech.svg +0 -217
- package/plugin/skills/lit-typographic-motion/fonts/stroke/OFL.txt +0 -91
- package/plugin/skills/lit-typographic-motion/fonts/vt323/OFL.txt +0 -93
- package/plugin/skills/lit-typographic-motion/fonts/vt323/VT323-Regular.ttf +0 -0
- package/plugin/skills/lit-typographic-motion/recipes/hero-3d/expected.json +0 -69
- package/plugin/skills/lit-typographic-motion/recipes/hero-3d/index.html +0 -139
- package/plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/expected.json +0 -16
- package/plugin/skills/lit-typographic-motion/recipes/negatives/card-scenes/index.html +0 -27
- package/plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/expected.json +0 -16
- package/plugin/skills/lit-typographic-motion/recipes/negatives/reset-sweep/index.html +0 -17
- package/plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/expected.json +0 -17
- package/plugin/skills/lit-typographic-motion/recipes/negatives/still-glow/index.html +0 -18
- package/plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/expected.json +0 -17
- package/plugin/skills/lit-typographic-motion/recipes/negatives/title-slam/index.html +0 -30
- package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +0 -67
- package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/index.html +0 -152
- package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +0 -95
- package/plugin/skills/lit-typographic-motion/recipes/painted-light/index.html +0 -202
- package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +0 -67
- package/plugin/skills/lit-typographic-motion/recipes/weight-tide/index.html +0 -100
- package/plugin/skills/lit-typographic-motion/references/brief-schema.md +0 -119
- package/plugin/skills/lit-typographic-motion/references/cover.md +0 -475
- package/plugin/skills/lit-typographic-motion/references/craft-loop.md +0 -100
- package/plugin/skills/lit-typographic-motion/references/depth.md +0 -122
- package/plugin/skills/lit-typographic-motion/references/engine-contract.md +0 -124
- package/plugin/skills/lit-typographic-motion/references/look.md +0 -157
- package/plugin/skills/lit-typographic-motion/references/runtime.md +0 -98
- package/plugin/skills/lit-typographic-motion/references/sound.md +0 -181
- package/plugin/skills/lit-typographic-motion/references/stage.md +0 -310
- package/plugin/skills/lit-typographic-motion/references/studio.md +0 -245
- package/plugin/skills/lit-typographic-motion/references/style-bibles.md +0 -130
- package/plugin/skills/lit-typographic-motion/references/treatment.md +0 -189
- package/plugin/skills/lit-typographic-motion/references/type-craft.md +0 -87
- package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +0 -99
- package/plugin/skills/lit-typographic-motion/scripts/motion-runtime.mjs +0 -95
- package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +0 -206
- package/plugin/skills/lit-typographic-motion/styles/paper.json +0 -41
- package/plugin/skills/lit-typographic-motion/styles/swiss-signal.json +0 -41
- package/plugin/skills/lit-typographic-motion/styles/terminalcore.json +0 -42
- package/plugin/skills/lit-typographic-motion/styles/tidal.json +0 -41
- package/plugin/skills/readme-studio/references/decoration-and-navigation.md +0 -55
- package/plugin/skills/readme-studio/references/facts-and-assembly.md +0 -19
- package/plugin/skills/readme-studio/references/production-interview.md +0 -11
- package/plugin/skills/readme-studio/references/render-and-deliver.md +0 -44
- package/plugin/skills/readme-studio/references/type-and-background.md +0 -23
- package/plugin/skills/readme-studio/scripts/readme-runtime-lock/package-lock.json +0 -133
- package/plugin/skills/readme-studio/scripts/readme-runtime-lock/package.json +0 -6
- package/plugin/skills/readme-studio/scripts/readme-runtime.mjs +0 -77
- package/plugin/skills/readme-studio/scripts/validate-readme-facts.mjs +0 -28
- package/plugin/skills/readme-studio/templates/cover-source.json +0 -21
- package/plugin/skills/readme-studio/templates/hyperframes-cover/index.html +0 -30
- package/plugin/skills/readme-studio/templates/hyperframes-cover/index.motion.json +0 -1
- package/plugin/skills/readme-studio/templates/hyperframes-cover/package-lock.json +0 -2017
- package/plugin/skills/readme-studio/templates/hyperframes-cover/package.json +0 -8
- package/plugin/skills/readme-studio/templates/readme-cover-section.md +0 -75
- package/plugin/skills/readme-studio/templates/readme-facts.json +0 -4
- package/plugin/skills/readme-studio/templates/remotion-cover/package-lock.json +0 -3783
- package/plugin/skills/readme-studio/templates/remotion-cover/package.json +0 -7
- package/plugin/skills/readme-studio/templates/remotion-cover/src/index.tsx +0 -36
- package/plugin/skills/readme-studio/templates/typography/package-lock.json +0 -133
- package/plugin/skills/readme-studio/templates/typography/package.json +0 -6
- package/plugin/skills/readme-studio/templates/typography/safe-files.mjs +0 -57
- package/plugin/skills/readme-studio/templates/typography/shape-text-to-svg.mjs +0 -63
- package/plugin/skills/visual-qa/references/capture-playbook.md +0 -126
- package/plugin/skills/visual-qa/references/complete-contract.md +0 -677
- package/plugin/skills/visual-qa/schemas/design-contract-v1alpha1.schema.json +0 -305
- package/plugin/skills/visual-qa/schemas/design-contract-v1beta1.schema.json +0 -291
- package/plugin/skills/visual-qa/schemas/design-contract-v1beta2.schema.json +0 -311
- package/plugin/skills/visual-qa/schemas/evidence-manifest-v1alpha1.schema.json +0 -235
- package/plugin/skills/visual-qa/schemas/evidence-manifest-v1beta1.schema.json +0 -208
- package/plugin/skills/visual-qa/schemas/review-receipt-v1alpha1.schema.json +0 -66
- package/plugin/skills/visual-qa/scripts/ansi.ts +0 -17
- package/plugin/skills/visual-qa/scripts/cli.mjs +0 -101
- package/plugin/skills/visual-qa/scripts/cli.ts +0 -96
- package/plugin/skills/visual-qa/scripts/design-contract-shape.mjs +0 -448
- package/plugin/skills/visual-qa/scripts/east-asian-width.ts +0 -72
- package/plugin/skills/visual-qa/scripts/errors.mjs +0 -12
- package/plugin/skills/visual-qa/scripts/evidence-io.mjs +0 -184
- package/plugin/skills/visual-qa/scripts/evidence-semantic.mjs +0 -95
- package/plugin/skills/visual-qa/scripts/evidence-shape.mjs +0 -163
- package/plugin/skills/visual-qa/scripts/evidence.mjs +0 -421
- package/plugin/skills/visual-qa/scripts/image-diff.mjs +0 -89
- package/plugin/skills/visual-qa/scripts/image-diff.ts +0 -109
- package/plugin/skills/visual-qa/scripts/png-chunks.mjs +0 -107
- package/plugin/skills/visual-qa/scripts/png-crc.ts +0 -27
- package/plugin/skills/visual-qa/scripts/png-decode.mjs +0 -143
- package/plugin/skills/visual-qa/scripts/png-decode.ts +0 -206
- package/plugin/skills/visual-qa/scripts/png-synth.ts +0 -57
- package/plugin/skills/visual-qa/scripts/review-rules.mjs +0 -137
- package/plugin/skills/visual-qa/scripts/terminal-text.mjs +0 -117
- package/plugin/skills/visual-qa/scripts/tui-check.mjs +0 -74
- package/plugin/skills/visual-qa/scripts/tui-grid.ts +0 -88
- package/plugin/skills/visual-qa/scripts/types.ts +0 -54
|
@@ -1,1395 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Convert Markdown to DOCX with proper styling.
|
|
3
|
-
|
|
4
|
-
Usage:
|
|
5
|
-
python convert_md_to_docx.py input.md output.docx [--template template.docx]
|
|
6
|
-
python convert_md_to_docx.py input.md output.docx --publisher elsevier
|
|
7
|
-
|
|
8
|
-
Features:
|
|
9
|
-
- Headings (H1-H6 → Word heading styles)
|
|
10
|
-
- Paragraphs with bold/italic/code formatting
|
|
11
|
-
- Bullet and numbered lists
|
|
12
|
-
- Tables
|
|
13
|
-
- Code blocks (monospace font)
|
|
14
|
-
- Images (if local)
|
|
15
|
-
- Links (as hyperlinks)
|
|
16
|
-
- [NEW in M1] --publisher NAME loads templates/registry.yaml and applies
|
|
17
|
-
journal design discipline: title block from YAML frontmatter, curly
|
|
18
|
-
quotes, en/em dashes, nbsp before units, ellipsis, heading auto-numbering,
|
|
19
|
-
booktabs tables, banned-font/style stripping, CJK font pairing.
|
|
20
|
-
- --tonality NAME (or frontmatter `tonality:`) builds the document in one of
|
|
21
|
-
the six design directions of templates/tonalities/ (docx_design.py), with
|
|
22
|
-
the page components written as ::: directives; --density and --variance
|
|
23
|
-
move the pack's dials. Without a tonality or a publisher the plain profile
|
|
24
|
-
runs through the same builders with neutral tokens.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
from __future__ import annotations
|
|
28
|
-
import os as _os
|
|
29
|
-
import sys as _sys
|
|
30
|
-
|
|
31
|
-
_sys.dont_write_bytecode = True # the installed skill directory stays read-only
|
|
32
|
-
_sys.path.insert(0, _os.path.join(_os.path.dirname(_os.path.abspath(__file__)), "..", "..", "..", "lib"))
|
|
33
|
-
from office_runtime_bootstrap import ensure_runtime # noqa: E402
|
|
34
|
-
from office_data import DataError, resolve_text # noqa: E402
|
|
35
|
-
|
|
36
|
-
ensure_runtime(["docx", "markdown", "bs4", "yaml"])
|
|
37
|
-
|
|
38
|
-
import argparse
|
|
39
|
-
import copy
|
|
40
|
-
import re
|
|
41
|
-
import sys
|
|
42
|
-
from pathlib import Path
|
|
43
|
-
from typing import Any
|
|
44
|
-
|
|
45
|
-
try:
|
|
46
|
-
import markdown
|
|
47
|
-
from markdown.extensions.tables import TableExtension
|
|
48
|
-
from markdown.extensions.fenced_code import FencedCodeExtension
|
|
49
|
-
except ImportError:
|
|
50
|
-
print("Error: 'markdown' library not found. Install with: pip install markdown")
|
|
51
|
-
sys.exit(1)
|
|
52
|
-
|
|
53
|
-
try:
|
|
54
|
-
from docx import Document
|
|
55
|
-
from docx.shared import Pt, Inches, Cm, RGBColor
|
|
56
|
-
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
|
57
|
-
from docx.enum.style import WD_STYLE_TYPE
|
|
58
|
-
from docx.oxml.ns import qn
|
|
59
|
-
from docx.oxml import OxmlElement
|
|
60
|
-
from docx.text.paragraph import Paragraph
|
|
61
|
-
except ImportError:
|
|
62
|
-
print("Error: 'python-docx' library not found. Install with: pip install python-docx")
|
|
63
|
-
sys.exit(1)
|
|
64
|
-
|
|
65
|
-
try:
|
|
66
|
-
from bs4 import BeautifulSoup, NavigableString
|
|
67
|
-
except ImportError:
|
|
68
|
-
print("Error: 'beautifulsoup4' library not found. Install with: pip install beautifulsoup4")
|
|
69
|
-
sys.exit(1)
|
|
70
|
-
|
|
71
|
-
import docx_design # noqa: E402 (needs the runtime's python-docx and PyYAML)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
# ===========================================================================
|
|
75
|
-
# Legacy HTML→DOCX helpers (unchanged from pre-M1 — preserved byte-for-byte)
|
|
76
|
-
# ===========================================================================
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def create_hyperlink(paragraph, url: str, text: str):
|
|
80
|
-
"""Add a hyperlink to a paragraph."""
|
|
81
|
-
part = paragraph.part
|
|
82
|
-
r_id = part.relate_to(url, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", is_external=True)
|
|
83
|
-
|
|
84
|
-
hyperlink = OxmlElement('w:hyperlink')
|
|
85
|
-
hyperlink.set(qn('r:id'), r_id)
|
|
86
|
-
|
|
87
|
-
new_run = OxmlElement('w:r')
|
|
88
|
-
rPr = OxmlElement('w:rPr')
|
|
89
|
-
|
|
90
|
-
# Blue color and underline for hyperlink
|
|
91
|
-
color = OxmlElement('w:color')
|
|
92
|
-
color.set(qn('w:val'), '0000FF')
|
|
93
|
-
rPr.append(color)
|
|
94
|
-
|
|
95
|
-
underline = OxmlElement('w:u')
|
|
96
|
-
underline.set(qn('w:val'), 'single')
|
|
97
|
-
rPr.append(underline)
|
|
98
|
-
|
|
99
|
-
new_run.append(rPr)
|
|
100
|
-
|
|
101
|
-
text_elem = OxmlElement('w:t')
|
|
102
|
-
text_elem.text = text
|
|
103
|
-
new_run.append(text_elem)
|
|
104
|
-
|
|
105
|
-
hyperlink.append(new_run)
|
|
106
|
-
paragraph._p.append(hyperlink)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def process_inline_elements(paragraph, element, md_path: Path):
|
|
110
|
-
"""Process inline elements like bold, italic, code, links within a paragraph."""
|
|
111
|
-
if isinstance(element, NavigableString):
|
|
112
|
-
text = str(element)
|
|
113
|
-
if text.strip():
|
|
114
|
-
paragraph.add_run(text)
|
|
115
|
-
elif text:
|
|
116
|
-
paragraph.add_run(text)
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
if element.name == 'strong' or element.name == 'b':
|
|
120
|
-
run = paragraph.add_run(element.get_text())
|
|
121
|
-
run.bold = True
|
|
122
|
-
elif element.name == 'em' or element.name == 'i':
|
|
123
|
-
run = paragraph.add_run(element.get_text())
|
|
124
|
-
run.italic = True
|
|
125
|
-
elif element.name == 'code':
|
|
126
|
-
run = paragraph.add_run(element.get_text())
|
|
127
|
-
run.font.name = 'Courier New'
|
|
128
|
-
run.font.size = Pt(10)
|
|
129
|
-
elif element.name == 'a':
|
|
130
|
-
href = element.get('href', '')
|
|
131
|
-
text = element.get_text()
|
|
132
|
-
if href:
|
|
133
|
-
create_hyperlink(paragraph, href, text)
|
|
134
|
-
else:
|
|
135
|
-
paragraph.add_run(text)
|
|
136
|
-
elif element.name == 'img':
|
|
137
|
-
src = element.get('src', '')
|
|
138
|
-
if src and not src.startswith(('http://', 'https://', 'data:')):
|
|
139
|
-
img_path = (md_path.parent / src).resolve()
|
|
140
|
-
if img_path.exists():
|
|
141
|
-
try:
|
|
142
|
-
paragraph.add_run().add_picture(str(img_path), width=Inches(4))
|
|
143
|
-
except Exception:
|
|
144
|
-
paragraph.add_run(f"[Image: {src}]")
|
|
145
|
-
else:
|
|
146
|
-
paragraph.add_run(f"[Image not found: {src}]")
|
|
147
|
-
else:
|
|
148
|
-
paragraph.add_run(f"[Image: {src}]")
|
|
149
|
-
elif element.name == 'br':
|
|
150
|
-
paragraph.add_run('\n')
|
|
151
|
-
else:
|
|
152
|
-
# Recursively process children
|
|
153
|
-
for child in element.children:
|
|
154
|
-
process_inline_elements(paragraph, child, md_path)
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
def add_paragraph_with_formatting(doc: Document, element, md_path: Path, style: str = None):
|
|
158
|
-
"""Add a paragraph with inline formatting."""
|
|
159
|
-
para = doc.add_paragraph(style=style)
|
|
160
|
-
for child in element.children:
|
|
161
|
-
process_inline_elements(para, child, md_path)
|
|
162
|
-
return para
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
def process_list(doc: Document, element, md_path: Path, ordered: bool = False, level: int = 0):
|
|
166
|
-
"""Process ordered or unordered lists."""
|
|
167
|
-
for i, li in enumerate(element.find_all('li', recursive=False)):
|
|
168
|
-
# Create paragraph with list style
|
|
169
|
-
para = doc.add_paragraph(style='List Number' if ordered else 'List Bullet')
|
|
170
|
-
|
|
171
|
-
# Set indentation for nested lists
|
|
172
|
-
if level > 0:
|
|
173
|
-
para.paragraph_format.left_indent = Inches(0.5 * level)
|
|
174
|
-
|
|
175
|
-
# Process direct text content. Only the item's own edges are trimmed: the space after a bold lead
|
|
176
|
-
# ("**1,200개** 태그") belongs to the text.
|
|
177
|
-
children = list(li.children)
|
|
178
|
-
for ci, child in enumerate(children):
|
|
179
|
-
if isinstance(child, NavigableString):
|
|
180
|
-
text = str(child).replace("\n", " ")
|
|
181
|
-
if ci == 0 or getattr(children[ci - 1], "name", None) in ('ul', 'ol', 'p'):
|
|
182
|
-
text = text.lstrip()
|
|
183
|
-
if ci == len(children) - 1 or getattr(children[ci + 1], "name", None) in ('ul', 'ol', 'p'):
|
|
184
|
-
text = text.rstrip()
|
|
185
|
-
if text:
|
|
186
|
-
para.add_run(text)
|
|
187
|
-
elif child.name in ('ul', 'ol'):
|
|
188
|
-
# Nested list
|
|
189
|
-
process_list(doc, child, md_path, ordered=(child.name == 'ol'), level=level + 1)
|
|
190
|
-
elif child.name == 'p':
|
|
191
|
-
# Process paragraph content inline
|
|
192
|
-
for subchild in child.children:
|
|
193
|
-
process_inline_elements(para, subchild, md_path)
|
|
194
|
-
else:
|
|
195
|
-
process_inline_elements(para, child, md_path)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
def process_table(doc: Document, element, md_path: Path):
|
|
199
|
-
"""Process HTML table and create DOCX table."""
|
|
200
|
-
rows = element.find_all('tr')
|
|
201
|
-
if not rows:
|
|
202
|
-
return
|
|
203
|
-
|
|
204
|
-
# Count columns from first row
|
|
205
|
-
first_row = rows[0]
|
|
206
|
-
cols = len(first_row.find_all(['th', 'td']))
|
|
207
|
-
|
|
208
|
-
if cols == 0:
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
table = doc.add_table(rows=len(rows), cols=cols)
|
|
212
|
-
table.style = 'Table Grid'
|
|
213
|
-
|
|
214
|
-
for row_idx, tr in enumerate(rows):
|
|
215
|
-
cells = tr.find_all(['th', 'td'])
|
|
216
|
-
for col_idx, cell in enumerate(cells):
|
|
217
|
-
if col_idx < cols:
|
|
218
|
-
table_cell = table.rows[row_idx].cells[col_idx]
|
|
219
|
-
# Clear default paragraph
|
|
220
|
-
table_cell.text = ''
|
|
221
|
-
para = table_cell.paragraphs[0]
|
|
222
|
-
for child in cell.children:
|
|
223
|
-
process_inline_elements(para, child, md_path)
|
|
224
|
-
|
|
225
|
-
# Bold for header cells
|
|
226
|
-
if cell.name == 'th':
|
|
227
|
-
for run in para.runs:
|
|
228
|
-
run.bold = True
|
|
229
|
-
|
|
230
|
-
shape_table(doc, table, [[c.get_text(" ", strip=True) for c in tr.find_all(['th', 'td'])] for tr in rows])
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
# A cell reads as a number when, after signs and units, only digits remain.
|
|
234
|
-
NUMERIC_CELL = re.compile(r"^[+\-−±▲▼△▽]?\s*[\d.,]+\s*(?:%p?|배|x|pt|[가-힣]{1,3}|[A-Za-z]{1,3})?$")
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
def shape_table(doc, table, texts: list[list[str]]) -> None:
|
|
238
|
-
"""Give a table readable columns and keep it whole on the page.
|
|
239
|
-
|
|
240
|
-
Column widths follow the longest cell of each column (Hangul counted wider)
|
|
241
|
-
with a floor, so a short column never squeezes a long one into one word per
|
|
242
|
-
line. The header row repeats on a new page, a row never splits across pages,
|
|
243
|
-
and columns of numbers are right-aligned.
|
|
244
|
-
"""
|
|
245
|
-
if not texts or not texts[0]:
|
|
246
|
-
return
|
|
247
|
-
cols = len(table.columns)
|
|
248
|
-
section = doc.sections[-1]
|
|
249
|
-
usable = section.page_width - section.left_margin - section.right_margin
|
|
250
|
-
|
|
251
|
-
def width_of(text: str) -> float:
|
|
252
|
-
# Hangul runs a little over twice as wide as Latin; +3 covers the cell padding.
|
|
253
|
-
return sum(2.3 if "\uac00" <= ch <= "\ud7a3" else 1.0 for ch in text) + 3.0
|
|
254
|
-
|
|
255
|
-
want = []
|
|
256
|
-
for ci in range(cols):
|
|
257
|
-
column = [row[ci] for row in texts if ci < len(row)]
|
|
258
|
-
want.append(max([width_of(t) for t in column] + [4.0]))
|
|
259
|
-
# Each column first gets its natural width (about 0.085 in per Latin character at
|
|
260
|
-
# body size, capped at 45% of the line); columns that hit the cap share what is left.
|
|
261
|
-
unit = Inches(0.085)
|
|
262
|
-
cap = usable * 0.45
|
|
263
|
-
natural = [min(w * unit, cap) for w in want]
|
|
264
|
-
capped = [ci for ci in range(cols) if want[ci] * unit > cap]
|
|
265
|
-
spare = usable - sum(natural)
|
|
266
|
-
if spare > 0 and capped:
|
|
267
|
-
for ci in capped:
|
|
268
|
-
natural[ci] += spare / len(capped)
|
|
269
|
-
elif spare > 0:
|
|
270
|
-
natural = [w + spare / cols for w in natural]
|
|
271
|
-
scale = usable / sum(natural)
|
|
272
|
-
widths = [int(w * scale) for w in natural]
|
|
273
|
-
|
|
274
|
-
table.autofit = False
|
|
275
|
-
for ci, column in enumerate(table.columns):
|
|
276
|
-
column.width = widths[ci]
|
|
277
|
-
for ri, row in enumerate(table.rows):
|
|
278
|
-
tr_pr = row._tr.get_or_add_trPr()
|
|
279
|
-
# Schema order puts cantSplit before trHeight and tblHeader after it.
|
|
280
|
-
tr_pr.insert(0, OxmlElement("w:cantSplit"))
|
|
281
|
-
if ri == 0:
|
|
282
|
-
header = OxmlElement("w:tblHeader")
|
|
283
|
-
tr_pr.append(header)
|
|
284
|
-
for ci, cell in enumerate(row.cells):
|
|
285
|
-
if ci < cols:
|
|
286
|
-
cell.width = widths[ci]
|
|
287
|
-
for paragraph in cell.paragraphs:
|
|
288
|
-
# Body line spacing (1.6 in some profiles) makes every row a double row.
|
|
289
|
-
paragraph.paragraph_format.line_spacing = 1.15
|
|
290
|
-
paragraph.paragraph_format.space_after = Pt(0)
|
|
291
|
-
paragraph.paragraph_format.first_line_indent = Cm(0)
|
|
292
|
-
|
|
293
|
-
for ci in range(cols):
|
|
294
|
-
data = [row[ci] for row in texts[1:] if ci < len(row) and row[ci].strip()]
|
|
295
|
-
if data and all(NUMERIC_CELL.match(t.strip()) for t in data):
|
|
296
|
-
for row in table.rows:
|
|
297
|
-
for paragraph in row.cells[ci].paragraphs:
|
|
298
|
-
paragraph.alignment = WD_ALIGN_PARAGRAPH.RIGHT
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
def process_code_block(doc: Document, element):
|
|
302
|
-
"""Process code block with monospace formatting."""
|
|
303
|
-
code = element.find('code')
|
|
304
|
-
text = code.get_text() if code else element.get_text()
|
|
305
|
-
|
|
306
|
-
para = doc.add_paragraph()
|
|
307
|
-
run = para.add_run(text)
|
|
308
|
-
run.font.name = 'Courier New'
|
|
309
|
-
run.font.size = Pt(9)
|
|
310
|
-
|
|
311
|
-
# Light gray background (via shading)
|
|
312
|
-
shading = OxmlElement('w:shd')
|
|
313
|
-
shading.set(qn('w:fill'), 'F0F0F0')
|
|
314
|
-
para._p.get_or_add_pPr().append(shading)
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
def add_figure_caption(doc, element, para) -> None:
|
|
318
|
-
"""An image alone in its paragraph keeps its alt text as the caption under it
|
|
319
|
-
("Figure 1." / "그림 1." bold), and the image keeps with the caption."""
|
|
320
|
-
images = element.find_all('img')
|
|
321
|
-
alt = images[0].get('alt', '').strip() if len(images) == 1 else ''
|
|
322
|
-
if not alt or element.get_text(strip=True):
|
|
323
|
-
return
|
|
324
|
-
para.paragraph_format.keep_with_next = True
|
|
325
|
-
try:
|
|
326
|
-
caption = doc.add_paragraph(style='Caption')
|
|
327
|
-
except KeyError:
|
|
328
|
-
caption = doc.add_paragraph()
|
|
329
|
-
label = docx_design.FIGURE_LABEL.match(alt)
|
|
330
|
-
if label:
|
|
331
|
-
caption.add_run(label.group(1)).bold = True
|
|
332
|
-
caption.add_run(alt[len(label.group(1)):])
|
|
333
|
-
else:
|
|
334
|
-
caption.add_run(alt)
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
def html_to_docx(html: str, doc: Document, md_path: Path):
|
|
338
|
-
"""Convert HTML to DOCX elements."""
|
|
339
|
-
soup = BeautifulSoup(html, 'html.parser')
|
|
340
|
-
|
|
341
|
-
for element in soup.children:
|
|
342
|
-
if isinstance(element, NavigableString):
|
|
343
|
-
text = str(element).strip()
|
|
344
|
-
if text:
|
|
345
|
-
doc.add_paragraph(text)
|
|
346
|
-
continue
|
|
347
|
-
|
|
348
|
-
if element.name in ('h1', 'h2', 'h3', 'h4', 'h5', 'h6'):
|
|
349
|
-
level = int(element.name[1])
|
|
350
|
-
heading = doc.add_heading(level=level)
|
|
351
|
-
for child in element.children:
|
|
352
|
-
process_inline_elements(heading, child, md_path)
|
|
353
|
-
|
|
354
|
-
elif element.name == 'p':
|
|
355
|
-
para = add_paragraph_with_formatting(doc, element, md_path)
|
|
356
|
-
add_figure_caption(doc, element, para)
|
|
357
|
-
|
|
358
|
-
elif element.name == 'ul':
|
|
359
|
-
process_list(doc, element, md_path, ordered=False)
|
|
360
|
-
|
|
361
|
-
elif element.name == 'ol':
|
|
362
|
-
process_list(doc, element, md_path, ordered=True)
|
|
363
|
-
|
|
364
|
-
elif element.name == 'table':
|
|
365
|
-
process_table(doc, element, md_path)
|
|
366
|
-
|
|
367
|
-
elif element.name == 'pre':
|
|
368
|
-
process_code_block(doc, element)
|
|
369
|
-
|
|
370
|
-
elif element.name == 'blockquote':
|
|
371
|
-
para = doc.add_paragraph(style='Quote')
|
|
372
|
-
for child in element.children:
|
|
373
|
-
if child.name == 'p':
|
|
374
|
-
for subchild in child.children:
|
|
375
|
-
process_inline_elements(para, subchild, md_path)
|
|
376
|
-
else:
|
|
377
|
-
process_inline_elements(para, child, md_path)
|
|
378
|
-
|
|
379
|
-
elif element.name == 'hr':
|
|
380
|
-
# Add a horizontal line
|
|
381
|
-
para = doc.add_paragraph()
|
|
382
|
-
para.add_run('─' * 50)
|
|
383
|
-
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
384
|
-
|
|
385
|
-
elif element.name in ('div', 'section', 'article'):
|
|
386
|
-
# Recursively process container elements
|
|
387
|
-
html_to_docx(str(element), doc, md_path)
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
# ===========================================================================
|
|
391
|
-
# M1: Journal workflow — frontmatter, filters, design enforcement
|
|
392
|
-
# ===========================================================================
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
def _load_yaml():
|
|
396
|
-
try:
|
|
397
|
-
import yaml
|
|
398
|
-
return yaml
|
|
399
|
-
except ImportError:
|
|
400
|
-
print("Error: 'pyyaml' library required for --publisher. pip install pyyaml")
|
|
401
|
-
sys.exit(1)
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
def parse_frontmatter(md_text: str) -> tuple[dict, str]:
|
|
405
|
-
"""Extract leading YAML frontmatter. Returns (frontmatter_dict, body)."""
|
|
406
|
-
if not md_text.startswith("---"):
|
|
407
|
-
return {}, md_text
|
|
408
|
-
# Find closing fence
|
|
409
|
-
lines = md_text.splitlines(keepends=True)
|
|
410
|
-
if len(lines) < 2:
|
|
411
|
-
return {}, md_text
|
|
412
|
-
end_idx = None
|
|
413
|
-
for i in range(1, len(lines)):
|
|
414
|
-
if lines[i].rstrip() == "---":
|
|
415
|
-
end_idx = i
|
|
416
|
-
break
|
|
417
|
-
if end_idx is None:
|
|
418
|
-
return {}, md_text
|
|
419
|
-
yaml_src = "".join(lines[1:end_idx])
|
|
420
|
-
body = "".join(lines[end_idx + 1:])
|
|
421
|
-
yaml = _load_yaml()
|
|
422
|
-
try:
|
|
423
|
-
data = yaml.safe_load(yaml_src) or {}
|
|
424
|
-
except Exception as exc:
|
|
425
|
-
print(f"Warning: could not parse YAML frontmatter: {exc}", file=sys.stderr)
|
|
426
|
-
return {}, md_text
|
|
427
|
-
if not isinstance(data, dict):
|
|
428
|
-
return {}, md_text
|
|
429
|
-
return data, body
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
def load_publisher(registry_path: Path, name: str) -> dict:
|
|
433
|
-
yaml = _load_yaml()
|
|
434
|
-
if not registry_path.exists():
|
|
435
|
-
raise SystemExit(f"Error: registry not found: {registry_path}")
|
|
436
|
-
with registry_path.open("r", encoding="utf-8") as fh:
|
|
437
|
-
data = yaml.safe_load(fh) or {}
|
|
438
|
-
pubs = data.get("publishers") or {}
|
|
439
|
-
if name not in pubs:
|
|
440
|
-
raise SystemExit(
|
|
441
|
-
f"Error: publisher {name!r} not in registry "
|
|
442
|
-
f"(known: {', '.join(sorted(pubs)) or 'none'})"
|
|
443
|
-
)
|
|
444
|
-
return pubs[name]
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
# ---------------------------------------------------------------------------
|
|
448
|
-
# Code-preserving filter helpers
|
|
449
|
-
# ---------------------------------------------------------------------------
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
_FENCE_RE = re.compile(r"(^```.*?^```)", re.MULTILINE | re.DOTALL)
|
|
453
|
-
_INLINE_CODE_RE = re.compile(r"(`[^`\n]+`)")
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
def _split_code_preserving(text: str) -> list[tuple[str, bool]]:
|
|
457
|
-
"""Split text into (segment, is_code) tuples.
|
|
458
|
-
|
|
459
|
-
Fenced code blocks and inline backtick code are returned as is_code=True
|
|
460
|
-
and must never be touched by the micro-typography filters.
|
|
461
|
-
"""
|
|
462
|
-
# First split on fenced code blocks
|
|
463
|
-
out: list[tuple[str, bool]] = []
|
|
464
|
-
pos = 0
|
|
465
|
-
for m in _FENCE_RE.finditer(text):
|
|
466
|
-
if m.start() > pos:
|
|
467
|
-
out.append((text[pos:m.start()], False))
|
|
468
|
-
out.append((m.group(0), True))
|
|
469
|
-
pos = m.end()
|
|
470
|
-
if pos < len(text):
|
|
471
|
-
out.append((text[pos:], False))
|
|
472
|
-
# Then split non-code segments on inline backtick code
|
|
473
|
-
refined: list[tuple[str, bool]] = []
|
|
474
|
-
for seg, is_code in out:
|
|
475
|
-
if is_code:
|
|
476
|
-
refined.append((seg, True))
|
|
477
|
-
continue
|
|
478
|
-
last = 0
|
|
479
|
-
for m in _INLINE_CODE_RE.finditer(seg):
|
|
480
|
-
if m.start() > last:
|
|
481
|
-
refined.append((seg[last:m.start()], False))
|
|
482
|
-
refined.append((m.group(0), True))
|
|
483
|
-
last = m.end()
|
|
484
|
-
if last < len(seg):
|
|
485
|
-
refined.append((seg[last:], False))
|
|
486
|
-
return refined
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
def _apply_to_noncode(text: str, fn) -> str:
|
|
490
|
-
parts = _split_code_preserving(text)
|
|
491
|
-
out = []
|
|
492
|
-
for seg, is_code in parts:
|
|
493
|
-
out.append(seg if is_code else fn(seg))
|
|
494
|
-
return "".join(out)
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
# ---------------------------------------------------------------------------
|
|
498
|
-
# Pre-MD micro-typography filters
|
|
499
|
-
# ---------------------------------------------------------------------------
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
_NUMRANGE_RE = re.compile(r"(\d)-(\d)")
|
|
503
|
-
_PAREN_DASH_RE = re.compile(r"(\w) - (\w)")
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
def fix_dashes(text: str, rules: dict | None = None) -> str:
|
|
507
|
-
"""Numeric ranges → en-dash; parenthetical 'word - word' → em-dash.
|
|
508
|
-
|
|
509
|
-
rules is the design.micro_typography.dashes block (currently informational;
|
|
510
|
-
M1 hardcodes en-dash for numeric range and em-dash for parenthetical).
|
|
511
|
-
"""
|
|
512
|
-
def _fn(seg: str) -> str:
|
|
513
|
-
seg = _NUMRANGE_RE.sub(lambda m: f"{m.group(1)}\u2013{m.group(2)}", seg)
|
|
514
|
-
seg = _PAREN_DASH_RE.sub(lambda m: f"{m.group(1)} \u2014 {m.group(2)}", seg)
|
|
515
|
-
return seg
|
|
516
|
-
return _apply_to_noncode(text, _fn)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
def fix_quotes(text: str) -> str:
|
|
520
|
-
"""ASCII "..." → "..."; '...' → '...' via left/right state machine."""
|
|
521
|
-
def _fn(seg: str) -> str:
|
|
522
|
-
out_chars = []
|
|
523
|
-
open_dq = True
|
|
524
|
-
open_sq = True
|
|
525
|
-
for ch in seg:
|
|
526
|
-
if ch == '"':
|
|
527
|
-
out_chars.append("\u201C" if open_dq else "\u201D")
|
|
528
|
-
open_dq = not open_dq
|
|
529
|
-
elif ch == "'":
|
|
530
|
-
# Keep apostrophe if surrounded by letters (e.g. "don't")
|
|
531
|
-
prev = out_chars[-1] if out_chars else ""
|
|
532
|
-
if prev.isalpha():
|
|
533
|
-
out_chars.append("\u2019")
|
|
534
|
-
else:
|
|
535
|
-
out_chars.append("\u2018" if open_sq else "\u2019")
|
|
536
|
-
open_sq = not open_sq
|
|
537
|
-
else:
|
|
538
|
-
out_chars.append(ch)
|
|
539
|
-
return "".join(out_chars)
|
|
540
|
-
return _apply_to_noncode(text, _fn)
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
_UNIT_GROUP = (
|
|
544
|
-
r"mg|g|kg|mL|L|\u03BCL|uL|nm|\u03BCm|um|mm|cm|m|km|K|\u00B0C|%|min|h|s|ms"
|
|
545
|
-
)
|
|
546
|
-
_UNIT_RE = re.compile(rf"(\d)(\s+)({_UNIT_GROUP})(?=\b|\W|$)")
|
|
547
|
-
_FIG_RE = re.compile(r"(Fig\.)\s(\d)")
|
|
548
|
-
_TABLE_RE = re.compile(r"(Table)\s(\d)")
|
|
549
|
-
_EQ_RE = re.compile(r"(Eq\.)\s(\d)")
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
def fix_unit_spacing(text: str) -> str:
|
|
553
|
-
"""Insert U+00A0 between number and SI unit, and after Fig./Table/Eq."""
|
|
554
|
-
def _fn(seg: str) -> str:
|
|
555
|
-
seg = _UNIT_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(3)}", seg)
|
|
556
|
-
seg = _FIG_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(2)}", seg)
|
|
557
|
-
seg = _TABLE_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(2)}", seg)
|
|
558
|
-
seg = _EQ_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(2)}", seg)
|
|
559
|
-
return seg
|
|
560
|
-
return _apply_to_noncode(text, _fn)
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
def fix_ellipsis(text: str) -> str:
|
|
564
|
-
def _fn(seg: str) -> str:
|
|
565
|
-
return seg.replace("...", "\u2026")
|
|
566
|
-
return _apply_to_noncode(text, _fn)
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
def normalize_double_spaces(text: str) -> str:
|
|
570
|
-
def _fn(seg: str) -> str:
|
|
571
|
-
# Preserve leading indentation; collapse interior double spaces
|
|
572
|
-
lines = seg.split("\n")
|
|
573
|
-
cleaned = []
|
|
574
|
-
for line in lines:
|
|
575
|
-
stripped_left = line.lstrip(" ")
|
|
576
|
-
lead = line[: len(line) - len(stripped_left)]
|
|
577
|
-
cleaned.append(lead + re.sub(r" {2,}", " ", stripped_left))
|
|
578
|
-
return "\n".join(cleaned)
|
|
579
|
-
return _apply_to_noncode(text, _fn)
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
# ---------------------------------------------------------------------------
|
|
583
|
-
# Post-HTML (doc object) filters
|
|
584
|
-
# ---------------------------------------------------------------------------
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
def apply_heading_numbering(doc, design: dict) -> None:
|
|
588
|
-
def to_roman(value: int) -> str:
|
|
589
|
-
numerals = [
|
|
590
|
-
(1000, "M"), (900, "CM"), (500, "D"), (400, "CD"),
|
|
591
|
-
(100, "C"), (90, "XC"), (50, "L"), (40, "XL"),
|
|
592
|
-
(10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I"),
|
|
593
|
-
]
|
|
594
|
-
out: list[str] = []
|
|
595
|
-
remaining = value
|
|
596
|
-
for arabic, roman in numerals:
|
|
597
|
-
while remaining >= arabic:
|
|
598
|
-
out.append(roman)
|
|
599
|
-
remaining -= arabic
|
|
600
|
-
return "".join(out)
|
|
601
|
-
|
|
602
|
-
def prefix_for(level: int, counters: list[int]) -> str | None:
|
|
603
|
-
key = f"h{level}"
|
|
604
|
-
cfg = (design.get("heading_hierarchy") or {}).get(key) or {}
|
|
605
|
-
numbering = cfg.get("numbering")
|
|
606
|
-
if numbering is None:
|
|
607
|
-
return None
|
|
608
|
-
numbering = str(numbering).strip()
|
|
609
|
-
if level == 1 and numbering.upper() == "I.":
|
|
610
|
-
return f"{to_roman(counters[0])}. "
|
|
611
|
-
if level == 1:
|
|
612
|
-
return f"{counters[0]}. "
|
|
613
|
-
if level == 2:
|
|
614
|
-
return f"{counters[0]}.{counters[1]}. "
|
|
615
|
-
if level == 3:
|
|
616
|
-
return f"{counters[0]}.{counters[1]}.{counters[2]}. "
|
|
617
|
-
return None
|
|
618
|
-
|
|
619
|
-
counters = [0, 0, 0]
|
|
620
|
-
for para in doc.paragraphs:
|
|
621
|
-
style_name = para.style.name if para.style else ""
|
|
622
|
-
level = 0
|
|
623
|
-
if style_name == "Heading 1":
|
|
624
|
-
level = 1
|
|
625
|
-
counters[0] += 1
|
|
626
|
-
counters[1] = 0
|
|
627
|
-
counters[2] = 0
|
|
628
|
-
elif style_name == "Heading 2":
|
|
629
|
-
level = 2
|
|
630
|
-
counters[1] += 1
|
|
631
|
-
counters[2] = 0
|
|
632
|
-
elif style_name == "Heading 3":
|
|
633
|
-
level = 3
|
|
634
|
-
counters[2] += 1
|
|
635
|
-
else:
|
|
636
|
-
continue
|
|
637
|
-
prefix = prefix_for(level, counters)
|
|
638
|
-
if prefix is None:
|
|
639
|
-
continue
|
|
640
|
-
current = para.text or ""
|
|
641
|
-
# Skip if already numbered (e.g. "1 Introduction" from the source)
|
|
642
|
-
if re.match(r"^(?:\d+(?:\.\d+)*\.?|[IVXLCDM]+\.?)\s", current):
|
|
643
|
-
continue
|
|
644
|
-
if para.runs:
|
|
645
|
-
para.runs[0].text = prefix + para.runs[0].text
|
|
646
|
-
else:
|
|
647
|
-
para.add_run(prefix)
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
def _set_cell_borders_nil(tcPr):
|
|
651
|
-
tcBorders = tcPr.find(qn("w:tcBorders"))
|
|
652
|
-
if tcBorders is None:
|
|
653
|
-
tcBorders = OxmlElement("w:tcBorders")
|
|
654
|
-
tcPr.append(tcBorders)
|
|
655
|
-
for side in ("top", "left", "bottom", "right", "insideH", "insideV"):
|
|
656
|
-
el = tcBorders.find(qn(f"w:{side}"))
|
|
657
|
-
if el is None:
|
|
658
|
-
el = OxmlElement(f"w:{side}")
|
|
659
|
-
tcBorders.append(el)
|
|
660
|
-
el.set(qn("w:val"), "nil")
|
|
661
|
-
el.set(qn("w:sz"), "0")
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
def apply_table_style(doc, design: dict) -> None:
|
|
665
|
-
"""Override python-docx 'Table Grid' with booktabs: only horizontal rules.
|
|
666
|
-
|
|
667
|
-
Rules: top rule (table top), header-bottom rule, bottom rule (table bottom).
|
|
668
|
-
All vertical rules (left/right/insideV) set to nil.
|
|
669
|
-
"""
|
|
670
|
-
for table in doc.tables:
|
|
671
|
-
table.style = None # detach Table Grid
|
|
672
|
-
tbl = table._tbl
|
|
673
|
-
tblPr = tbl.find(qn("w:tblPr"))
|
|
674
|
-
if tblPr is None:
|
|
675
|
-
tblPr = OxmlElement("w:tblPr")
|
|
676
|
-
tbl.insert(0, tblPr)
|
|
677
|
-
# Remove any existing tblBorders and add our booktabs set
|
|
678
|
-
existing = tblPr.find(qn("w:tblBorders"))
|
|
679
|
-
if existing is not None:
|
|
680
|
-
tblPr.remove(existing)
|
|
681
|
-
tblBorders = OxmlElement("w:tblBorders")
|
|
682
|
-
|
|
683
|
-
def _add_border(name: str, val: str, sz: str):
|
|
684
|
-
el = OxmlElement(f"w:{name}")
|
|
685
|
-
el.set(qn("w:val"), val)
|
|
686
|
-
el.set(qn("w:sz"), sz)
|
|
687
|
-
el.set(qn("w:space"), "0")
|
|
688
|
-
el.set(qn("w:color"), "000000")
|
|
689
|
-
tblBorders.append(el)
|
|
690
|
-
|
|
691
|
-
_add_border("top", "single", "12") # ~1.5pt
|
|
692
|
-
_add_border("bottom", "single", "12") # ~1.5pt
|
|
693
|
-
_add_border("left", "nil", "0")
|
|
694
|
-
_add_border("right", "nil", "0")
|
|
695
|
-
_add_border("insideH", "single", "6") # ~0.75pt (header-bottom)
|
|
696
|
-
_add_border("insideV", "nil", "0") # explicit no verticals
|
|
697
|
-
tblPr.append(tblBorders)
|
|
698
|
-
|
|
699
|
-
# Bold header row + add bottom border only to header cells so the
|
|
700
|
-
# thicker rule sits under the header (and horizontal rules between
|
|
701
|
-
# body rows are suppressed)
|
|
702
|
-
if table.rows:
|
|
703
|
-
header_row = table.rows[0]
|
|
704
|
-
for cell in header_row.cells:
|
|
705
|
-
for p in cell.paragraphs:
|
|
706
|
-
for r in p.runs:
|
|
707
|
-
r.bold = True
|
|
708
|
-
# Remove insideH to prevent inner body rules; header-bottom comes
|
|
709
|
-
# from a per-cell bottom border on the first row.
|
|
710
|
-
insideH = tblBorders.find(qn("w:insideH"))
|
|
711
|
-
if insideH is not None:
|
|
712
|
-
insideH.set(qn("w:val"), "nil")
|
|
713
|
-
for cell in header_row.cells:
|
|
714
|
-
tcPr = cell._tc.get_or_add_tcPr()
|
|
715
|
-
tcBorders = tcPr.find(qn("w:tcBorders"))
|
|
716
|
-
if tcBorders is None:
|
|
717
|
-
tcBorders = OxmlElement("w:tcBorders")
|
|
718
|
-
tcPr.append(tcBorders)
|
|
719
|
-
existing_bottom = tcBorders.find(qn("w:bottom"))
|
|
720
|
-
if existing_bottom is None:
|
|
721
|
-
existing_bottom = OxmlElement("w:bottom")
|
|
722
|
-
tcBorders.append(existing_bottom)
|
|
723
|
-
existing_bottom.set(qn("w:val"), "single")
|
|
724
|
-
existing_bottom.set(qn("w:sz"), "6")
|
|
725
|
-
existing_bottom.set(qn("w:space"), "0")
|
|
726
|
-
existing_bottom.set(qn("w:color"), "000000")
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
def keep_tables_with_captions(doc) -> None:
|
|
730
|
-
"""A table caption keeps with its table, and a table that fits one page keeps its rows together
|
|
731
|
-
(every row but the last keeps with the next). Pagination only: text, styles and rules are unchanged."""
|
|
732
|
-
section = doc.sections[-1]
|
|
733
|
-
frame_h = (section.page_height - section.top_margin - section.bottom_margin) / 12700
|
|
734
|
-
for table in doc.tables:
|
|
735
|
-
prev = table._tbl.getprevious()
|
|
736
|
-
if prev is not None and prev.tag == qn("w:p") and docx_design.TABLE_CAPTION.match("".join(t.text or "" for t in prev.iter(qn("w:t"))).strip()):
|
|
737
|
-
Paragraph(prev, table._parent).paragraph_format.keep_with_next = True
|
|
738
|
-
widths = [c.width / 12700 if c.width else 100 for c in table.rows[0].cells]
|
|
739
|
-
est = sum(6 + 11 * 1.3 * max(docx_design._est_lines(c.text, (widths[i] if i < len(widths) else 100) - 12, 11) for i, c in enumerate(row.cells)) for row in table.rows)
|
|
740
|
-
if est <= 0.9 * frame_h:
|
|
741
|
-
for row in table.rows[:-1]:
|
|
742
|
-
for cell in row.cells:
|
|
743
|
-
cell.paragraphs[0].paragraph_format.keep_with_next = True
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
def publisher_spacing(doc) -> None:
|
|
747
|
-
"""Text never touches a table or a caption (spec-v2 Amendments 7, R10): the paragraph after a table stands three
|
|
748
|
-
quarters of a body line clear (docx-spec Amendments 6; 8 pt read as half a line), a table caption after text
|
|
749
|
-
8 pt, and a figure caption keeps 8 pt under it. A paragraph after a list stands 6 pt clear of its last item."""
|
|
750
|
-
body = doc.element.body
|
|
751
|
-
normal = doc.styles["Normal"]
|
|
752
|
-
size = normal.font.size.pt if normal.font.size else 11
|
|
753
|
-
multiple = normal.paragraph_format.line_spacing if isinstance(normal.paragraph_format.line_spacing, float) else 1.15
|
|
754
|
-
clear = Pt(max(8, round(size * multiple * 1.2 * 0.75)))
|
|
755
|
-
for el in body.iterchildren(qn("w:tbl")):
|
|
756
|
-
nxt = el.getnext()
|
|
757
|
-
if nxt is not None and nxt.tag == qn("w:p") and "".join(t.text or "" for t in nxt.iter(qn("w:t"))).strip():
|
|
758
|
-
para = Paragraph(nxt, doc._body)
|
|
759
|
-
# A heading keeps its own (larger) space above.
|
|
760
|
-
own = para.style.paragraph_format.space_before if para.style is not None else None
|
|
761
|
-
fmt = para.paragraph_format
|
|
762
|
-
if not (own and own >= clear) and (not fmt.space_before or fmt.space_before < clear):
|
|
763
|
-
fmt.space_before = clear
|
|
764
|
-
prev = el.getprevious()
|
|
765
|
-
if prev is not None and prev.tag == qn("w:p") and docx_design.TABLE_CAPTION.match("".join(t.text or "" for t in prev.iter(qn("w:t"))).strip()):
|
|
766
|
-
fmt = Paragraph(prev, doc._body).paragraph_format
|
|
767
|
-
if not fmt.space_before or fmt.space_before < Pt(8):
|
|
768
|
-
fmt.space_before = Pt(8)
|
|
769
|
-
docx_design.space_after_lists(doc)
|
|
770
|
-
for p in doc.paragraphs:
|
|
771
|
-
prev = p._p.getprevious()
|
|
772
|
-
under_picture = prev is not None and prev.find(f".//{qn('w:drawing')}") is not None
|
|
773
|
-
if docx_design.FIGURE_LABEL.match(p.text.strip()) and (under_picture or (p.style is not None and p.style.name == "Caption")):
|
|
774
|
-
if not p.paragraph_format.space_after or p.paragraph_format.space_after < Pt(8):
|
|
775
|
-
p.paragraph_format.space_after = Pt(8)
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
def plain_table_cells(doc) -> None:
|
|
779
|
-
"""Table cells neither hyphenate nor justify: the body may (the profile's hyphenation), but a narrow cell
|
|
780
|
-
broke "Pro-posed" and a justified header spread "Conversion at"."""
|
|
781
|
-
for table in doc.tables:
|
|
782
|
-
for row in table.rows:
|
|
783
|
-
for cell in row.cells:
|
|
784
|
-
for paragraph in cell.paragraphs:
|
|
785
|
-
p_pr = paragraph._p.get_or_add_pPr()
|
|
786
|
-
if p_pr.find(qn("w:suppressAutoHyphens")) is None:
|
|
787
|
-
p_pr.insert_element_before(OxmlElement("w:suppressAutoHyphens"), *SUPPRESS_AFTER)
|
|
788
|
-
if paragraph.alignment in (None, WD_ALIGN_PARAGRAPH.JUSTIFY):
|
|
789
|
-
paragraph.alignment = WD_ALIGN_PARAGRAPH.LEFT
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
SUPPRESS_AFTER = ("w:kinsoku", "w:wordWrap", "w:overflowPunct", "w:topLinePunct", "w:autoSpaceDE", "w:autoSpaceDN", "w:bidi",
|
|
793
|
-
"w:adjustRightInd", "w:snapToGrid", "w:spacing", "w:ind", "w:contextualSpacing", "w:mirrorIndents",
|
|
794
|
-
"w:suppressOverlap", "w:jc", "w:textDirection", "w:textAlignment", "w:textboxTightWrap",
|
|
795
|
-
"w:outlineLvl", "w:divId", "w:cnfStyle", "w:rPr", "w:sectPr", "w:pPrChange")
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
def page_numbers(doc, design: dict) -> None:
|
|
799
|
-
"""The profile's page numbering (registry design.header_footer): a centred PAGE field in the footer at the
|
|
800
|
-
footer size, and none on the first page when the profile says so (its header keeps the notice tag)."""
|
|
801
|
-
hf = design.get("header_footer") or {}
|
|
802
|
-
if hf.get("page_numbering") != "bottom_center":
|
|
803
|
-
return
|
|
804
|
-
size = Pt(float(hf.get("footer_font_size_pt") or 9))
|
|
805
|
-
for index, section in enumerate(doc.sections):
|
|
806
|
-
if index and section.footer.is_linked_to_previous:
|
|
807
|
-
continue
|
|
808
|
-
if not hf.get("page_numbering_first_page", True) and not section.different_first_page_header_footer:
|
|
809
|
-
section.different_first_page_header_footer = True
|
|
810
|
-
first = section.first_page_header
|
|
811
|
-
for paragraph in section.header.paragraphs:
|
|
812
|
-
first._element.append(copy.deepcopy(paragraph._p))
|
|
813
|
-
first._element.remove(first.paragraphs[0]._p)
|
|
814
|
-
footer = section.footer
|
|
815
|
-
paragraph = footer.paragraphs[0]
|
|
816
|
-
paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
817
|
-
run = paragraph.add_run()
|
|
818
|
-
run.font.size = size
|
|
819
|
-
for kind, text in (("begin", None), (None, " PAGE "), ("separate", None), (None, "1"), ("end", None)):
|
|
820
|
-
if kind:
|
|
821
|
-
char = OxmlElement("w:fldChar")
|
|
822
|
-
char.set(qn("w:fldCharType"), kind)
|
|
823
|
-
run._r.append(char)
|
|
824
|
-
elif text == " PAGE ":
|
|
825
|
-
instr = OxmlElement("w:instrText")
|
|
826
|
-
instr.set(qn("xml:space"), "preserve")
|
|
827
|
-
instr.text = text
|
|
828
|
-
run._r.append(instr)
|
|
829
|
-
else:
|
|
830
|
-
t = OxmlElement("w:t")
|
|
831
|
-
t.text = text
|
|
832
|
-
run._r.append(t)
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
def strip_banned(doc, design: dict) -> None:
|
|
836
|
-
"""Remove any banned font/style from runs and paragraphs."""
|
|
837
|
-
banned = design.get("banned") or {}
|
|
838
|
-
banned_fonts = set(banned.get("fonts") or [])
|
|
839
|
-
banned_styles = set(banned.get("styles") or [])
|
|
840
|
-
body_font = None
|
|
841
|
-
# body font is enforced on Normal style already, but we override raw runs too
|
|
842
|
-
for para in doc.paragraphs:
|
|
843
|
-
if para.style and para.style.name in banned_styles:
|
|
844
|
-
try:
|
|
845
|
-
para.style = doc.styles["Normal"]
|
|
846
|
-
except KeyError:
|
|
847
|
-
pass
|
|
848
|
-
for run in para.runs:
|
|
849
|
-
if run.font.name and run.font.name in banned_fonts:
|
|
850
|
-
run.font.name = None # inherit from style
|
|
851
|
-
# Also walk table cells
|
|
852
|
-
for table in doc.tables:
|
|
853
|
-
for row in table.rows:
|
|
854
|
-
for cell in row.cells:
|
|
855
|
-
for para in cell.paragraphs:
|
|
856
|
-
if para.style and para.style.name in banned_styles:
|
|
857
|
-
try:
|
|
858
|
-
para.style = doc.styles["Normal"]
|
|
859
|
-
except KeyError:
|
|
860
|
-
pass
|
|
861
|
-
for run in para.runs:
|
|
862
|
-
if run.font.name and run.font.name in banned_fonts:
|
|
863
|
-
run.font.name = None
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
def _set_run_fonts(run, latin: str, cjk: str | None) -> None:
|
|
867
|
-
rpr = run._element.get_or_add_rPr()
|
|
868
|
-
rfonts = rpr.find(qn("w:rFonts"))
|
|
869
|
-
if rfonts is None:
|
|
870
|
-
rfonts = OxmlElement("w:rFonts")
|
|
871
|
-
rpr.append(rfonts)
|
|
872
|
-
rfonts.set(qn("w:ascii"), latin)
|
|
873
|
-
rfonts.set(qn("w:hAnsi"), latin)
|
|
874
|
-
rfonts.set(qn("w:cs"), latin)
|
|
875
|
-
if cjk:
|
|
876
|
-
rfonts.set(qn("w:eastAsia"), cjk)
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
THEME_PAIRS = (("asciiTheme", "ascii"), ("hAnsiTheme", "hAnsi"), ("eastAsiaTheme", "eastAsia"), ("cstheme", "cs"))
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
def drop_shadowed_theme_fonts(doc) -> None:
|
|
883
|
-
"""A style that names its face keeps no theme font beside it: Word and LibreOffice both let the theme
|
|
884
|
-
attribute win, so the profile's heading face (Times New Roman, Arial, Pretendard) rendered as the
|
|
885
|
-
theme's Calibri. Styles only; the document body is untouched."""
|
|
886
|
-
for rfonts in doc.styles.element.iter(qn("w:rFonts")):
|
|
887
|
-
for theme, named in THEME_PAIRS:
|
|
888
|
-
if rfonts.get(qn(f"w:{named}")) and rfonts.get(qn(f"w:{theme}")) is not None:
|
|
889
|
-
del rfonts.attrib[qn(f"w:{theme}")]
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
def apply_cjk_font_pairing(doc, font_cfg: dict) -> None:
|
|
893
|
-
body = font_cfg.get("body") or {}
|
|
894
|
-
body_cjk = font_cfg.get("body_cjk") or {}
|
|
895
|
-
latin = body.get("family")
|
|
896
|
-
cjk = body_cjk.get("family")
|
|
897
|
-
if not latin:
|
|
898
|
-
return
|
|
899
|
-
|
|
900
|
-
def _walk(paragraphs):
|
|
901
|
-
for para in paragraphs:
|
|
902
|
-
for run in para.runs:
|
|
903
|
-
# Only fix runs that already have a font set to something
|
|
904
|
-
# other than the registry-banned default; leaving run.font.name
|
|
905
|
-
# as None lets the style do its job. We still force eastAsia.
|
|
906
|
-
current_name = run.font.name
|
|
907
|
-
if current_name and current_name != "Courier New":
|
|
908
|
-
_set_run_fonts(run, latin, cjk)
|
|
909
|
-
elif not current_name:
|
|
910
|
-
# set only eastAsia pair to avoid losing style inheritance
|
|
911
|
-
rpr = run._element.get_or_add_rPr()
|
|
912
|
-
rfonts = rpr.find(qn("w:rFonts"))
|
|
913
|
-
if rfonts is None:
|
|
914
|
-
rfonts = OxmlElement("w:rFonts")
|
|
915
|
-
rpr.append(rfonts)
|
|
916
|
-
if cjk:
|
|
917
|
-
rfonts.set(qn("w:eastAsia"), cjk)
|
|
918
|
-
|
|
919
|
-
_walk(doc.paragraphs)
|
|
920
|
-
for table in doc.tables:
|
|
921
|
-
for row in table.rows:
|
|
922
|
-
for cell in row.cells:
|
|
923
|
-
_walk(cell.paragraphs)
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
# ---------------------------------------------------------------------------
|
|
927
|
-
# Title block builder
|
|
928
|
-
# ---------------------------------------------------------------------------
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
def _insert_paragraph_before(doc, before_p, style=None):
|
|
932
|
-
"""Insert a new paragraph before the given paragraph element."""
|
|
933
|
-
new_p = OxmlElement("w:p")
|
|
934
|
-
before_p._p.addprevious(new_p)
|
|
935
|
-
from docx.text.paragraph import Paragraph
|
|
936
|
-
para = Paragraph(new_p, before_p._parent)
|
|
937
|
-
if style is not None:
|
|
938
|
-
try:
|
|
939
|
-
para.style = doc.styles[style]
|
|
940
|
-
except KeyError:
|
|
941
|
-
pass
|
|
942
|
-
return para
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
def inject_title_block(doc, frontmatter: dict, design: dict) -> None:
|
|
946
|
-
"""Prepend title/authors/affiliations/abstract/keywords to the doc.
|
|
947
|
-
|
|
948
|
-
Builds the block at the top of the document body via the underlying
|
|
949
|
-
XML so it appears before any html_to_docx output. Called BEFORE
|
|
950
|
-
html_to_docx in M1's control flow so paragraphs just append normally.
|
|
951
|
-
"""
|
|
952
|
-
tb = design.get("title_block") or {}
|
|
953
|
-
title = frontmatter.get("title")
|
|
954
|
-
if not title:
|
|
955
|
-
return
|
|
956
|
-
|
|
957
|
-
def _p_center(size: int, bold=False, italic=False, space_after=4):
|
|
958
|
-
p = doc.add_paragraph()
|
|
959
|
-
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
960
|
-
p.paragraph_format.first_line_indent = Cm(0)
|
|
961
|
-
p.paragraph_format.space_after = Pt(space_after)
|
|
962
|
-
return p
|
|
963
|
-
|
|
964
|
-
def _add_run(p, text: str, size: int, bold=False, italic=False, sup=False):
|
|
965
|
-
run = p.add_run(text)
|
|
966
|
-
run.font.size = Pt(size)
|
|
967
|
-
run.bold = bold
|
|
968
|
-
run.italic = italic
|
|
969
|
-
run.font.superscript = sup
|
|
970
|
-
return run
|
|
971
|
-
|
|
972
|
-
# Title
|
|
973
|
-
tp = _p_center(
|
|
974
|
-
tb.get("title", {}).get("size_pt", 18),
|
|
975
|
-
bold=True,
|
|
976
|
-
space_after=tb.get("title", {}).get("space_after_pt", 12),
|
|
977
|
-
)
|
|
978
|
-
_add_run(tp, str(title), tb.get("title", {}).get("size_pt", 18), bold=True)
|
|
979
|
-
|
|
980
|
-
# Report-style frontmatter: a subtitle and one author / organisation / date line
|
|
981
|
-
# when there is no journal author list.
|
|
982
|
-
if frontmatter.get("subtitle"):
|
|
983
|
-
sp = _p_center(13, space_after=6)
|
|
984
|
-
_add_run(sp, str(frontmatter["subtitle"]), 13)
|
|
985
|
-
if not frontmatter.get("authors"):
|
|
986
|
-
meta = [str(v) for v in (frontmatter.get("author"), frontmatter.get("organization"), frontmatter.get("date")) if v]
|
|
987
|
-
if meta:
|
|
988
|
-
mp = _p_center(10.5, space_after=14)
|
|
989
|
-
_add_run(mp, " · ".join(meta), 10.5)
|
|
990
|
-
|
|
991
|
-
# Authors
|
|
992
|
-
authors = frontmatter.get("authors") or []
|
|
993
|
-
if authors:
|
|
994
|
-
ap = _p_center(
|
|
995
|
-
tb.get("authors", {}).get("size_pt", 12),
|
|
996
|
-
space_after=tb.get("authors", {}).get("space_after_pt", 4),
|
|
997
|
-
)
|
|
998
|
-
sep = tb.get("author_separator", ", ")
|
|
999
|
-
corr_mark = tb.get("corresponding_marker", "*")
|
|
1000
|
-
size = tb.get("authors", {}).get("size_pt", 12)
|
|
1001
|
-
for i, author in enumerate(authors):
|
|
1002
|
-
if not isinstance(author, dict):
|
|
1003
|
-
continue
|
|
1004
|
-
if i > 0:
|
|
1005
|
-
_add_run(ap, sep, size)
|
|
1006
|
-
name = str(author.get("name", "Author"))
|
|
1007
|
-
_add_run(ap, name, size)
|
|
1008
|
-
aff = author.get("affiliation")
|
|
1009
|
-
if aff is not None:
|
|
1010
|
-
if isinstance(aff, list):
|
|
1011
|
-
aff_text = ",".join(str(a) for a in aff)
|
|
1012
|
-
else:
|
|
1013
|
-
aff_text = str(aff)
|
|
1014
|
-
_add_run(ap, aff_text, size, sup=True)
|
|
1015
|
-
if author.get("corresponding"):
|
|
1016
|
-
_add_run(ap, corr_mark, size, sup=True)
|
|
1017
|
-
|
|
1018
|
-
# Affiliations
|
|
1019
|
-
affs = frontmatter.get("affiliations")
|
|
1020
|
-
if isinstance(affs, dict):
|
|
1021
|
-
for key in sorted(affs.keys(), key=lambda k: str(k)):
|
|
1022
|
-
fp = _p_center(
|
|
1023
|
-
tb.get("affiliations", {}).get("size_pt", 10),
|
|
1024
|
-
italic=True,
|
|
1025
|
-
space_after=2,
|
|
1026
|
-
)
|
|
1027
|
-
_add_run(
|
|
1028
|
-
fp,
|
|
1029
|
-
f"{key} {affs[key]}",
|
|
1030
|
-
tb.get("affiliations", {}).get("size_pt", 10),
|
|
1031
|
-
italic=True,
|
|
1032
|
-
)
|
|
1033
|
-
|
|
1034
|
-
# Corresponding email (if present, small italic line)
|
|
1035
|
-
corr_email = frontmatter.get("corresponding_email")
|
|
1036
|
-
if corr_email:
|
|
1037
|
-
cp = _p_center(10, italic=True, space_after=8)
|
|
1038
|
-
_add_run(cp, f"* Corresponding author: {corr_email}", 10, italic=True)
|
|
1039
|
-
|
|
1040
|
-
# Abstract
|
|
1041
|
-
abstract = frontmatter.get("abstract")
|
|
1042
|
-
if abstract:
|
|
1043
|
-
lp = doc.add_paragraph()
|
|
1044
|
-
lp.paragraph_format.first_line_indent = Cm(0)
|
|
1045
|
-
lp.paragraph_format.space_after = Pt(4)
|
|
1046
|
-
_add_run(
|
|
1047
|
-
lp,
|
|
1048
|
-
tb.get("abstract_label", "Abstract"),
|
|
1049
|
-
tb.get("abstract_font_size_pt", 10),
|
|
1050
|
-
bold=True,
|
|
1051
|
-
)
|
|
1052
|
-
body = doc.add_paragraph()
|
|
1053
|
-
body.paragraph_format.first_line_indent = Cm(0)
|
|
1054
|
-
body.paragraph_format.space_after = Pt(6)
|
|
1055
|
-
_add_run(
|
|
1056
|
-
body,
|
|
1057
|
-
str(abstract),
|
|
1058
|
-
tb.get("abstract_font_size_pt", 10),
|
|
1059
|
-
)
|
|
1060
|
-
|
|
1061
|
-
# Keywords
|
|
1062
|
-
keywords = frontmatter.get("keywords")
|
|
1063
|
-
if keywords:
|
|
1064
|
-
kp = doc.add_paragraph()
|
|
1065
|
-
kp.paragraph_format.first_line_indent = Cm(0)
|
|
1066
|
-
kp.paragraph_format.space_after = Pt(12)
|
|
1067
|
-
_add_run(
|
|
1068
|
-
kp,
|
|
1069
|
-
tb.get("keywords_label", "Keywords") + ": ",
|
|
1070
|
-
tb.get("abstract_font_size_pt", 10),
|
|
1071
|
-
bold=True,
|
|
1072
|
-
)
|
|
1073
|
-
if isinstance(keywords, list):
|
|
1074
|
-
sep = tb.get("keywords_separator", "; ")
|
|
1075
|
-
text = sep.join(str(k) for k in keywords)
|
|
1076
|
-
else:
|
|
1077
|
-
text = str(keywords)
|
|
1078
|
-
_add_run(kp, text, tb.get("abstract_font_size_pt", 10))
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
# ---------------------------------------------------------------------------
|
|
1082
|
-
# Locale detection
|
|
1083
|
-
# ---------------------------------------------------------------------------
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
_HANGUL_RE = re.compile(r"[\uac00-\ud7a3]")
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
def detect_locale(text: str) -> str:
|
|
1090
|
-
total = len(text) or 1
|
|
1091
|
-
hangul_count = len(_HANGUL_RE.findall(text))
|
|
1092
|
-
ratio = hangul_count / total
|
|
1093
|
-
if ratio > 0.05:
|
|
1094
|
-
return "ko"
|
|
1095
|
-
if ratio > 0.01:
|
|
1096
|
-
return "mixed"
|
|
1097
|
-
return "en"
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
# ===========================================================================
|
|
1101
|
-
# Conversion entry point
|
|
1102
|
-
# ===========================================================================
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
NOTICE_INK, NOTICE_FILL = docx_design.NOTICE
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
def _shade(element, fill: str) -> None:
|
|
1109
|
-
shd = OxmlElement("w:shd")
|
|
1110
|
-
shd.set(qn("w:val"), "clear")
|
|
1111
|
-
shd.set(qn("w:color"), "auto")
|
|
1112
|
-
shd.set(qn("w:fill"), fill)
|
|
1113
|
-
element.append(shd)
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
def add_notice(doc, text: str) -> None:
|
|
1117
|
-
"""The frontmatter `notice:` (e.g. "예시 데이터: 수치는 가정입니다") as a tag in
|
|
1118
|
-
every page header, so an example document cannot be mistaken for a sourced one
|
|
1119
|
-
on any page it is printed from. A profile whose title page has its own, empty
|
|
1120
|
-
header (korean-generic) gets a tinted band under the title block instead."""
|
|
1121
|
-
if doc.sections[0].different_first_page_header_footer:
|
|
1122
|
-
band = doc.add_paragraph()
|
|
1123
|
-
band_run = band.add_run(str(text))
|
|
1124
|
-
band_run.bold = True
|
|
1125
|
-
band_run.font.size = Pt(10.5)
|
|
1126
|
-
band_run.font.color.rgb = RGBColor.from_string(NOTICE_INK)
|
|
1127
|
-
band.paragraph_format.space_before = Pt(4)
|
|
1128
|
-
band.paragraph_format.space_after = Pt(14)
|
|
1129
|
-
_shade(band._p.get_or_add_pPr(), NOTICE_FILL)
|
|
1130
|
-
for index, section in enumerate(doc.sections):
|
|
1131
|
-
if index and section.header.is_linked_to_previous:
|
|
1132
|
-
continue
|
|
1133
|
-
header = section.header
|
|
1134
|
-
tag = header.paragraphs[0] if header.paragraphs and not header.paragraphs[0].text.strip() else header.add_paragraph()
|
|
1135
|
-
tag_run = tag.add_run(f"\u00a0{text}\u00a0")
|
|
1136
|
-
tag_run.bold = True
|
|
1137
|
-
tag_run.font.size = Pt(9)
|
|
1138
|
-
tag_run.font.color.rgb = RGBColor.from_string(NOTICE_INK)
|
|
1139
|
-
_shade(tag_run._r.get_or_add_rPr(), NOTICE_FILL)
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
def read_source(md_path: Path) -> str:
|
|
1143
|
-
"""The Markdown source, with {{ … }} numbers filled from its `data:` files
|
|
1144
|
-
(lib/office_data.py computes derived values and runs the declared checks)."""
|
|
1145
|
-
text = md_path.read_text(encoding="utf-8")
|
|
1146
|
-
try:
|
|
1147
|
-
return resolve_text(text, md_path.parent)[0]
|
|
1148
|
-
except DataError as exc:
|
|
1149
|
-
raise SystemExit(f"Data error: {exc}") from exc
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
MD_EXTENSIONS = ['tables', 'fenced_code', 'nl2br', 'sane_lists']
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
def _md_renderer(md_path: Path):
|
|
1156
|
-
"""Markdown into a document or a component's cell, through the legacy HTML helpers."""
|
|
1157
|
-
def render(container, text: str) -> None:
|
|
1158
|
-
html_to_docx(markdown.Markdown(extensions=MD_EXTENSIONS).convert(text), container, md_path)
|
|
1159
|
-
return render
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
def _typography(design: dict, lang: str = "en"):
|
|
1163
|
-
"""The registry's micro-typography filters, for Markdown outside the directive fences; Korean text also
|
|
1164
|
-
writes ISO dates the Korean way (2026. 10. 1.)."""
|
|
1165
|
-
def apply(text: str) -> str:
|
|
1166
|
-
# Dates first: the dash filter would read 2026-06-30 as a number range.
|
|
1167
|
-
if lang != "en":
|
|
1168
|
-
text = docx_design.korean_dates(text)
|
|
1169
|
-
text = fix_dashes(text, design.get("micro_typography", {}).get("dashes"))
|
|
1170
|
-
text = fix_quotes(text)
|
|
1171
|
-
text = fix_unit_spacing(text)
|
|
1172
|
-
text = fix_ellipsis(text)
|
|
1173
|
-
return normalize_double_spaces(text)
|
|
1174
|
-
return apply
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
def convert_md_to_docx(
|
|
1178
|
-
md_path: Path,
|
|
1179
|
-
docx_path: Path,
|
|
1180
|
-
template_path: Path = None,
|
|
1181
|
-
publisher_name: str | None = None,
|
|
1182
|
-
registry_path: Path | None = None,
|
|
1183
|
-
locale: str = "auto",
|
|
1184
|
-
tonality: str | None = None,
|
|
1185
|
-
density: int | None = None,
|
|
1186
|
-
variance: int | None = None,
|
|
1187
|
-
):
|
|
1188
|
-
"""Convert Markdown file to DOCX.
|
|
1189
|
-
|
|
1190
|
-
With a tonality (argument or frontmatter `tonality:`), the document is built
|
|
1191
|
-
by docx_design in that design direction. Without a tonality or a publisher,
|
|
1192
|
-
the plain profile runs through the same builders with neutral tokens (A4,
|
|
1193
|
-
Pretendard, booktabs tables, notice in every header).
|
|
1194
|
-
|
|
1195
|
-
When publisher_name is set, apply the full journal pipeline: registry
|
|
1196
|
-
load, frontmatter parse, pre-MD filters, title-block injection, post-HTML
|
|
1197
|
-
heading numbering, booktabs tables, banned stripping, CJK font pairing.
|
|
1198
|
-
A publisher run writes the same document.xml as before the tonality
|
|
1199
|
-
engine unless the source holds figures (captions) or directives.
|
|
1200
|
-
"""
|
|
1201
|
-
if publisher_name is None:
|
|
1202
|
-
md_text = read_source(md_path)
|
|
1203
|
-
front, body = parse_frontmatter(md_text) if md_text.startswith("---") else ({}, md_text)
|
|
1204
|
-
name = tonality or front.get("tonality")
|
|
1205
|
-
lang = "en" if (detect_locale(body) if locale == "auto" else locale) == "en" else "ko"
|
|
1206
|
-
dials = {k: v for k, v in (("density", density if density is not None else front.get("density")),
|
|
1207
|
-
("variance", variance if variance is not None else front.get("variance"))) if v is not None}
|
|
1208
|
-
try:
|
|
1209
|
-
if name:
|
|
1210
|
-
T = docx_design.load_tonality(name, locale=lang, **{k: int(v) for k, v in dials.items()})
|
|
1211
|
-
filters = _typography(T.design, lang)
|
|
1212
|
-
else:
|
|
1213
|
-
T, filters = docx_design.neutral_tonality(lang), None
|
|
1214
|
-
doc = Document(str(template_path)) if template_path and template_path.exists() else Document()
|
|
1215
|
-
docx_design.build(doc, front, body, T, _md_renderer(md_path), lang, filters)
|
|
1216
|
-
except docx_design.DesignError as exc:
|
|
1217
|
-
raise SystemExit(f"Error: {exc}") from exc
|
|
1218
|
-
doc.save(str(docx_path))
|
|
1219
|
-
label = f"tonality={T.name}, density={T.density}, variance={T.variance}" if not T.neutral else "plain profile"
|
|
1220
|
-
print(f"Successfully converted {md_path} to {docx_path} [{label}, locale={lang}]")
|
|
1221
|
-
return
|
|
1222
|
-
|
|
1223
|
-
# --- Journal workflow ---
|
|
1224
|
-
script_dir = Path(__file__).resolve().parent
|
|
1225
|
-
registry_path = registry_path or (script_dir.parent / "templates" / "registry.yaml")
|
|
1226
|
-
publisher = load_publisher(Path(registry_path), publisher_name)
|
|
1227
|
-
design = publisher["design"]
|
|
1228
|
-
docx_font = publisher["docx"]["font"]
|
|
1229
|
-
|
|
1230
|
-
md_text = read_source(md_path)
|
|
1231
|
-
frontmatter, body = parse_frontmatter(md_text)
|
|
1232
|
-
if frontmatter.get("tonality"):
|
|
1233
|
-
raise SystemExit(f"Error: frontmatter tonality: {frontmatter['tonality']} and --publisher {publisher_name} are mutually exclusive")
|
|
1234
|
-
|
|
1235
|
-
# Locale detection (informational in M1; Korean rules land in M6)
|
|
1236
|
-
detected_locale = detect_locale(body) if locale == "auto" else locale
|
|
1237
|
-
|
|
1238
|
-
# Pre-MD micro-typography filters
|
|
1239
|
-
if detected_locale in ("ko", "mixed"):
|
|
1240
|
-
# Spec Amendments 4, A4.10 (every path): no ISO dates in Korean text. Before the dash filter, which would
|
|
1241
|
-
# read 2026-06-30 as a number range.
|
|
1242
|
-
body = docx_design.korean_dates(body)
|
|
1243
|
-
if frontmatter.get("date"):
|
|
1244
|
-
frontmatter["date"] = docx_design.format_date(frontmatter["date"], "ko")
|
|
1245
|
-
dash_rules = design.get("micro_typography", {}).get("dashes")
|
|
1246
|
-
|
|
1247
|
-
def typeset(text: str) -> str:
|
|
1248
|
-
return normalize_double_spaces(fix_ellipsis(fix_unit_spacing(fix_quotes(fix_dashes(text, dash_rules)))))
|
|
1249
|
-
|
|
1250
|
-
# A ::: fence line carries attributes (title="..."); curly quotes there would break the directive. The text
|
|
1251
|
-
# between fence lines is typeset as whole runs, so code fences and quote pairs keep their context and a
|
|
1252
|
-
# source without fences is typeset exactly as one piece.
|
|
1253
|
-
parts = re.split(r"^([ \t]*:{3,}.*)$", body, flags=re.M)
|
|
1254
|
-
body = "".join(part if i % 2 else typeset(part) for i, part in enumerate(parts))
|
|
1255
|
-
|
|
1256
|
-
# Load template if available
|
|
1257
|
-
template_docx = script_dir.parent / "templates" / "docx" / f"{publisher_name}.docx"
|
|
1258
|
-
if template_docx.exists():
|
|
1259
|
-
doc = Document(str(template_docx))
|
|
1260
|
-
# The template includes a self-describing sample title block and
|
|
1261
|
-
# sample heading/body paragraph. Strip all existing body paragraphs
|
|
1262
|
-
# and tables so the conversion output is the user's content only.
|
|
1263
|
-
body_el = doc.element.body
|
|
1264
|
-
sect_pr = body_el.find(qn("w:sectPr"))
|
|
1265
|
-
for child in list(body_el):
|
|
1266
|
-
if child is sect_pr:
|
|
1267
|
-
continue
|
|
1268
|
-
body_el.remove(child)
|
|
1269
|
-
if sect_pr is None:
|
|
1270
|
-
pass # keep original body even if no sectPr detected
|
|
1271
|
-
elif template_path and template_path.exists():
|
|
1272
|
-
doc = Document(str(template_path))
|
|
1273
|
-
else:
|
|
1274
|
-
doc = Document()
|
|
1275
|
-
|
|
1276
|
-
# Title block (built from frontmatter) before main content
|
|
1277
|
-
if frontmatter.get("title"):
|
|
1278
|
-
inject_title_block(doc, frontmatter, design)
|
|
1279
|
-
if frontmatter.get("notice"):
|
|
1280
|
-
add_notice(doc, frontmatter["notice"])
|
|
1281
|
-
page_numbers(doc, design)
|
|
1282
|
-
|
|
1283
|
-
# Main content
|
|
1284
|
-
if docx_design.has_directives(body):
|
|
1285
|
-
# Components in a journal manuscript are drawn with neutral styling (ink and line only).
|
|
1286
|
-
neutral = docx_design.neutral_tonality("en" if detected_locale == "en" else "ko")
|
|
1287
|
-
docx_design.setup_component_styles(doc, neutral)
|
|
1288
|
-
ctx = docx_design.Build(doc, neutral, _md_renderer(md_path), "en" if detected_locale == "en" else "ko")
|
|
1289
|
-
try:
|
|
1290
|
-
ctx.render(doc, body)
|
|
1291
|
-
except docx_design.DesignError as exc:
|
|
1292
|
-
raise SystemExit(f"Error: {exc}") from exc
|
|
1293
|
-
print("Note: the ::: components are drawn with publisher-neutral styling under a publisher profile")
|
|
1294
|
-
else:
|
|
1295
|
-
md_converter = markdown.Markdown(extensions=[
|
|
1296
|
-
'tables',
|
|
1297
|
-
'fenced_code',
|
|
1298
|
-
'nl2br',
|
|
1299
|
-
'sane_lists',
|
|
1300
|
-
])
|
|
1301
|
-
html = md_converter.convert(body)
|
|
1302
|
-
html_to_docx(html, doc, md_path)
|
|
1303
|
-
|
|
1304
|
-
# Post-HTML design enforcement
|
|
1305
|
-
apply_heading_numbering(doc, design)
|
|
1306
|
-
apply_table_style(doc, design)
|
|
1307
|
-
keep_tables_with_captions(doc)
|
|
1308
|
-
plain_table_cells(doc)
|
|
1309
|
-
publisher_spacing(doc)
|
|
1310
|
-
# No column narrower than its longest word (spec Amendments 4, todo 12b: "Cataly/st" in a publisher table).
|
|
1311
|
-
normal = doc.styles["Normal"].font.size
|
|
1312
|
-
for table in doc.tables:
|
|
1313
|
-
docx_design.fit_word_widths(table, normal.pt if normal else 11)
|
|
1314
|
-
docx_design.restart_numbered_lists(doc)
|
|
1315
|
-
docx_design.keep_short_lists(doc)
|
|
1316
|
-
strip_banned(doc, design)
|
|
1317
|
-
apply_cjk_font_pairing(doc, docx_font)
|
|
1318
|
-
drop_shadowed_theme_fonts(doc)
|
|
1319
|
-
|
|
1320
|
-
doc.save(str(docx_path))
|
|
1321
|
-
print(
|
|
1322
|
-
f"Successfully converted {md_path} to {docx_path} "
|
|
1323
|
-
f"[publisher={publisher_name}, locale={detected_locale}]"
|
|
1324
|
-
)
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
def parse_args() -> argparse.Namespace:
|
|
1328
|
-
parser = argparse.ArgumentParser(
|
|
1329
|
-
description="Convert Markdown to DOCX with proper styling"
|
|
1330
|
-
)
|
|
1331
|
-
parser.add_argument("input", help="Input Markdown file")
|
|
1332
|
-
parser.add_argument("output", help="Output DOCX file")
|
|
1333
|
-
parser.add_argument(
|
|
1334
|
-
"--template",
|
|
1335
|
-
help="Optional DOCX template to use as base",
|
|
1336
|
-
default=None,
|
|
1337
|
-
)
|
|
1338
|
-
parser.add_argument(
|
|
1339
|
-
"--publisher",
|
|
1340
|
-
help="Journal publisher profile from templates/registry.yaml (e.g. elsevier)",
|
|
1341
|
-
default=None,
|
|
1342
|
-
)
|
|
1343
|
-
parser.add_argument(
|
|
1344
|
-
"--registry",
|
|
1345
|
-
help="Path to templates/registry.yaml (defaults to the one in this skill)",
|
|
1346
|
-
default=None,
|
|
1347
|
-
)
|
|
1348
|
-
parser.add_argument(
|
|
1349
|
-
"--tonality",
|
|
1350
|
-
help="Design direction from templates/tonalities/: Report, Brief, Manual, Proposal, Memo or Journal "
|
|
1351
|
-
"(frontmatter tonality: works too)",
|
|
1352
|
-
default=None,
|
|
1353
|
-
)
|
|
1354
|
-
parser.add_argument("--density", type=int, default=None, help="Density dial 1-10 (default: the pack's)")
|
|
1355
|
-
parser.add_argument("--variance", type=int, default=None, help="Variance dial 1-10 (default: the pack's)")
|
|
1356
|
-
parser.add_argument(
|
|
1357
|
-
"--locale",
|
|
1358
|
-
choices=("auto", "en", "ko", "mixed"),
|
|
1359
|
-
default="auto",
|
|
1360
|
-
help="Force locale; 'auto' detects via Hangul codepoint ratio",
|
|
1361
|
-
)
|
|
1362
|
-
args = parser.parse_args()
|
|
1363
|
-
if args.publisher and args.template:
|
|
1364
|
-
parser.error("--publisher and --template are mutually exclusive")
|
|
1365
|
-
if args.publisher and args.tonality:
|
|
1366
|
-
parser.error("--tonality and --publisher are mutually exclusive: a tonality is a design direction, a publisher a journal profile")
|
|
1367
|
-
return args
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
def main() -> int:
|
|
1371
|
-
args = parse_args()
|
|
1372
|
-
|
|
1373
|
-
md_path = Path(args.input).expanduser().resolve()
|
|
1374
|
-
docx_path = Path(args.output).expanduser().resolve()
|
|
1375
|
-
template_path = Path(args.template).expanduser().resolve() if args.template else None
|
|
1376
|
-
registry_path = Path(args.registry).expanduser().resolve() if args.registry else None
|
|
1377
|
-
|
|
1378
|
-
if not md_path.exists():
|
|
1379
|
-
print(f"Error: Input file not found: {md_path}")
|
|
1380
|
-
return 1
|
|
1381
|
-
|
|
1382
|
-
convert_md_to_docx(
|
|
1383
|
-
md_path, docx_path, template_path,
|
|
1384
|
-
publisher_name=args.publisher,
|
|
1385
|
-
registry_path=registry_path,
|
|
1386
|
-
locale=args.locale,
|
|
1387
|
-
tonality=args.tonality,
|
|
1388
|
-
density=args.density,
|
|
1389
|
-
variance=args.variance,
|
|
1390
|
-
)
|
|
1391
|
-
return 0
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
if __name__ == "__main__":
|
|
1395
|
-
raise SystemExit(main())
|