Skip to content

Commit

Permalink
feat: 🎸 Add minimal requirements in template
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael-R committed Aug 18, 2020
1 parent 5235bea commit 1697101
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "readme-template-generator",
"version": "0.7.4",
"version": "0.7.5",
"description": "CLI to help create readme file to document your project",
"private": false,
"repository": {
Expand Down
13 changes: 13 additions & 0 deletions src/commands/readme-template-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ const command: GluegunCommand = {
technologies.push(tech)
}

const requirements: string[] = []

while (true) {
const requirement: string = await question({
message: '🌱 List a minimal requirements to run project (use empty value to skip):'
})

if (!requirement) break

requirements.push(requirement)
}

const features: Types.Features = {
finished: [],
pendent: []
Expand Down Expand Up @@ -310,6 +322,7 @@ const command: GluegunCommand = {
about,
howToUse,
technologies,
requirements,
features,
contribute,
author,
Expand Down
6 changes: 5 additions & 1 deletion src/templates/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<% if (props.images.screenshots.length) {%><%- '</details>'%><% } %>

### 🔖 Table Of Contents
<% if (props.about) {%><%= '\n- 📃 [About](#about)'%><% } %><% if (props.technologies.length) {%><%= '\n- 🤔 [How To Use](#how-to-use)'%><%= '\n- 🚀 [Technologies](#technologies)'%><% } %><% if (props.contribute.tutor.show) {%><% if (props.features.finished.length || props.features.pendent.length) {%><%= '\n- 🎇 [Features](#features)'%><% } %><%= '\n- 💡 [How To Contribute](#how-to-contribute)'%><% } %><% if (props.contribute.contributors.show) {%><%= '\n - 🤗 [Contributors](#contributors)'%><% } %><% if (props.author.exists) {%><%= '\n- 👤 [Author](#author)'%><% } %><% if (props.license.name) {%><%= '\n- 🔏 [License](#license)'%><% } %>
<% if (props.about) {%><%= '\n- 📃 [About](#about)'%><% } %><%= '\n- 🤔 [How To Use](#how-to-use)'%><% if (props.technologies.length) {%><%= '\n- 🚀 [Technologies](#technologies)'%><% } %><% if (props.requirements.length) {%><%= '\n- 🌱 [Minimal Requirements](#minimal-requirements)'%><% } %><% if (props.contribute.tutor.show) {%><% if (props.features.finished.length || props.features.pendent.length) {%><%= '\n- 🎇 [Features](#features)'%><% } %><%= '\n- 💡 [How To Contribute](#how-to-contribute)'%><% } %><% if (props.contribute.contributors.show) {%><%= '\n - 🤗 [Contributors](#contributors)'%><% } %><% if (props.author.exists) {%><%= '\n- 👤 [Author](#author)'%><% } %><% if (props.license.name) {%><%= '\n- 🔏 [License](#license)'%><% } %>

---

Expand All @@ -40,6 +40,10 @@
<% for (tech of props.technologies) {%><%= `- ${tech}\n`%><% } %>
<% if (props.technologies.length) {%><%= '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>

<% if (props.requirements.length) {%><%- '<h2 id="minimal-requirements">🌱 Minimal Requirements</h2>\n\n'%><% } %>
<% for (requirement of props.requirements) {%><%= `- ${requirement}\n`%><% } %>
<% if (props.requirements.length) {%><%= '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>

<% if (props.features.finished.length || props.features.pendent.length) {%><%- '<h2 id="features">🎇 Features</h2>\n\n'%><% } %>
<% for (featureFinished of props.features.finished) {%><%= `- [x] ${featureFinished}\n`%><% } %><% for (featurePendent of props.features.finished) {%><%= `- [ ] ${featurePendent}\n`%><% } %>
<% if (props.features.finished.length || props.features.pendent.length) {%><%- '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
Expand Down

0 comments on commit 1697101

Please sign in to comment.