Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
lxRbckl committed Sep 22, 2024
1 parent bf5d02c commit 0e4393c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 37 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:19.5.0


# referencing docker compose <
# referencing docker compose, otherwise override <
ENV tokenOctokit ${tokenOctokit}

ENV file ${file}
Expand All @@ -12,9 +12,6 @@ ENV repository ${repository}
ENV urlGitHubUsers ${urlGitHubUsers}
ENV excludedBranches ${excludedBranches}

ENV bigBreaker ${bigBreaker}
ENV smallBreaker ${smallBreaker}
ENV fileDelimeter ${fileDelimeter}
ENV urlElementResources ${urlElementResources}
ENV urlElementDescriptions ${urlElementDescriptions}

Expand Down
6 changes: 3 additions & 3 deletions src/configs/markdownManagerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const markdownManagerConfig: {

} = {

bigBreaker : process.env.bigBreaker!,
smallBreaker : process.env.smallBreaker!,
fileDelimeter : process.env.fileDelimeter!,
bigBreaker : '---',
smallBreaker : '# ',
fileDelimeter : '\n',
urlElementResources : process.env.urlElementResources!,
urlElementDescriptions : process.env.urlElementDescriptions!,

Expand Down
5 changes: 4 additions & 1 deletion src/managers/dataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default class dataManager {

// >

// add project->readme to subject->ecosystem->topic->projects //
// add properties to subject->ecosystem->topic->projects //

this._data[subject]['ecosystem'][t]['projects'].push(readmeHyperlink);

}
Expand All @@ -73,6 +74,7 @@ export default class dataManager {

}


}

// >
Expand All @@ -84,4 +86,5 @@ export default class dataManager {

getData(): Data {return this._data;}


}
50 changes: 21 additions & 29 deletions src/managers/markdownManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import markdownConfig from '../configs/markdownManagerConfig';

export default class markdownManager {


private readonly _elementResources: ElementResources;
private readonly _elementDescriptions: ElementDescriptions;

Expand All @@ -36,6 +35,7 @@ export default class markdownManager {
var properties: Properties = {};
var currentSubject: string = '';
var extractedProperty: string = '';

for (const line of file.split(markdownConfig.fileDelimeter)) {

if (markdownConfig.propertyRegexes['subject'].test(line)) {
Expand Down Expand Up @@ -68,7 +68,7 @@ export default class markdownManager {

'url' : url,
'name' : extractedProperty,
'hyperlink' : `[${extractedProperty}](${url})`
'hyperlink' : `[\`${extractedProperty}\`](${url})`

};

Expand All @@ -94,47 +94,39 @@ export default class markdownManager {
const resource: string[] = this._elementResources?.[element];
const description: string = this._elementDescriptions?.[element];

const readme: string = [

// (title, subject, topic) <
`# [${octokitConfig.owner}](${octokitConfig.tree})`,
topic ? `/[${subject.name}](${subject.url})` : `/${subject.name}`,
topic ? `/${topic.name}` : undefined,
return [

// >

// (description, breaker) <
description ? `\n> ${description}` : undefined,
// header <
`# [${octokitConfig.owner}](${octokitConfig.tree})`
+ (topic ? `/[${subject.name}](${subject.url})` : `/${subject.name}`)
+ (topic ? `/${topic.name}` : ''),
description ? `\n> ${description}` : '',
markdownConfig.bigBreaker,

// >

// (ecosystem, breaker) <
(ecosystem.length > 0) ? `## Ecosystem\n` : undefined,
(ecosystem.length > 0) ? ecosystem?.join(' ') : undefined,
(ecosystem.length > 0) ? markdownConfig.smallBreaker : undefined,
// ecosystem? <
(ecosystem.length > 0) ? '## Ecosystem\n\n' : '',
(ecosystem.length > 0) ? ecosystem?.join(' ') : '',
(ecosystem.length > 0) ? markdownConfig.smallBreaker : '',

// >

// (projects, breaker) <
(projects.length > 0) ? '## Experience\n' : undefined,
(projects.length > 0) ? projects.join(' ') : undefined,
resource ? markdownConfig.smallBreaker : markdownConfig.bigBreaker,
// experience? <
(projects.length > 0) ? '## Experience\n\n' : '',
(projects.length > 0) ? projects.join(' ') : '',
resource ? markdownConfig.smallBreaker : '',

// >

// (resources, breaker) <
resource ? '\n## Resources\n' : undefined,
resource ? resource.join('\n') : undefined,
resource ? markdownConfig.bigBreaker : undefined
// footer <
resource ? '## Resources' : '',
resource ? resource.join('\n') : '',
`\n${markdownConfig.bigBreaker}`

// >

].join('');

// >

return readme;
].join('\n');

}

Expand Down

0 comments on commit 0e4393c

Please sign in to comment.