├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── 1-bug-report.yml
│ ├── 2-feature-request.md
│ └── 3-help.md
├── PULL_REQUEST_TEMPLATE.md
├── gigsboat-2.png
├── gigsboat-screenshot.png
└── workflows
│ └── main.yml
├── .gitignore
├── .husky
├── commit-msg
├── post-merge
├── pre-commit
└── pre-push
├── .prettierrc.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── GENERATE_11ty_STATIC_SITE.md
├── LICENSE
├── README.md
├── SECURITY.md
├── __tests__
├── __fixtures__
│ ├── datafiles
│ │ └── event-ok.md
│ ├── filesglobbing
│ │ └── pages
│ │ │ ├── 2020
│ │ │ └── 2020.md
│ │ │ └── 2021
│ │ │ └── 2021.md
│ └── main-datafiles
│ │ └── myapp
│ │ └── pages
│ │ ├── 2019
│ │ ├── 2019-09-12.md
│ │ ├── 2019-09-15.md
│ │ └── 2019-09-27.md
│ │ └── 2021
│ │ ├── 2021-01-01.md
│ │ ├── 2021-06-13.md
│ │ └── 2021-07-21.md
├── __snapshots__
│ ├── json-formatter.test.js.snap
│ ├── main-e2e.test.js.snap
│ ├── main.test.js.snap
│ ├── md-formatter.test.js.snap
│ └── yaml-parser.test.js.snap
├── config-manager.test.js
├── fs.test.js
├── json-formatter.test.js
├── main-e2e.test.js
├── main.test.js
├── md-formatter.test.js
├── output-handler.test.js
└── yaml-parser.test.js
├── bin
├── cli-parser.js
├── cli.js
├── config-manager.js
└── output-handler.js
├── package-lock.json
├── package.json
└── src
├── main.js
└── utils
├── content-manager.js
├── fs.js
├── json-parser.js
├── md-formatter.js
└── yaml-parser.js
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @lirantal
2 | src/utils/content-manager.js @gep13
3 | src/utils/md-formatter.js @gep13
4 | __tests__/md-formatter.test.js @gep13
5 | __tests__/__snapshots__/md-formatter.test.* @gep13
6 | bin/config-manager.js @gep13
7 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | - **Library Version**:
8 | - **OS**:
9 | - **Node.js Version**:
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/1-bug-report.yml:
--------------------------------------------------------------------------------
1 | name: "🐞 Bug Report"
2 | description: File a bug report
3 | title: "[Bug]: "
4 | labels: ["bug", "triage"]
5 | assignees:
6 | - lirantal
7 | body:
8 | - type: markdown
9 | attributes:
10 | value: |
11 | Thanks for taking the time to fill out this bug report!
12 | - type: textarea
13 | id: expected-behavior
14 | attributes:
15 | label: Expected Behavior
16 | description: What did you expect to happen?
17 | placeholder: Tell us what you see!
18 | value: "A bug happened!"
19 | validations:
20 | required: true
21 | - type: textarea
22 | id: actual-behavior
23 | attributes:
24 | label: Actual Behavior
25 | description: What actually happened?
26 | placeholder: Paste any screenshots that are helpful, but becareful about exposing sensitive information
27 | value: "It didn't work"
28 | validations:
29 | required: true
30 | - type: textarea
31 | id: reproduce
32 | attributes:
33 | label: Steps to reproduce
34 | description: How can we reproduce this issue?
35 | value: |
36 | 1. npm install cli
37 | 2. ...
38 | 3. ...
39 | render: markdown
40 | validations:
41 | required: true
42 | - type: textarea
43 | id: possible-solution
44 | attributes:
45 | label: Suggest a solution
46 | description: Would you like to suggest a solution for how this should be solved?
47 | validations:
48 | required: false
49 | - type: dropdown
50 | id: node-version
51 | attributes:
52 | label: Which Node.js version are you using?
53 | multiple: false
54 | options:
55 | - Node.js 10
56 | - Node.js 12
57 | - Node.js 14
58 | - Node.js 16
59 | - Node.js 18
60 | - type: textarea
61 | id: logs
62 | attributes:
63 | label: Relevant log output
64 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. Please scrutinize input to avoid potentially leaking and exposing sensitive information.
65 | render: shell
66 | - type: checkboxes
67 | id: terms
68 | attributes:
69 | label: Code of Conduct
70 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
71 | options:
72 | - label: I agree to follow this project's Code of Conduct
73 | required: true
74 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2-feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F680 Feature request"
3 | about: Suggest an idea for this project
4 | ---
5 |
6 |
11 |
12 | **Is your feature request related to a problem? Please describe.**
13 | Please describe the problem you are trying to solve.
14 |
15 | **Describe the solution you'd like**
16 | Please describe the desired behavior.
17 |
18 | **Describe alternatives you've considered**
19 | Please describe alternative solutions or features you have considered.
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/3-help.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "⁉️ Need help?"
3 | about: Please describe the problem.
4 | ---
5 |
6 |
9 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 |
7 | ## Types of changes
8 |
9 |
10 |
11 | - [ ] Bug fix (non-breaking change which fixes an issue)
12 | - [ ] New feature (non-breaking change which adds functionality)
13 | - [ ] Breaking change (fix or feature that would cause existing functionality to change)
14 |
15 | ## Related Issue
16 |
17 |
18 |
19 |
20 |
21 |
22 | ## Motivation and Context
23 |
24 |
25 |
26 | ## How Has This Been Tested?
27 |
28 |
29 |
30 |
31 |
32 |
33 | ## Screenshots (if appropriate):
34 |
35 | ## Checklist:
36 |
37 |
38 |
39 |
40 | - [ ] I have updated the documentation (if required).
41 | - [ ] I have read the **CONTRIBUTING** document.
42 | - [ ] I have added tests to cover my changes.
43 | - [ ] All new and existing tests passed.
44 | - [ ] I added a picture of a cute animal cause it's fun
45 |
--------------------------------------------------------------------------------
/.github/gigsboat-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gigsboat/cli/5d233efdcfdef10040760ebcde0a16ac2a9a1d41/.github/gigsboat-2.png
--------------------------------------------------------------------------------
/.github/gigsboat-screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gigsboat/cli/5d233efdcfdef10040760ebcde0a16ac2a9a1d41/.github/gigsboat-screenshot.png
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build:
7 | strategy:
8 | matrix:
9 | platform: [ubuntu-latest]
10 | node: ['14', '16']
11 | name: Node ${{ matrix.node }} (${{ matrix.platform }})
12 | runs-on: ${{ matrix.platform }}
13 | steps:
14 | - uses: actions/checkout@v1
15 | - uses: actions/setup-node@v1
16 | with:
17 | node-version: ${{ matrix.node }}
18 | - name: install dependencies
19 | run: yarn install --frozen-lockfile --ignore-engines
20 | - name: lint code
21 | run: npm run lint
22 | - name: run tests
23 | run: npm run test
24 | - name: get code coverage report
25 | run: npx codecov
26 | env:
27 | CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
28 |
29 | release:
30 | name: do semantic release
31 | runs-on: 'ubuntu-latest'
32 | environment: publish
33 | needs: build
34 | steps:
35 | - uses: actions/checkout@v1
36 | - uses: actions/setup-node@v1
37 | with:
38 | node-version: '16'
39 | - name: install dependencies
40 | run: yarn install --frozen-lockfile --ignore-engines
41 | - name: release
42 | run: npx semantic-release
43 | env:
44 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
45 | NPM_TOKEN: ${{secrets.NPM_TOKEN}}
46 | if: github.event_name == 'push' && github.ref == 'refs/heads/main'
47 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 | .env.test
60 |
61 | # parcel-bundler cache (https://parceljs.org/)
62 | .cache
63 |
64 | # next.js build output
65 | .next
66 |
67 | # nuxt.js build output
68 | .nuxt
69 |
70 | # vuepress build output
71 | .vuepress/dist
72 |
73 | # Serverless directories
74 | .serverless/
75 |
76 | # FuseBox cache
77 | .fusebox/
78 |
79 | # DynamoDB Local files
80 | .dynamodb/
81 |
82 | # Snyk Code
83 | .dccache
84 |
85 | # Developing on a Mac
86 | .DS_Store
87 |
88 | # Project files
89 | README.json
90 | README-gigs*.*
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx --no-install commitlint --edit ""
5 |
--------------------------------------------------------------------------------
/.husky/post-merge:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npm install
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx --no-install lint-staged
5 |
--------------------------------------------------------------------------------
/.husky/pre-push:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npm run lint && npm run test
5 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "tabWidth": 2,
3 | "singleQuote": true,
4 | "semi": false,
5 | "trailingComma": "none",
6 | "useTabs": false,
7 | "bracketSpacing": true
8 | }
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | education, socio-economic status, nationality, personal appearance, race,
10 | religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | - Using welcoming and inclusive language
18 | - Being respectful of differing viewpoints and experiences
19 | - Gracefully accepting constructive criticism
20 | - Focusing on what is best for the community
21 | - Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | - The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | - Trolling, insulting/derogatory comments, and personal or political attacks
28 | - Public or private harassment
29 | - Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | - Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at liran.tal@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4 |
5 | The following is a set of guidelines for contributing to @gigsboat/cli.
6 | These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
7 |
8 | ## Code of Conduct
9 |
10 | This project and everyone participating in it is governed by a [Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
11 |
12 | ## How to contribute to @gigsboat/cli
13 |
14 |
15 |
16 | ### Tests
17 |
18 | Make sure the code you're adding has decent test coverage.
19 |
20 | Running project tests and coverage:
21 |
22 | ```bash
23 | npm run test
24 | ```
25 |
26 | ### Commit Guidelines
27 |
28 | The project uses the commitizen tool for standardizing changelog style commit and a git pre-commit hook to enforce them.
29 |
--------------------------------------------------------------------------------
/GENERATE_11ty_STATIC_SITE.md:
--------------------------------------------------------------------------------
1 | # Generating a static site with 11ty
2 |
3 | 11ty is a very flexible static site generator, with loads of different templating and layout options. Below are some instructions to get you started but check the [11ty docs](https://www.11ty.dev/docs/getting-started/) for further customisation.
4 |
5 | ## To create the 11ty starter
6 | 1. Create a file name `.eleventy.js` at the root of your project
7 | 1. Start with some basic config:
8 | ```
9 | const GIGSBOAT_INPUT_DIR = 'gigsboat-eleventy-starter'
10 |
11 | module.exports = function(eleventyConfig) {
12 | const markdownIt = require('markdown-it')
13 | const options = { html: true }
14 |
15 | eleventyConfig.setLibrary('md', markdownIt(options).use(require('markdown-it-anchor'), { permalink: false }))
16 |
17 | eleventyConfig.addPassthroughCopy(`${GIGSBOAT_INPUT_DIR}/styles.css`)
18 |
19 | return {
20 | dir: { input: GIGSBOAT_INPUT_DIR }
21 | }
22 | }
23 | ```
24 | 1. Create a directory `gigsboat-eleventy-starter` where your 11ty starter files will live
25 | 1. In the `gigsboat-eleventy-starter` directory create a file `index.json` and declare your layout file name
26 | `{ "layout": "gigsboat-layout" }`
27 | 1. Create a file `styles.css` and add some basic css
28 | ```
29 | :root {
30 | --nightrider-gray: #333;
31 | --white-smoke: #eee;
32 | --blue: #0ff;
33 | --cornflower-blue: #539bf5;
34 | }
35 |
36 | @media (prefers-color-scheme: light) {
37 | :root {
38 | --color-bg: var(--white-smoke);
39 | --color-text: var(--nightrider-gray);
40 | --color-link: var(--cornflower-blue);
41 | }
42 | }
43 | @media (prefers-color-scheme: dark) {
44 | :root {
45 | --color-bg: var(--nightrider-gray);
46 | --color-text: var(--white-smoke);
47 | --color-link: var(--cornflower-blue);
48 | }
49 | }
50 |
51 | * {
52 | box-sizing: border-box;
53 | }
54 |
55 | html,
56 | body {
57 | padding: 0;
58 | margin: 0;
59 | font-family: -apple-system, system-ui, sans-serif;
60 | color: var(--color-text);
61 | background-color: var(--color-bg);
62 | }
63 |
64 | main {
65 | max-width: calc(900px - (20px * 2));
66 | margin: 0 auto;
67 | padding-right: 20px;
68 | padding-left: 20px;
69 | }
70 |
71 | p:last-child {
72 | margin-bottom: 0;
73 | }
74 |
75 | a {
76 | color: var(--color-link);
77 | text-decoration: none;
78 | }
79 |
80 | a:hover {
81 | text-decoration: underline;
82 | }
83 |
84 | table {
85 | border-collapse: collapse;
86 | }
87 |
88 | table td,
89 | table th {
90 | border: 1px solid var(--color-text);
91 | padding: 5px;
92 | text-align: left;
93 | }
94 | ```
95 | 1. Create a new directory named `_includes` (this is the default name where 11ty looks for layout files) and in that directory create a file named `gigsboat-layout.liquid`
96 | 1. In the `gigsboat-layout.liquid` file add the code for a basic template and edit as you wish.
97 | ```
98 | ---
99 | title: Public Speaking
100 | ---
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | {{ title }}
110 | {% if description %}
111 |
112 | {% endif %}
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 | {% block content %}
122 | {{ content }}
123 | {% endblock %}
124 |
125 |
126 |
127 | ```
128 | That's it! Your gigsboat 11ty starter is ready
129 |
130 | ## To generate the html
131 | After you run `npx @gigsboat/cli` and your markdown file is generated
132 |
133 | Run
134 | ```bash
135 | cp README.md gigsboat-eleventy-starter/index.md
136 | npx @11ty/eleventy
137 | ```
138 |
139 | The above will copy your generated README file into the `gigsboat-eleventy-starter` directory and then run 11ty to generate your html.
140 |
141 | Your newly generated html and css files will be in a new directory rceated by 11ty named `_site`. If desired you can define a different output directory name in *.eleventy.js*
142 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | https://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | Copyright 2021 Liran Tal .
180 |
181 | Licensed under the Apache License, Version 2.0 (the "License");
182 | you may not use this file except in compliance with the License.
183 | You may obtain a copy of the License at
184 |
185 | https://www.apache.org/licenses/LICENSE-2.0
186 |
187 | Unless required by applicable law or agreed to in writing, software
188 | distributed under the License is distributed on an "AS IS" BASIS,
189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190 | See the License for the specific language governing permissions and
191 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | @gigsboat/cli
3 |
4 |
5 |
6 | Do you have a boatload of speaking gigs?
7 |
8 | Use the gigsboat CLI to manage them all via GitHub in the open source way!
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | # The Hook
26 |
27 | Track your speaking activities all within your GitHub opensource repository!
28 |
29 | Here is how [I'm doing it](https://github.com/lirantal/public-speaking):
30 |
31 | 
32 |
33 |
34 | # About
35 |
36 | - Are you a Developer Advocate 🥑 ?
37 | - Enjoy doing conference talks, meetups presentations, or joining a podcast?
38 | - Do you have a boatload of speaking gigs?
39 |
40 | Gigsboat is for you because:
41 | - It is difficult for you to keep track of all of your gigs
42 | - You want some stats and hard cold data for all of your speaking engagements
43 |
44 | Welcome to gigsboat ⛵️ 🎉
45 |
46 | ## Why gigsboat?
47 |
48 | Even more reasons to use Gigsboat:
49 |
50 | - **You own your data** - do you use a 3rd-party app, or tool to manage your talks? Maybe a Trello board? With gigsboat, you own and manage your data via YAML files, and gigsboat is here to help you transform that into a beautiful Markdown page.
51 |
52 | - **It's all open source** - Well, gigsboat is open source but also all of your speaking activities, they're all open source and all managed right here in GitHub where it's easy to manage your talks, just like you manage your code projects. It's all transparent and you can share it with your friends, conference organizers, and so on.
53 |
54 | - **Zero config** - just run the CLI tool and it'll automatically detect source files, and generate a Markdown document for you with all of them.
55 |
56 | - **Statistics** - gigsboat runs some numbers crunching and gives you stats about your speaking engagements!
57 |
58 | # How does it work?
59 |
60 | 1. You run the CLI
61 | 2. It finds your events' data files
62 | 3. It parses them into JSON
63 | 4. It extracts, and sorts the data in all kinds of way
64 | 5. Exports the JSON into Markdown format
65 | 6. Results are printed to STDOUT or to a `README.md` file
66 | 7. You now have a fancy looking Markdown document that lists all of your events
67 |
68 | # How to get started?
69 |
70 | ## Option 1: Zero-to-Hero in a heartbeat!
71 |
72 | We have a template repository for you to get started in a matter of seconds! 🚤
73 |
74 | Head over to the [gigs-template](https://github.com/gigsboat/gigs-template) repository which we created as a template for you to quickly get started. It's just a few steps, and you can start tracking all of your speaking engagements.
75 |
76 | If you would like to know the gritty details of how the gigsboat CLI works, continue to read for the _starting from scratch_ section.
77 |
78 | ## Option 2: Starting from scratch
79 |
80 | If you're just getting started tracking your events and you don't have any actual data files that hold the history of your events (or your upcoming events), then this section is for you.
81 |
82 | It boils down to the following:
83 | 1. You need a directory structure (any structure you choose) with data files inside it
84 | 2. Those data files need to be in [YAML Front Matter format](https://docs.zettlr.com/en/core/yaml-frontmatter/#:~:text=A%20YAML%20frontmatter%20is%20a,%2C%20keywords%2C%20and%20the%20title.&text=They%20contain%20valid%20YAML%20and%20can%20be%20used%20to%20define%20arbitrary%20variables.). Those YAML files need to have a specific format.
85 |
86 | Now, let's break it down further to give you example code you can get started with.
87 |
88 | ### 1. Directory structure
89 |
90 | You are probably going to manage it all via a repository, so once you have one created, here's a suggested directory structure:
91 |
92 | ```
93 | - gigsboat.json
94 | - pages
95 | |
96 | - 2020
97 | |
98 | - 2020-02-03.md
99 | - 2020-06-03.md
100 | - 2021
101 | |
102 | - 2021-11-26.md
103 | ```
104 |
105 | In the above we are nesting all of the data files under `pages//` directories.
106 |
107 | You are free to create whatever directory structure that makes sense for you, but note that `gigsboat` will by default search the data files under the `pages` root directory in which it runs.
108 |
109 | The `gigsboat.json` file is used as a configuration file for the gigsboat cli.
110 |
111 | Note: the data filenames can be anything. In this example, it shows a simple date format of `yyyy-mm-dd` however that may not always work - for example, when you have two speaking engagements (a podcast recording, and a meetup talk) on the same day. That said, the filename doesn't matter at all, and you can then follow a convention, of say, `2021-11-26-2.md` which adds a suffix of incrementing numbers to the day.
112 |
113 | ### 2. YAML Front Matter
114 |
115 | The data files are markdown, but they need to have the following YAML Front Matter format:
116 |
117 | ```md
118 | ---
119 | date: 2019-05-30
120 | tags: post
121 | name: OWASP Global AppSec
122 | url: https://telaviv.appsecglobal.org/
123 | type: conference
124 | title: Black Clouds Silver Linings In Nodejs Security
125 | slides_url: https://drive.google.com/file/d/1s0YIvnlF7ByoESu3rHV2i5M9_jQSXjyR/view
126 | recording_url: https://www.youtube.com/watch?v=4XdF4OiAAzU&feature=emb_logo&ab_channel=OWASP
127 | city: Tel Aviv
128 | country: Israel
129 | country_code: IL
130 | language: English
131 | recognitions:
132 | twitter:
133 | - https://twitter.com/_r3ggi/status/1134057317538942978
134 | image_header: https://pbs.twimg.com/media/D7z7G5dXsAA3ulw?format=jpg&name=small
135 | images:
136 | - https://pbs.twimg.com/media/D7z7G5dXsAA3ulw?format=jpg&name=small
137 | ---
138 | ```
139 |
140 | For brevity, the above also includes example values to each of the field so that the schema for the data files is easily understood.
141 |
142 | You can save this data file as say `2019-05-30.md` in your `pages/` directory somewhere. As you can see, there's a dedicated `date` field, which `gigsboat` will parse and is the reason that the filename convention doesn't actually matter.
143 |
144 | You might wonder why is this referred to as a markdown file? because the front matter piece of it all the YAML structure between the opening and closing `---`, after which, it can have a markdown-formatted content, so you can treat it as a markdown document for any purpose. Some ideas: you may want to capture your own personal notes of that event, maybe add pictures, add your summary and so on.
145 |
146 | #### type property
147 |
148 | There are currently 6 supported values for the `type` property within the YAML Front Matter. The gigsboat cli will count how many of each of these exist, and create a badge with that count on the generated README.md file.
149 |
150 | These values are:
151 |
152 | * conference
153 | * podcast
154 | * webinar
155 | * meetup
156 | * article
157 | * workshop
158 |
159 | It is possible to use any free form text in the type property, however, when these aren't matched against the above, they will be counted in a fallback type called 'other'.
160 |
161 | ### gigsboat.json
162 |
163 | This is the configuration file for the gigsboat CLI. This contains four sections:
164 |
165 | * `input`
166 | * `sourceDirectory` - this is the relative path to the directory in which the data files for the generated file are located
167 | * `output`
168 | * `markdownFile` - this is the name of the file that should be generated
169 | * `preContent` - a collection of raw or formatted HTML to place at the start of the generated file
170 | * `postContent` - a collection of raw or formatted HTML to place at the end of the generated file
171 |
172 | A complete example of this configuration file:
173 |
174 | ```json
175 | {
176 | "input": {
177 | "sourceDirectory": "pages"
178 | },
179 | "output": {
180 | "markdownFile": "README-gigs.md"
181 | },
182 | "preContent": [
183 | {
184 | "raw": "
This will appear at the top of the generated README.md file
"
185 | },
186 | {
187 | "raw": "
Let's add some badges!
"
188 | },
189 | {
190 | "format": [
191 | {
192 | "ul": [
193 | "In addition to raw HTML elements, you can use format sections",
194 | "Using HTML elements to construct the output"
195 | ]
196 | }
197 | ]
198 | }
199 | ],
200 | "postContent": [
201 | {
202 | "raw": "
This will appear at the bottom of the generated README.md file