| id | 200 |
|---|---|
| title | Move docs/ embed out of internal/lsp/hover.go |
| status | ✅ |
| summary | Fix the DIP violation where internal/lsp/hover.go imports a Go package from docs/guides/directives. Move the embed to internal/directives so the docs tree contains only documentation. |
| model | |
| depends-on |
internal/lsp/hover.go imports
docs/guides/directives as an embed.FS.
A Go package inside docs/ blurs source
vs. documentation. It also violates the
layering map: no docs/ layer sits
between helpers and internal/lsp.
Moving the embed to internal/directives
follows the internal/concepts pattern.
The full user guides in
docs/guides/directives/
stay put. They are indexed by the
docs/guides/index.md catalog and linked
from rule READMEs.
The new
internal/directives/
holds short, hover-sized stubs. This is the
internal/concepts/placeholder-grammar.md
pattern: same filename as the guide, but
separate Go-private content. Each stub links
out to the matching full guide.
- Add
internal/directives/**todirectory-structure.allowedin.mdsmith.ymlso the new package's markdown files lint cleanly. - Create
internal/directives/with adirectives.gofile that embeds*.mdplus short hover stubs forbuild.md,enforcing-structure.md, andgenerating-content.md. Each stub summarises the directive(s) and links out to the matchingdocs/guides/directives/guide. - Replace the import in
internal/lsp/hover.gotointernal/directives. - Remove
embed.gofromdocs/guides/directives/(keep the Markdown guides there). - Add
TestDirectivesSourceininternal/directives/directives_test.go. - Run
go build ./...andgo test ./.... - Run
go run ./cmd/mdsmith check ..
-
grep -r 'docs/guides/directives' internal/returns no Go imports. -
internal/directives/has the embed and a passing unit test. -
go build ./...clean. -
go test ./...passes. -
go tool golangci-lint runclean.