generated from nhcarrigan/template
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
# New Repository Template
|
||||
# freeCodeCamp Review Generator
|
||||
|
||||
This template contains all of our basic files for a new GitHub repository. There is also a handy workflow that will create an issue on a new repository made from this template, with a checklist for the steps we usually take in setting up a new repository.
|
||||
This tool allows you to compile all of freeCodeCamp's review lessons into a single PDF.
|
||||
|
||||
If you're starting a Node.JS project with TypeScript, we have a [specific template](https://github.com/naomi-lgbt/nodejs-typescript-template) for that purpose.
|
||||
## Usage
|
||||
|
||||
## Readme
|
||||
|
||||
Delete all of the above text (including this line), and uncomment the below text to use our standard readme template.
|
||||
|
||||
<!-- # Project Name
|
||||
|
||||
Project Description
|
||||
|
||||
## Live Version
|
||||
|
||||
This page is currently deployed. [View the live website.]
|
||||
1. Clone the repo, `pnpm install`.
|
||||
2. Go to the freeCodeCamp repo, copy all of the review blocks into the `content` directory here. Nested directories are fine, we walk the file tree recursively. Only markdown files will be parsed.
|
||||
3. Run `pnpm start` to start reading the files, compiling them into a single doc, and turning that doc into a PDF.
|
||||
4. Profit.
|
||||
|
||||
## Feedback and Bugs
|
||||
|
||||
@@ -36,4 +29,4 @@ Copyright held by Naomi Carrigan.
|
||||
|
||||
## Contact
|
||||
|
||||
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`. -->
|
||||
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`.
|
||||
|
||||
+3
-1
@@ -36,7 +36,9 @@ const rollupFiles = async(
|
||||
outputFile: string,
|
||||
): Promise<void> => {
|
||||
try {
|
||||
console.log("Process started...");
|
||||
await writeFile(outputFile, `${starterText}\n`);
|
||||
console.log("Reading content directory...");
|
||||
const files = await readDirectoryRecursively(inputDirectory);
|
||||
for (const file of files) {
|
||||
if (file === ".gitkeep") {
|
||||
@@ -49,7 +51,6 @@ const rollupFiles = async(
|
||||
trim();
|
||||
// Title is in front matter
|
||||
const title = /^title: (?<title>.*)/m.exec(content)?.groups?.title;
|
||||
console.log(title);
|
||||
const strippedFccHeadings = strippedFrontmatter.
|
||||
replace(/^#+ --.*--/, "").
|
||||
trim();
|
||||
@@ -66,6 +67,7 @@ const rollupFiles = async(
|
||||
};
|
||||
|
||||
const createPdf = async(inputPath: string): Promise<void> => {
|
||||
console.log("Creating PDF...");
|
||||
const pdf = await mdToPdf({ path: inputPath }, options);
|
||||
console.log("PDF created!");
|
||||
await writeFile("./fcc-review-pages.pdf", pdf.content);
|
||||
|
||||
Reference in New Issue
Block a user