Skip to content

Commit bec4194

Browse files
authored
Update CONTRIBUTING.md
1 parent 7cafe85 commit bec4194

File tree

1 file changed

+54
-9
lines changed

1 file changed

+54
-9
lines changed

CONTRIBUTING.md

+54-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ documentation, we greatly value feedback and contributions from our community.
66
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9-
## Reporting Bugs/Feature Requests
9+
10+
* [Reporting Bugs/Feature Requests](#reporting-bugs--feature-requests)
11+
* [Contributing via Pull Requests](#contributing-via-pull-requests)
12+
* [Finding contributions to work on](#finding-contributions-to-work-on)
13+
* [Adding support for a new Language](#adding-support-for-a-new-language)
14+
* [Ascii logo](#ascii-logo)
15+
* [Project-specific notes](#project-specific-notes)
16+
17+
## Reporting Bugs / Feature Requests
1018

1119
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1220

@@ -38,18 +46,55 @@ To send us a pull request, please:
3846
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
3947
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4048

49+
### Finding contributions to work on
50+
51+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/o2sh/onefetch/labels/help%20wanted) issues is a great place to start.
52+
53+
### Adding support for a new Language
54+
55+
First, you have to make sure that the language you want to add is supported by tokei ([supported languages](https://github.com/XAMPPRocky/tokei#supported-languages))
56+
57+
Adding support for a new Language requires adding a new entry in the `define_language!` macro in [language.rs](https://raw.githubusercontent.com/o2sh/onefetch/master/src/language.rs).
58+
59+
**Example**:
60+
61+
`{ CSharp, "csharp.ascii", "C#", vec![Color::Blue, Color::Magenta], "c#" }`
62+
63+
The first item `CSharp` corresponds to the name of the language as defined in tokei. The second item `csharp.ascii` is the name of the file containing the ascii logo, this file has to be placed in the _./resources_ folder (more info below). The third item `C#` is the display name. Then we have the colors `vec![Color::Blue, Color::Magenta]` used to customize the look of the ascii logo when displayed to the screen. The last item `c#` is required only if the Enum name `CSharp` doesn't match the display name `C#`.
64+
65+
#### Ascii logo
66+
67+
```
68+
{4} _{1} _ _
69+
{4} _|_{1}(_|/ \
70+
{0} o{4}| {1} _|\_/
71+
72+
{0} /\
73+
{0} / \
74+
{0} | |
75+
{0} |{2}NASA{0}|
76+
{0} | |
77+
{0} | |
78+
{0} | |
79+
{0} ' `
80+
{0} | |
81+
{0} | |
82+
{0} |______|
83+
{3} '-`'-` .
84+
{3} / . \'\ . .'
85+
{3} ''( .'\.' ' .;'
86+
{3}'.;.;' ;'.;' ..;;'
87+
```
88+
89+
Remarks:
90+
- Your ascii logo's dimensions must fall below `25*45` (height\*width). The CI will fail otherwise.
91+
- You can use `{N}` to color the ascii which will utilize the vec! of colors defined in `define_language!`
92+
- Make sure to trim any unnecessary trailing whitespaces
93+
4194
### Project-specific notes
4295

4396
- Please ensure your changes are formatted according to `cargo fmt`.
4497
- Do check for linting errors with `cargo clippy`. If you're having trouble with this, feel free to ask for help.
4598
- Documenting your changes in `CHANGELOG.md` (in the Unreleased section) would be awesome, but is not required.
4699
- If you can, try to write some tests for your change (if it addresses a bug) or feature. Again, feel free to ask for help. Our CI will run these tests to ensure your code never breaks with future changes.
47100

48-
## Finding contributions to work on
49-
50-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/o2sh/onefetch/labels/help%20wanted) issues is a great place to start.
51-
52-
## Licensing
53-
54-
See the [LICENSE](https://github.com/o2sh/onefetch/blob/master/LICENSE.md) file for our project's licensing. We will ask you confirm the licensing of your contribution.
55-

0 commit comments

Comments
 (0)