Skip to content

Commit 9c6a555

Browse files
Oleksandr Kulkovadamant-pwn
Oleksandr Kulkov
authored andcommitted
Make contrib.md a symlink to CONTRIBUTING.md
1 parent 1f0aeb3 commit 9c6a555

File tree

2 files changed

+160
-160
lines changed

2 files changed

+160
-160
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

CONTRIBUTING.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# How to Contribute
2+
3+
## General information
4+
5+
This website (articles, design, ...) is developed via [Github](https://github.com/e-maxx-eng/e-maxx-eng). And everybody is welcome to help out. All you need is a Github account.
6+
7+
Generated pages are compiled and published at [https://cp-algorithms.com](https://cp-algorithms.com).
8+
9+
In order to make contribution consider the following steps:
10+
11+
1. Go to an article that you want to change, and click the pencil icon :material-pencil: next to the article title.
12+
2. Fork the repository if requested.
13+
3. Modify the article.
14+
4. Use the [preview page](preview.md) to check if you are satisfied with the result.
15+
5. Make a commit by clicking the _Propose changes_ button.
16+
6. Create a pull-request by clicking the _Compare & pull request_ button.
17+
7. Somebody from the core team will look over the changes. This might take a few hours/days.
18+
19+
In case you want to make some bigger changes, like adding a new article, or edit multiple files, you should fork the project in the traditional way, create a branch, modify the files in the Github UI or locally on your computer, and create a pull-request.
20+
If you are unfamiliar with the workflow, read [Step-by-step guide to contributing on GitHub](https://www.dataschool.io/how-to-contribute-on-github/).
21+
22+
If you're making a new article or moving existing one to a different place, please make sure that your changes are reflected in
23+
24+
- The list of all articles in [navigation.md](https://github.com/e-maxx-eng/e-maxx-eng/blob/master/src/navigation.md);
25+
- The list of new articles in [index_body](https://github.com/e-maxx-eng/e-maxx-eng/blob/master/src/index_body) (if it is a new article).
26+
27+
## Syntax
28+
29+
We use [Markdown](https://daringfireball.net/projects/markdown) for the articles, and use the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) to render the Markdown articles into HTML.
30+
31+
For advanced Markdown features of Material for MkDocs see their [reference pages](https://squidfunk.github.io/mkdocs-material/reference/formatting), like:
32+
33+
- [Math formulas with MathJax](https://squidfunk.github.io/mkdocs-material/reference/mathjax/#usage)
34+
Notice that you need to have an empty line before and after a `$$` math block.
35+
- [Code blocks](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#usage) for code snippets.
36+
- [Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#usage) (e.g. to decor theorems, proofs, problem examples).
37+
- [Content tabs](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/#usage) (e.g. for code examples in several languages).
38+
- [Data tables](https://squidfunk.github.io/mkdocs-material/reference/data-tables/#usage).
39+
40+
However not everything of the features should be used, and some of the features are not enabled or require a paid subscription.
41+
42+
To distinguish original and translatory articles, they should be marked with corresponding tags. For original articles, it's
43+
44+
```md
45+
---
46+
tags:
47+
- Original
48+
---
49+
```
50+
51+
And for translated articles, it's
52+
53+
```md
54+
---
55+
tags:
56+
- Translated
57+
e_maxx_link: ...
58+
---
59+
```
60+
61+
Here, instead of `...` one should place the last part of the link to the original article. E.g. for [Euler function article](http://e-maxx.ru/algo/euler_function) it should be
62+
63+
64+
```md
65+
---
66+
tags:
67+
- Translated
68+
e_maxx_link: euler_function
69+
---
70+
```
71+
72+
By default the first header (`# header`) will be also the HTML title of the article. In case the header contains a math formula, you can define a different HTML title with:
73+
74+
```markdown
75+
---
76+
tags:
77+
- ...
78+
title: Alternative HTML title
79+
---
80+
# Proof of $a^2 + b^2 = c^2$
81+
82+
remaining article
83+
```
84+
85+
86+
87+
## Some conventions
88+
89+
* We have agreed as of issue [#83](https://github.com/e-maxx-eng/e-maxx-eng/issues/83) to express binomial coefficients with `\binom{n}{k}` instead of `C_n^k`. The first one renders as $\binom{n}{k}$ and is a more universal convention. The second would render as $C_n^k$.
90+
91+
## Adding Problems
92+
93+
Try to add problems in ascending order of their difficulty. If you don't have enough time to do so, still add the problem. Lets hope that the next person will sort them accordingly.
94+
95+
## Local development
96+
97+
You can render the pages locally. All you need is Python, with the installed `mkdocs-material` package.
98+
99+
```console
100+
$ git clone --recursive https://github.com/e-maxx-eng/e-maxx-eng.git && cd e-maxx-eng
101+
$ scripts/install-mkdocs.sh # requires pip installation
102+
$ mkdocs serve
103+
```
104+
105+
Note that some features are disabled by default for local builds.
106+
107+
### Git revision date plugin
108+
109+
Disabled because it might produce errors when there are uncommitted changes in the working tree.
110+
111+
To enable it, set the environment variable `MKDOCS_ENABLE_GIT_REVISION_DATE` to `True`:
112+
113+
```console
114+
$ export MKDOCS_ENABLE_GIT_REVISION_DATE=True
115+
```
116+
117+
### Git committers plugin
118+
119+
Disabled because it takes a while to prepare and also requires Github personal access token to work with Github APIs.
120+
121+
To enable it, set the environment variable `MKDOCS_ENABLE_GIT_COMMITTERS` to `True` and store your personal access token in the environment variable `MKDOCS_GIT_COMMITTERS_APIKEY`. You can generate the token [here](https://github.com/settings/tokens). Note that you only need the public access, so you shouldn't give the token any permissions.
122+
123+
```console
124+
$ export MKDOCS_ENABLE_GIT_COMMITTERS=True
125+
$ export MKDOCS_GIT_COMMITTERS_APIKEY= # put your PAT here
126+
```
127+
128+
## Tests
129+
130+
If your article involves code snippets, then it would be great you also contribute tests for them.
131+
This way we can make sure that the snippets actually work, and don't contain any bugs.
132+
133+
Creating tests works like this:
134+
You have to name each snippet that you want to test in the markdown article:
135+
136+
```{.cpp file=snippet-name}
137+
// some code
138+
```
139+
140+
In the directory `test` you find a script `extract_snippets.py` that you can run.
141+
This script extracts from every article all named snippets, and puts them in C++ header files: `snippet-name.h`
142+
In the folder you can create a cpp file, that includes these snippets headers, and tests their behaviour.
143+
If the snippets don't work, the test program should return 1 instead of 0.
144+
145+
You can run all tests with the script `test.sh`.
146+
147+
```console
148+
$ cd test
149+
$ ./test.sh
150+
Running test_aho_corasick.cpp - Passed in 635 ms
151+
Running test_balanced_brackets.cpp - Passed in 1390 ms
152+
Running test_burnside_tori.cpp - Passed in 378 ms
153+
...
154+
Running test_vertical_decomposition.cpp - Passed in 2397 ms
155+
156+
51 PASSED in 49.00 seconds
157+
```
158+
159+
Also, every pull-request will automatically tested via [Github Actions](https://github.com/e-maxx-eng/e-maxx-eng/actions).

src/contrib.md

Lines changed: 0 additions & 159 deletions
This file was deleted.

src/contrib.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CONTRIBUTING.md

0 commit comments

Comments
 (0)