-
Notifications
You must be signed in to change notification settings - Fork 43
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
Adds skills folder to repo and loads markdown for each skill #302 #336
Conversation
Includes bin/skillsPopulate file left-over from old specs - no longer useful but keeping until told to remove
Modified skillsPopulate script Removed accidental skills-markdown.js
@@ -9,7 +9,7 @@ | |||
"dev": "nodemon web-server", | |||
"start": "node web-server", | |||
"db:migrate": "knex migrate:latest", | |||
"test": "mocha -G -r ./mocha.config.js $(find digest web-server database backoffice | grep .test.js) ", | |||
"test": "mocha -G -r ./mocha.config.js $(find digest web-server database backoffice skills | grep .test.js) ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think we'll put any tests in there. please remove this change
@@ -15,6 +15,7 @@ module.exports = digest => { | |||
rawText, | |||
modules: [], | |||
path: `/skills/${encodeURIComponent(id)}`, | |||
markdownFilePath: `/skills/${id}.md`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know i asked for this but i've changed my mind :)
@@ -1,10 +1,13 @@ | |||
# Grocery Queries Exercise | |||
|
|||
___Note:__ This module assumes you've already installed postgresql via homebrew. If you have not done that please do back and do the [Installfest](../Installfest) module._ | |||
___Note:__ This module assumes you've already installed postgresql via homebrew. If you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes should not be in this PR. please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very curious that our README somehow picked up those changes. Not even sure what or whose branch that is from. Will revert... just curiously commenting.
edit: git blame
helped here. Somehow my "Fixes last minute mistakes" commit introduced this new mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very curious that our README somehow picked up those changes.
Well technically you committed these changes and worse you submitted them for reviews. This is the perfect time for you to focus on leveling up your git hygiene. Get into the habit of always usinggit add -p
and before you open a PR always: rebase off upstream/master and consider squashing and polishing your commits. double or even triple check the diff.
@@ -133,7 +133,7 @@ module.exports = app => { | |||
}) | |||
} | |||
|
|||
response.renderMarkdown = function(markdown){ | |||
response.renderMarkdown = function(markdown, viewPage='markdown', extraArgs){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont want to do this this way. please restore these helpers and see my comment in the routes file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this helper response.renderMarkdownFileToHTML
that does most of what renderMarkdownFile
does but yields the HTML. then update renderMarkdownFile
to use the renderMarkdownFileToHTML
@@ -31,9 +31,11 @@ module.exports = app => { | |||
queries.getChecksForUserAndLabels({userId, labels}) | |||
.then(checks => { | |||
const checked = !!checks[skill.id] | |||
response.render('skills/show', {skill, checked, title: skill.name}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert you changes to the helpers and make a new helper called renderMarkdownFileToHTML
const markdownHTML = response.renderMarkdownFileToHTML(`/skills/${skill.id}/README.md`)
response.render('skills/show', {markdownHTML, skill, checked, title: skill.name})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deadlyicon I can't imagine doing this without being async. Are you okay with:
response.renderMarkdownFileToHTML(`/skills/${skill.id}/README.md`)
.then( markdownHTML => {
response.render('skills/show', {markdownHTML, skill, checked, title: skill.name})
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course! it has to be asyc because we read files async :)
|
||
h1.skill-show-page-heading | ||
input.skill-checkbox(type="checkbox", data-label=skill.id, checked=checked) | ||
span !{renderSkill(skill)} | ||
span.skill-markdown !{content} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this span is inside of the h1, outdent it 1 level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also make it a div by removing span
li | ||
a(href=sourceUrl target="_blank") View On GitHub | ||
li | ||
a(href=editeUrl target="_blank") Improve This Page | ||
|
||
h1.skill-show-page-heading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this h1 with the checkbox. We're going to need to write some client javascript to dynamically add this checkbox on page load since we cannot easily modify the HTML we get from the markdown file. Ignore that for now and just remove this h1 and input
please rebase this branch off upstream/master |
Fixes #286
Previous PR: #302
Overview
Configuration Changes
Modifies package.json scripts section - script:
test
to include 'skills' folder in testsNo tests written yet