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

Lab 04 Submission #2

Merged
merged 6 commits into from
Aug 11, 2019
Merged

Lab 04 Submission #2

merged 6 commits into from
Aug 11, 2019

Conversation

BillyBunn
Copy link
Member

@BillyBunn BillyBunn commented Mar 22, 2019

Notes for grader

  • I've successfully completed part 1 of this lab and gotten a good start on part 2.
  • Within part 2, I've been able to wrap the .txt file contents in article tags and I've got a working solution for the h2 tags (only the first section title is working right now.
  • I've done part 2 only using buffers
  • I don't have any good tests setup yet
  • still having trouble with jsdocs

Lab Requirements

Assignment 1: Code that writes code ...

  • Using only buffers and bit manipulation, generate a file in the files folder called loop.js that initiates an array with 3 people's names, iterates them with a forEach loop, and console.log's each value.
  • You may not use Buffer.from() to simply create a buffer from chunks of your target code. Rather, you will need to work character by character.
  • Verify your work by running node loop.js from within the files folder and seeing the array items printed out.

Assignment 2: Create an <article>

  • Using only buffers and bit manipulation, read the file pair-programming.txt from the files folder and make the following transformations:
    • Wrap all of the content within <article> tags
    • Wrap each section title in an <h2>
    • Convert each sentence in each paragraph into a list item.
    • Convert each of the numbered sections in the bottom of the document to <h3> tags.
  • You may not use .toString()
  • Save the file as pair-programming.html
  • Verify your work by rendering it in a browser

Testing

  • Test your units (assuming you break down the challenges into small, focused functions.
  • Create a target file to use as comparison, so that you have something to assert your work against.

README.md Show resolved Hide resolved
}


function insertHTMLTags(buffer) {
Copy link

Choose a reason for hiding this comment

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

This is close, try using Regex to pattern match so your code can append the tags at the correct spots. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

Copy link

@ixnp ixnp left a comment

Choose a reason for hiding this comment

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

Good work so far, your loop functionality is working great. There's some logic to add to the code that creates the HTML document and it looks like you have some testing to write. let me know if you need ideas for things to test. spying on a console.log might be a good place to start.

index.js Show resolved Hide resolved
@BillyBunn BillyBunn merged commit b8ed47d into submission Aug 11, 2019
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.

2 participants