Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dispherical/gitme


https://github.com/dispherical/gitme

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

GitME, the GitHub README generator.


What is GitME?


GitME is a README.md generator built with Node.js and Markdown, and you can render files using EJS, or Nunjucks.
You can get data from the data folder, such as making requests to an extenal API, generating random numbers, etc.


There are currently two files which the demo uses to set metadata and make sample icons that you can use in your README file,
like the Node.js icon or the golang icon. You can fnd the full list of icons in data/icons.js.


How does it work?


GitME will render the README.md file, then, GitME will push the rendered README file to your repo using Node.js and GitHub actions.


How do you get started?



  1. Click the “Use this template” on this repo.

  2. Make the repo name Username/Username. For example, if your username is johndoe, then your repo would be called johndoe.
    Note: If you already have a repo with your username, then rename it to something else, then repeat steps 1 and 2.

  3. Pull the repo locally, make changes, and push them to your repo. Or, you could use the Standard built-in GitHub editor.

  4. Set your ENV vars. Leave the GH_TOKEN alone as that allows GitME to push your README file.


name: gitme

on: [push]
jobs:
gitme-compile-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- run: npm install
- run: node index.js
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this alone!
REPO: username/repo # replace with your username and repo, keep the "/"
BRANCH: main # Or whatever branch you want to use
EMAIL: [email protected] # The email you use for Git Commits.
NAME: aboutDavid # Your name or username

How do you get data from stuff like APIs?


If you know about how 11ty and the _data file works, you can skip this as it is processed the same way/



  1. Make a file in the data folder. The name of that file (minus the .js) will be what you refer to it as.
    For example, if you made a file called test.js, what you will refer to it as in your template file would be test. For this example, lets make it test.js.

  2. Let’s export a sample object with some data:


module.exports = {

sample: "Hello World!"
};

Great, we now have some data!



  1. Lets get it in our template. By default, GitME will render the index.md file using ejs.
    In the config.js, you can change renderEngine to nunjucks if you want to. Here are some ways you can access the demo file:


Nunjucks:


# {{ text.sample }}


EJS:


# <%= text.sample %>


Both of them would render:


Hello World!


as you can use markdown.