Skip to content

[Repo Assist] Add fsdocs init command to scaffold a docs folder#1025

Open
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/feature-872-fsdocs-init-38e3cf131bc26e21
Open

[Repo Assist] Add fsdocs init command to scaffold a docs folder#1025
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/feature-872-fsdocs-init-38e3cf131bc26e21

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Closes #872

Summary

Adds a new fsdocs init verb to the fsdocs tool that scaffolds a minimal docs folder for new projects, lowering the barrier for newcomers who previously had to copy-paste folder structures by hand.

What it does

Running dotnet fsdocs init in a project root creates:

  • docs/index.md — a starter landing page with front-matter and placeholder content

With the optional --with-template flag it also creates:

  • docs/_template.html — a minimal HTML template that uses standard {{fsdocs-*}} substitutions

Options

Option Default Description
--input (dir) docs Directory to initialise
--force false Overwrite existing files
--with-template false Also scaffold _template.html

Implementation

  • New InitCommand.fs with a [(Verb("init", ...))] type, matching the pattern of BuildCommand and WatchCommand.
  • Program.fs: added InitCommand to the ParseArguments type list and MapResult.
  • fsdocs-tool.fsproj: added InitCommand.fs compile item.
  • RELEASE_NOTES.md: added entry under [Unreleased] > Added.

Test Status

  • dotnet build FSharp.Formatting.sln --configuration Releasesucceeded (0 errors)
  • dotnet test FSharp.Formatting.sln --configuration Release --no-buildall 174 tests passed (0 failures)
  • Fantomas formatting applied to changed files.

Generated by Repo Assist for issue #872

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@f2c5cf1e4af58e09a93ba0703c6bf084711b265f. View source at https://github.com/githubnext/agentics/tree/f2c5cf1e4af58e09a93ba0703c6bf084711b265f/workflows/repo-assist.md.

Adds a new 'fsdocs init' verb that creates a minimal docs/index.md
(and optionally _template.html) for new projects.

Options:
  --input <dir>      Directory to initialise (default: docs)
  --force            Overwrite existing files
  --with-template    Also scaffold a _template.html

Closes #872

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review February 25, 2026 22:59
@nojaf
Copy link
Collaborator

nojaf commented Feb 26, 2026

/repo-assist the inline template content string seems insufficient compared to https://github.com/fsprojects/FSharp.Formatting/blob/main/docs/_template.html
Certain feature won't work without proper html.
Can we not read that file instead and use that as template?

…emplate

Instead of an inline minimal HTML string, embed docs/_template.html as an
assembly resource and read it at runtime, so the scaffolded template is the
full, feature-complete template including OpenGraph, theme toggle, search,
navigation, and all fsdocs substitutions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

Commit pushed: 7e0df2e

Generated by Repo Assist

@github-actions
Copy link
Contributor Author

🤖 This is an automated response from Repo Assist.

Good call, @nojaf! I've updated the PR to address this. Instead of the minimal inline template string, docs/_template.html is now embedded as an assembly resource (fsdocs._template.html) in fsdocs-tool.fsproj. The InitCommand reads it via Assembly.GetManifestResourceStream at runtime, so fsdocs init --with-template will scaffold the full, feature-complete template — including OpenGraph metadata, Twitter cards, theme toggle, search, navigation sidebar, and all current \{\{fsdocs-*}} substitutions.

This also means the scaffolded template will automatically stay in sync with the canonical template as the project evolves.

Changes pushed:

  • fsdocs-tool.fsproj: added (EmbeddedResource Include="..\..\docs\_template.html" LogicalName="fsdocs._template.html" /)
  • InitCommand.fs: replaced inline string with Assembly.GetManifestResourceStream("fsdocs._template.html") read

Build: ✅ succeeded | Runtime test: ✅ full template content confirmed

Generated by Repo Assist for issue #1025

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@f2c5cf1e4af58e09a93ba0703c6bf084711b265f. View source at https://github.com/githubnext/agentics/tree/f2c5cf1e4af58e09a93ba0703c6bf084711b265f/workflows/repo-assist.md.

Copy link
Collaborator

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Good enough to start out.
Over time we could consider have a more wizard like setup for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: init command

2 participants