Skip to content

Commit e44fcac

Browse files
Add README on how to generate docs (#471)
Co-authored-by: Nate Prewitt <[email protected]>
1 parent b3dd35b commit e44fcac

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/SetupGenerator.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ private static void writeDocsSkeleton(
288288
.orElse(context.settings().service().getName()));
289289
writeConf(settings, context, projectName);
290290
writeIndexes(context, projectName);
291+
writeDocsReadme(context);
291292
writeMakeBat(context);
292293
writeMakeFile(context);
293294
}
@@ -447,6 +448,31 @@ private static void writeIndexes(GenerationContext context, String projectName)
447448
writeIndexFile(context, "docs/models/index.rst", "Models");
448449
}
449450

451+
452+
/**
453+
* Write the readme in the docs folder describing instructions for generation
454+
*
455+
* @param context The generation context containing the writer delegator.
456+
*/
457+
private static void writeDocsReadme(
458+
GenerationContext context
459+
) {
460+
context.writerDelegator().useFileWriter("docs/README.md", writer -> {
461+
writer.write("""
462+
## Generating Documentation
463+
464+
Sphinx is used for documentation. You can generate HTML locally with the
465+
following:
466+
467+
```
468+
$$ uv pip install ".[docs]"
469+
$$ cd docs
470+
$$ make html
471+
```
472+
""");
473+
});
474+
}
475+
450476
/**
451477
* Helper method to write an index file with the given title.
452478
* This method creates an index file at the specified file path with the provided title.

0 commit comments

Comments
 (0)