-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configuration.js
54 lines (40 loc) · 2.33 KB
/
Configuration.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const Substitutioner = require('./src/Substitutioner');
const substitutioner = new Substitutioner();
// Configuration of the request parameters that get send to github
// The predefined settings are for: https://github.com/hpi-swt2/vm-portal
const requestParameter = {
group: 'hpi-swt2', // name of the orga the repo is part of
repository: 'vm-portal', // name of the repository
maxRequestedIssueNumber: 200, // max number of overall fetched issues
issueFilterLabel: 'team scaffold', // the string of a label, that is applied to relevent issues (Rest gets ignored)
private: false // whether the repo is private or not
};
// you only need to fill in your credentials if your repo is private
const credentials = {
username: 'your username',
password: 'your password or an OAuth Token'
}
/********************************************************************************/
/**
* Here are the changes of the issue text to final text in the tex file defined
* The addRule method takes a regex and a string
*/
// enables usage of # in the issue text, because it is a special character in markdown
substitutioner.addRule(/#/g, '\\#');
// ignores github links
substitutioner.addRule(/!\[.*\]\(.*\)/g, '');
// Starts the description of the issue and makes 'Beschreibung:' a header
substitutioner.addRule(/\*{0,2}Beschreibung:?\*{0,2}/gi, '\\subsection{Beschreibung:} ');
// Starts the description of the acceptance criterias, makes 'Akzeptanzkriterien:' a header
// and starts a todolist in order to prefix the individual cirteriad with a checkbox
substitutioner.addRule(/\*{0,2}Akzeptanzkriterien:?\*{0,2}/gi, '\\subsection{Akzeptanzkriterien:} \\begin{todolist}');
// parse normal items/checkboxes
substitutioner.addRule(/- \[ \]/g, '\\item ');
// parse activated items/checkboxes
substitutioner.addRule(/- \[x\]/g, '\\item ');
// Ends the todolist and makes 'Priorität:' a header
substitutioner.addRule(/\*{0,2}Priorität:?\*{0,2}/g, '\\end{todolist} \\subsection{Priorität:}');
// Makes 'Aufwandsschätzung:' a header
substitutioner.addRule(/\*{0,2}Aufwandsschätzung:?\*{0,2}/g, '\\subsection{Aufwandsschätzung:}');
/**************************************************************************/
module.exports = {requestParameter, credentials, substitutioner};