Skip to content

Commit

Permalink
docs: 🔨 update create readme script
Browse files Browse the repository at this point in the history
  • Loading branch information
AllyMurray committed Feb 26, 2024
1 parent 1ae3054 commit 04d1203
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 63 deletions.
6 changes: 3 additions & 3 deletions scripts/create-readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
import { readFile, readdir, stat } from 'node:fs/promises';
import path from 'node:path';
import { capitalCase, trainCase } from 'change-case';
import { markdownDocument } from '../src/documents/markdown.js';
import { markdownFile } from '../src/markdown-file.js';
import { acknowledgementsSection } from '../src/sections/acknowledgements.js';
import { authorsSection } from '../src/sections/authors.js';
import { examplesSection, type Example } from '../src/sections/examples.js';
Expand Down Expand Up @@ -111,12 +111,12 @@ export async function createReadme(options: ReadmeOptions) {

const examples = examplesSection({ items: exampleItems });

markdownDocument({
markdownFile({
title: packageJson.name,
fileName: 'README.md',
description:
'This project allows managing Markdown files through JavaScript/TypeScript',
outDir: options.ourDir,
content: [installation, runLocally, examples, authors, acknowledgements],
}).synth();
}).toFile();
}
60 changes: 0 additions & 60 deletions src/__snapshots__/markdown-file.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,65 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Markdown Document > should synthesize a basic document 1`] = `
"# Test
## Table of Contents
"
`;

exports[`Markdown Document > should synthesize a document after adding a custom section with a sub-section by setting rootSection 1`] = `
"# Test
## Table of Contents
- [Root Section](#root-section)
- [Sub Section](#sub-section)
## Root Section
Some markdown content
### Sub Section
Some markdown sub content"
`;

exports[`Markdown Document > should synthesize a document after adding a custom section with a sub-section by using addSubSection 1`] = `
"# Test
## Table of Contents
- [Root Section](#root-section)
- [Authors](#authors)
## Root Section
Some markdown content
### Authors
- [@jane-doe](https://www.github.com/jane-doe)"
`;

exports[`Markdown Document > should synthesize a document after adding a section 1`] = `
"# Test
## Table of Contents
- [Roadmap](#roadmap)
## Roadmap
- Item 1"
`;

exports[`Markdown Document > should write a document to disk 1`] = `
"# Test
## Table of Contents
"
`;

exports[`Markdown File > should synthesize a basic document 1`] = `
"# Test
Expand Down

0 comments on commit 04d1203

Please sign in to comment.