-
- Notifications
You must be signed in to change notification settings - Fork 1
README templating prerequisites #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits Select commit Hold shift + click to select a range
86e94bb add reusable readme building blocks
4e4525a add readme generating scripts and make shortcut
bdf112d add GitHub Action readme checking workflow
fe05916 fix: re-enable ci badge
6f67d57 Update template/.readme/partials/borrowed/footer.md.j2.j2
vsupalov d91bc67 Update template/.readme/partials/borrowed/footer.md.j2.j2
vsupalov a4bfcda Update template/.readme/partials/borrowed/footer.md.j2.j2
vsupalov ddb8a58 Update template/.readme/partials/borrowed/footer.md.j2.j2
vsupalov ded1e25 fix operator naming
416b3b8 reference nightly and stable docs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## Documentation | ||
| | ||
| The documentation for this operator can be found [here](https://docs.stackable.tech/{{operator_name}}/stable/index.html). | ||
| | ||
| The documentation for all Stackable products can be found at [docs.stackable.tech](https://docs.stackable.tech). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| ## About The Stackable Data Platform | ||
| | ||
| This operator is written and maintained by [Stackable](https://www.stackable.tech) and it is part of a larger platform. | ||
vsupalov marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
|  | ||
| | ||
| Stackable makes it easy to operate data applications in any Kubernetes cluster. | ||
| | ||
| The data platform offers many operators, new ones being added continuously. All our operators are designed and built to be easily interconnected and to be consistent to work with. | ||
| | ||
| Stackable GmbH is the company behind the Stackable Data Platform. Offering professional services, paid support plans and development. | ||
vsupalov marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| We love open-source! | ||
| | ||
| ## Supported Platforms | ||
| | ||
| We develop and test our operators for the following cloud platforms: | ||
vsupalov marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| * Kubernetes 1.21-1.24 | ||
| * EKS on Amazon Web Services (AWS) | ||
| * GKE on Google Cloud Platform (GCP) | ||
| * AKS on Microsoft Azure | ||
| * K3s | ||
| | ||
| We are currently working to support: | ||
| | ||
| * OpenShift | ||
| | ||
| ## Other Operators | ||
| | ||
| These are the Operators currently part of the Stackable Data Platform: | ||
vsupalov marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| - [Apache Airflow Operator](https://github.com/stackabletech/airflow-operator) | ||
| - [Apache Druid Operator](https://github.com/stackabletech/druid-operator) | ||
| - [Apache HBase Operator](https://github.com/stackabletech/hbase-operator) | ||
| - [Apache Hadoop HDFS Operator](https://github.com/stackabletech/hdfs-operator) | ||
| - [Apache Hive Operator](https://github.com/stackabletech/hive-operator) | ||
| - [Apache Kafka Operator](https://github.com/stackabletech/kafka-operator) | ||
| - [Apache NiFi Operator](https://github.com/stackabletech/nifi-operator) | ||
| - [Apache Spark Operator](https://github.com/stackabletech/spark-k8s-operator) | ||
| - [Apache Superset Operator](https://github.com/stackabletech/superset-operator) | ||
| - [Trino Operator](https://github.com/stackabletech/trino-operator) | ||
| - [Apache ZooKeeper Operator](https://github.com/stackabletech/zookeeper-operator) | ||
| - [OpenPolicyAgent Operator](https://github.com/stackabletech/opa-operator) | ||
vsupalov marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ## Contributing | ||
| | ||
| Contributions are welcome. Follow our [Contributors Guide](https://docs.stackable.tech/home/stable/contributor/index.html) to learn how you can contribute. | ||
| | ||
| ## License | ||
| | ||
| [Open Software License version 3.0](./LICENSE). | ||
| | ||
| ## Support | ||
| | ||
| You can use this project under different licenses. Get started with the community edition! If you want professional support, [we offer subscription plans](https://stackable.tech/en/plans/). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <p align="center"> | ||
| <img width="150" src="./.readme/static/borrowed/Icon_Stackable.svg" alt="Stackable Logo"/> | ||
| </p> | ||
| | ||
| <h1 align="center">{{title}}</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [](https://ci.stackable.tech/job/{{operator_name}}%2doperator%2dit%2dnightly) | ||
| [](https://GitHub.com/stackabletech/{{operator_name}}-operator/graphs/commit-activity) | ||
| [](https://docs.stackable.tech/home/stable/contributor/index.html) | ||
| [](./LICENSE) | ||
| | ||
| [Documentation](https://docs.stackable.tech/{{operator_name}}-operator/stable/index.html) {% if quickstart_link %}| [Quickstart]({{quickstart_link}}) {% endif %}| [Stackable Data Platform](https://stackable.tech/) | [Platform Docs](https://docs.stackable.tech/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {%- if related_reading_links -%} | ||
| ## Related Reading | ||
| {% for (text, link) in related_reading_links %} | ||
| * [{{text}}]({{link}}) | ||
| {%- endfor %} | ||
| {%- endif -%} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| """ | ||
| Given the location of a file, trims all trailing blank lines and | ||
| places a single one. Used as post-processing step for README rendering. | ||
| """ | ||
| import re | ||
| import unittest | ||
| | ||
| BLANK_LINE_REGEX_PATTERN = r"^\s*$" | ||
| | ||
| | ||
| def has_trailing_newline(line): | ||
| return line[-1:] == "\n" | ||
| | ||
| | ||
| def process_lines(lines): | ||
| trim_count = 0 | ||
| # trim trailing blank lines | ||
| for line in lines[::-1]: | ||
| if re.match(BLANK_LINE_REGEX_PATTERN, line): | ||
| trim_count += 1 | ||
| else: | ||
| break | ||
| | ||
| cutoff_index = len(lines) - trim_count | ||
| new_lines = lines[:cutoff_index] | ||
| | ||
| # maybe add a newline character to the last sensible line | ||
| if not has_trailing_newline(new_lines[-1]): | ||
| new_lines[-1] = new_lines[-1] + "\n" | ||
| | ||
| # add a trailing blank line without newline | ||
| new_lines.append("") | ||
| return new_lines | ||
| | ||
| | ||
| class TestCoreMethods(unittest.TestCase): | ||
| | ||
| def test_trailing_new_line(self): | ||
| self.assertTrue(has_trailing_newline("something\n")) | ||
| self.assertTrue(has_trailing_newline("\n")) | ||
| self.assertFalse(has_trailing_newline("nope")) | ||
| | ||
| def test_trailing_real_line(self): | ||
| lines = ["bla\n", "useful"] | ||
| processed_lines = process_lines(lines) | ||
| self.assertEqual(len(processed_lines), 3) | ||
| self.assertTrue(has_trailing_newline(processed_lines[0])) | ||
| self.assertTrue(has_trailing_newline(processed_lines[1])) | ||
| self.assertFalse(has_trailing_newline(processed_lines[2])) | ||
| | ||
| def test_lots_of_empties(self): | ||
| lines = ["bla\n", "\n", "\n", "\n", "\n"] | ||
| processed_lines = process_lines(lines) | ||
| self.assertEqual(len(processed_lines), 2) | ||
| self.assertEqual(processed_lines[-1], "") | ||
| | ||
| def test_one_trailing_new_line(self): | ||
| lines = ["bla\n", "\n"] | ||
| processed_lines = process_lines(lines) | ||
| self.assertEqual(len(processed_lines), 2) | ||
| self.assertEqual(processed_lines[-1], "") | ||
| | ||
| def test_one_trailing_blank_line(self): | ||
| lines = ["bla\n", ""] | ||
| processed_lines = process_lines(lines) | ||
| self.assertEqual(len(processed_lines), 2) | ||
| self.assertEqual(processed_lines[-1], "") | ||
| | ||
| | ||
| if __name__ == "__main__": | ||
| # to run tests for this script: | ||
| # python3 -m unittest ensure_one_trailing_newline.py | ||
| | ||
| import sys | ||
| | ||
| if len(sys.argv) != 2: | ||
| print("Usage: {} filename_to_trim".format(sys.argv[0])) | ||
| exit(1) | ||
| | ||
| file_name = sys.argv[1] | ||
| | ||
| lines = [] | ||
| with open(file_name, "r") as f: | ||
| lines = f.readlines() | ||
| | ||
| lines = process_lines(lines) | ||
| | ||
| with open(file_name, "w") as f: | ||
| f.write("".join(lines)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| | ||
| # Check if jinja2 is there | ||
| if ! command -v jinja2 &> /dev/null | ||
| then | ||
| echo "jinja2 could not be found. Use 'pip install jinja2-cli' to install it." | ||
| exit | ||
| fi | ||
| | ||
| SCRIPT_DIR=$(dirname "$0") | ||
| cd "$SCRIPT_DIR/../.readme" | ||
| jinja2 README.md.j2 -o ../README.md | ||
| cd .. | ||
| | ||
| python3 scripts/ensure_one_trailing_newline.py README.md |
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.