-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create notes using HackMD (#30)
* feat: create notes using HackMD * fixup! feat: create notes using HackMD
- Loading branch information
Showing
11 changed files
with
374 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict' | ||
|
||
module.exports = ({ agendaIssues, agendaLabel, owner, repo, issue }) => { | ||
return ` | ||
# ${issue.title} | ||
## Links | ||
* **Recording**: | ||
* **GitHub Issue**: https://github.com/${owner}/${repo}/issues/${issue.number} | ||
## Present | ||
* | ||
## Announcements | ||
## Agenda | ||
*Extracted from **${agendaLabel}** labelled issues and pull requests from the **${owner} org** prior to the meeting. | ||
${agendaIssues.map((i) => { | ||
return `* ${i.title} [#${i.number}](${i.html_url})` | ||
}).join('\n')} | ||
## Q&A, Other | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict' | ||
|
||
const { default: HackMD } = require('@hackmd/api') | ||
const defaultNotesTemplate = require('./default-notes-template') | ||
|
||
module.exports.create = function createNote (notesTemplate, opts) { | ||
const note = typeof notesTemplate === 'function' ? notesTemplate(opts) : notesTemplate || defaultNotesTemplate(opts) | ||
const hackmd = new HackMD() | ||
|
||
return hackmd.newNote(note) | ||
} | ||
|
||
async function getNotesTemplate (client, opts) { | ||
const resp = await client.repos.getContents({ | ||
owner: opts.owner, | ||
repo: opts.repo, | ||
path: `.github/meet/${opts.notesTemplate}` | ||
}) | ||
if (resp.statusCode === 404) { | ||
return false | ||
} | ||
return Buffer.from(resp.data.content, resp.data.encoding).toString() | ||
} | ||
|
||
module.exports.getNotesTemplate = getNotesTemplate |
Oops, something went wrong.