Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for Markdown #7

Merged
merged 7 commits into from
Sep 22, 2022
Merged

Conversation

rokaicker
Copy link
Contributor

This code resolves issue 6.

Users now have the ability to parse markdown files to generate an html file, as well as parsing through each line of the markdown file to find pieces of text that are meant to be builded (with the "**" symbols).

This was accomplished by modifying generateHTML.js, and adding a new function called readMdFile. I also changed readFile to readTextFile to differentiate between the two.

Also, I added /dist folder to .gitignore to prevent uploading the generated test websties to git.

I also modified main.js to represent a version bump.

let pattern = /\*\*(?:\\.|[^\*\*])*\*\*/gm;
let matchIndexes = [];
let match;
while( match = pattern.exec(theLine) ){
Copy link
Owner

Choose a reason for hiding this comment

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

Can you add a comment for this while loop to explain what it does

generateHTML.js Outdated
matchIndexes.push(match.index);
matchIndexes.push(pattern.lastIndex);
}
console.log(matchIndexes);
Copy link
Owner

Choose a reason for hiding this comment

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

Can you remove this console.log

@rokaicker
Copy link
Contributor Author

updated with requested changes

@NeilAn99 NeilAn99 merged commit 7c85792 into NeilAn99:main Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adding markdown support
2 participants