From a330dce09e0667e6eedfe7e22a5b288bf6c7d20e Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 31 May 2015 15:42:54 -0700 Subject: [PATCH] Add dashed names to field guides --- models/FieldGuide.js | 4 +++ seed_data/challenges/basic-html5-and-css.json | 24 +++++++------- seed_data/field-guides.json | 31 ++++++++++++++++++- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/models/FieldGuide.js b/models/FieldGuide.js index b705f44774..b9c2613eed 100644 --- a/models/FieldGuide.js +++ b/models/FieldGuide.js @@ -6,6 +6,10 @@ var fieldGuideSchema = new mongoose.Schema({ type: String, unique: false }, + dashedName: { + type: String, + unique: false + }, description: { type: Array, unique: false diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index f5f92f61fa..1f22850de3 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -53,7 +53,7 @@ ], "tests": [ "assert(($('h2').length > 0), 'Create an h2 element.')", - "assert(editor.match(/<\\/h2>/g) && editor.match(/<\\/h2>/g).length === editor.match(/

/g).length, 'Be sure that your h2 element has a closing tag.')", + "assert(editor.match(/<\\/h2>/g) && editor.match(/<\\/h2>/g).length === editor.match(/

/g).length, 'Make sureyour h2 element has a closing tag.')", "assert.isTrue((/cat(\\s)?photo(\\s)?app/gi).test($('h2').text()), 'Your h2 element should have the text \"CatPhotoApp\"')", "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\"')" ], @@ -89,7 +89,7 @@ "tests": [ "assert(($('p').length > 0), 'Create a p element.')", "assert.isTrue((/hello(\\s)+paragraph/gi).test($('p').text()), 'Your p element should have the text \"Hello Paragraph\".')", - "assert(new RegExp('

', 'gi').test(editor), 'Be sure to complete your p element with a closing tag.')" + "assert(editor.match(/<\\/p>/g) && editor.match(/<\\/p>/g).length === editor.match(/

/g).length, 'Make sureyour p element has a closing tag.')" ], "challengeSeed": [ "

Hello World

", @@ -480,7 +480,7 @@ ], "tests": [ "assert($('p').length > 1, 'You need 2 p elements with Kitty Ipsum text.')", - "assert(editor.match(/<\\/p>/g).length > 1, 'Be sure that each of your p elements has a closing tag.')", + "assert(editor.match(/<\\/p>/g).length > 1, 'Make sureeach of your p elements has a closing tag.')", "assert($('p').css('font-size') === '16px', 'Give your p elements the font-size of 16px.')" ], "challengeSeed": [ @@ -1041,7 +1041,7 @@ "assert($('a').text().match(/cat\\sphotos/gi).length > 0, 'Your a element should have the anchor text of \"cat photos\"')", "assert($('a[href=\\'http://www.catphotoapp.com\\']').parent().is('p'), 'Your anchor element should be wrapped within a paragraph element.')", "assert($('p').text().match(/click\\shere\\sfor/gi), 'Your p element should have the text \"click here for\".')", - "assert(editor.match(/<\\/p>/g).length > 2, 'Be sure that each of your p elements has a closing tag.')" + "assert(editor.match(/<\\/p>/g).length > 2, 'Make sureeach of your p elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1168,7 +1168,7 @@ "tests": [ "assert(new RegExp('#').test($('a').children('img').parent().attr('href')), 'Your anchor element should be a dead link with a href attribute set to \"#\".')", "assert($('a').children('img').length > 0, 'Wrap your image element inside an anchor element.')", - "assert(editor.match(/<\\/a>/g).length > 1, 'Be sure that each of your a elements has a closing tag.')" + "assert(editor.match(/<\\/a>/g).length > 1, 'Make sureeach of your a elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1295,8 +1295,8 @@ "tests": [ "assert($('ul').length > 0, 'Create a ul element.')", "assert($('li').length > 2, 'Add three li elements to your ul element.')", - "assert(editor.match(/<\\/ul>/g), 'Be sure that your ul element has a closing tag.')", - "assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length > 2, 'Be sure that each of your li elements has a closing tag.')" + "assert(editor.match(/<\\/ul>/g), 'Make sureyour ul element has a closing tag.')", + "assert(editor.match(/<\\/li>/g) && editor.match(/<\\/li>/g).length > 2, 'Make sureeach of your li elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1362,9 +1362,9 @@ "assert($('ol').length > 0, 'You should have an ol element on your webpage.')", "assert($('li').length > 5, 'You should have three li elements within your ul element.')", "assert($('li').length > 5, 'You should have three li elements within your ol element.')", - "assert(editor.match(/<\\/ol>/g), 'Be sure that your ol element has a closing tag.')", - "assert(editor.match(/<\\/ul>/g), 'Be sure that your ul element has a closing tag.')", - "assert(editor.match(/<\\/li>/g).length > 5, 'Be sure that each of your li elements has a closing tag.')" + "assert(editor.match(/<\\/ol>/g), 'Make sureyour ol element has a closing tag.')", + "assert(editor.match(/<\\/ul>/g), 'Make sureyour ul element has a closing tag.')", + "assert(editor.match(/<\\/li>/g).length > 5, 'Make sureeach of your li elements has a closing tag.')" ], "challengeSeed": [ "", @@ -1651,7 +1651,7 @@ "assert($('form').children('button').length > 0, 'Your form should have a button inside it.')", "assert($('button').attr('type') === 'submit', 'Your submit button should have be of input type \"submit\".')", "assert($('button').text().match(/submit/gi), 'Your submit button should have the text \"submit\".')", - "assert(editor.match(/<\\/button>/g), 'Be sure that your button element has a closing tag.')" + "assert(editor.match(/<\\/button>/g), 'Make sureyour button element has a closing tag.')" ], "challengeSeed": [ "", @@ -2125,7 +2125,7 @@ "assert($('div').children('ol').length > 0, 'Wrap your ol element inside your div element.')", "assert($('div').children('p').length > 1, 'Wrap your p element inside your div element.')", "assert($('div').children('ul').length > 0, 'Wrap your ul element inside your div element.')", - "assert(editor.match(/<\\/div>/g) && editor.match(/<\\/div>/g).length === editor.match(/
/g).length, 'Be sure that your div element has a closing tag.')" + "assert(editor.match(/<\\/div>/g) && editor.match(/<\\/div>/g).length === editor.match(/
/g).length, 'Make sureyour div element has a closing tag.')" ], "challengeSeed": [ "", diff --git a/seed_data/field-guides.json b/seed_data/field-guides.json index 4de82c5a26..d55d682a66 100644 --- a/seed_data/field-guides.json +++ b/seed_data/field-guides.json @@ -2,6 +2,7 @@ { "_id": "bd7158d9c441eddfaeb5bdef", "name": "How do I use this guide?", + "dashedName": "how-do-i-use-this-guide", "description": [ "
", "

This guide strives to provide clear answers to common questions about Free Code Camp, learning to code, and getting a coding job.

", @@ -13,6 +14,7 @@ { "_id": "bd7158d9c441eddfaeb5bdff", "name": "What exactly is Free Code Camp?", + "dashedName": "what-exactly-is-free-code-camp", "description": [ "
", "

We're a community of busy people who learn to code by building projects for nonprofits.

", @@ -30,6 +32,7 @@ { "_id": "bd7158d9c441eddfaeb5bd1f", "name": "Why do I need Free Code Camp?", + "dashedName": "why-do-i-need-free-code-camp", "description": [ "
", "

Learning to code is hard.

", @@ -47,6 +50,7 @@ { "_id": "bd7158d9c441eddfaeb5bd2f", "name": "What are the main advantages of Free Code Camp?", + "dashedName": "what-are-the-main-advantages-of-free-code-camp", "description": [ "
", "

Our main advantage is that we're accessible to busy adults who want to change careers. Specifically, we're:

", @@ -63,6 +67,7 @@ { "_id": "bd7158d9c441eddfaeb5bd3f", "name": "How does Free Code Camp work?", + "dashedName": "how-does-free-code-camp-work", "description": [ "
", "

Our free, self-paced, browser-based program takes about 1,600 hours to complete.", @@ -83,7 +88,8 @@ }, { "_id": "bd7158d9c441eddfaeb5bd4f", - "name": "Will I really be able to get a job after Free Code Camp?", + "name": "Will I really be able to get software engineering job after Free Code Camp?", + "dashedName": "will-i-really-be-able-to-get-a-software-engineering-job-after-free-code-camp", "description": [ "
", "

If you complete this program, you will be able to get a coding job. Many of our campers have already gotten coding jobs.

", @@ -103,6 +109,7 @@ { "_id": "bd7158d9c440eddfaeb5bdef", "name": "What will I learn, and in what sequence?", + "dashedName": "what-will-i-learn-and-in-what-sequence", "description": [ "
", "

First, you'll learn basic web design tools like:

", @@ -139,6 +146,7 @@ { "_id": "bd7158d9c434eddfaeb5bdef", "name": "How long does Free Code Camp take?", + "dashedName": "how-long-does-free-code-camp-take", "description": [ "
", "

It takes about 1,600 hours of coding to develop the skills you'll need to get an entry level software engineering job.

", @@ -176,6 +184,7 @@ { "_id": "bd7158d9c438eddfaeb5bdef", "name": "Why does Free Code Camp use JavaScript instead of Ruby or Python?", + "dashedName": "why-does-free-code-camp-use-javascript-instead-of-ruby-or-python", "description": [ "
", "

Like JavaScript, Ruby and Python are high-level scripting languages that can be used for full stack web development.

", @@ -189,6 +198,7 @@ { "_id": "bd7158d9c437eddfaeb5bdef", "name": "What is pair programming, and why is it special?", + "dashedName": "what-is-pair-programming-and-why-is-it-special", "description": [ "
", "

Pair programming is where two people code together on one computer.

", @@ -201,6 +211,7 @@ { "_id": "bd7158d9c436eddfaeb5bd2f", "name": "How do I get help when I get stuck?", + "dashedName": "how-do-i-get-help-when-i-get-stuck", "description": [ "
", "

When you get stuck, remember: RSAP.

", @@ -223,6 +234,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3f", "name": "Can I jump around in this guide?", + "dashedName": "can-i-jump-around-in-this-guide", "description": [ "
", "

This guide was designed as a reference for you. You shouldn't try to read it all today.

", @@ -234,6 +246,7 @@ { "_id": "bd7158d9c436eddfaeb5bdef", "name": "If Free Code Camp is free, how does it make money?", + "dashedName": "if-free-code-camp-is-free-how-does-it-make-money", "description": [ "
", "

We are completely free for both students and for nonprofits.

", @@ -246,6 +259,7 @@ { "_id": "bd7158d9c435eddfaeb5bdef", "name": "Does Free Code Camp have an application process?", + "dashedName": "does-free-code-camp-have-an-application-process", "description": [ "
", "

Unlike coding bootcamps, anyone can study at Free Code Camp.

", @@ -257,6 +271,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3b", "name": "How can I stream my live coding sessions on Free Code Camp's Twitch.tv channel?", + "dashedName": "how-can-i-stream-my-live-coding-sessions-on-free-code-camps-twitch-tv-channel", "description": [ "
", "

If you're interested in coding JavaScript live in front of dozens of people on our popular twitch.tv channel, we'd love to have you.

", @@ -277,6 +292,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3d", "name": "How can I find other Free Code Camp campers in my city?", + "dashedName": "how-can-i-find-other-free-code-camp-campers-in-my-city", "description": [ "
", "

Find your city below and join their group. This is a great way to hang out with other coders, share insights, and pair program.

", @@ -463,6 +479,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3e", "name": "Does Free Code Camp have an alumni network?", + "dashedName": "does-free-code-camp-have-an-alumni-network", "description": [ "
", "

We have a growing alumni network on LinkedIn. Once you've finished Free Code Camp and have gotten a coding job, we'd love to include you in this group, too!

", @@ -472,6 +489,7 @@ { "_id": "bd7158d9c442eddfaeb5b2ef", "name": "Why doesn't Free Code Camp teach technical interviewing skills?", + "dashedName": "why-doesnt-free-code-camp-teach-technical-interviewing-skills", "description": [ "
", "

The skills you'll need to succeed in the job interview are quite different from the skills you'll need to succeed on the job.


", @@ -487,6 +505,7 @@ { "_id": "bd7158d9c442eddfaeb5bdef", "name": "How do I best use the Global Control Shortcuts for Mac?", + "dashedName": "how-do-i-best-use-the-global-control-shortcuts-for-mac", "description": [ "
", "

These Global Control Shortcuts for Mac will save you hours by speeding up your typing.


", @@ -511,6 +530,7 @@ { "_id": "bd7158d9c445eddfaeb5bdef", "name": "How can I get to Inbox Zero with Gmail shortcuts?", + "dashedName": "how-can-i-get-to-inbox-zero-with-gmail-shortcuts", "description": [ "
", "

These Gmail Shortcuts will save you hours and help you get to Inbox Zero.


", @@ -539,6 +559,7 @@ { "_id": "bd7158d9c445eddfaeb5bdff", "name": "How can I deploy a website without writing any code at all?", + "dashedName": "how-can-i-deploy-a-website-without-writing-any-code-at-all", "description": [ "
", "

It's possible to build dynamic, mobile-responsive websites without writing any code at all, in just a few minutes.


", @@ -561,6 +582,7 @@ { "_id": "bd7158d9c446eddfaeb5bdef", "name": "How do Free Code Camp's Nonprofit Projects work?", + "dashedName": "how-do-free-code-camps-nonprofit-projects-work", "description": [ "
", "

Building nonprofit projects is the main way that our campers learn full stack JavaScript and agile software development. Once you complete the Free Code Camp Waypoints, Bonfires, Ziplines and Basejumps, you'll begin this process.

", @@ -635,6 +657,7 @@ { "_id": "bd7158d9c447eddfaeb5bdef", "name": "How do I install Screenhero?", + "dashedName": "how-do-i-install-screenhero", "description": [ "
", "

Download for Mac

", @@ -646,6 +669,7 @@ { "_id": "bd7158d9c451eddfaeb5bded", "name": "What is the style guide for Bonfires?", + "dashedName": "what-is-the-style-guide-for-bonfires", "description": [ "
", "

Writing Bonfire challenges is a great way to exercise your own problem solving and testing abilities. Follow this process closely to maximize the chances of us accepting your bonfire.

", @@ -681,6 +705,7 @@ { "_id": "bd7158d9c451eddfaeb5bdee", "name": "What is the Free Code Camp Code of Conduct?", + "dashedName": "what-is-the-free-code-camp-code-of-conduct", "description": [ "
", "

Free Code Camp is friendly place to learn to code. We're committed to keeping it that way.

", @@ -705,6 +730,7 @@ { "_id": "bd7158d9c451eddfaeb5bdef", "name": "What is the Free Code Camp Privacy Policy?", + "dashedName": "what-is-the-free-code-camp-privacy-policy", "description": [ "
", "

Free Code Camp is committed to respecting the privacy of visitors to our web sites and web applications. The guidelines below explain how we protect the privacy of visitors to FreeCodeCamp.com and its features.

", @@ -746,6 +772,7 @@ { "_id": "bd7158d9c436eddfaeb5bd3c", "name": "How can I reach the Free Code Camp team to interview them for my publication?", + "dashedName": "how-can-i-reach-the-free-code-camp-team-to-interview-them-for-my-publication", "description": [ "
", "

We're happy to do a quick interview for your publication or show. Here's whom you should contact about what, and how to best reach them:

", @@ -764,6 +791,7 @@ { "_id": "bd7158d9c436eddfaeb5dd3b", "name": "What other resources does Free Code Camp recommend to nonprofits?", + "dashedName": "what-other-resources-does-free-code-camp-recommend-to-nonprofits", "description": [ "
", "

Here are some excellent resources for nonprofits.

", @@ -805,6 +833,7 @@ { "_id": "bd7158d9c436eddfadb5bd3e", "name": "How can I contribute to this guide?", + "dashedName": "how-can-i-contribute-to-this-guide", "description": [ "
", "

Contributing to our field guide is a great way to establish your history on GitHub, add to your portfolio, and help other campers. If you have a question about JavaScript or programming in general that you'd like us to add to the field guide, here are two ways to get it into the guide:

",