You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/contrib.md
+41-62Lines changed: 41 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -7,88 +7,54 @@ hide:
7
7
8
8
## General information
9
9
10
-
We collaborate via means of github.
10
+
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.
11
11
12
12
Generated pages are compiled and published at [https://cp-algorithms.com](https://cp-algorithms.com).
13
13
14
-
And sources (to which you may want to contribute) are [here](http://github.com/e-maxx-eng/e-maxx-eng/tree/master/src).
15
-
16
14
In order to make contribution consider the following steps:
2. Add or modify files in `src` subfolder in Markdown format (you can do this in web-interface of github now).
20
-
3. Make sure you added `<!--?title ... -->` to your page and the corresponding link to main (index) page.
21
-
3. Use [Test-Your-Page form](./preview.html) to check if you are satisfied with the result.
22
-
4. Use `pull-request` feature to send the request for your changes to be merged.
23
-
5. It may take few hours or few days before someone who have admin rights will merge your request. Contact any of admins personally to speed up this process!
24
-
6. After merging it will take about 5 minutes before updated html page will appear at the site.
25
-
26
-
**You may start with this [demo-article](demo-article.md) or even use [its source](https://raw.githubusercontent.com/e-maxx-eng/e-maxx-eng/master/src/contrib.md) as a template for your new article.**
27
-
28
-
Please kindly refer to manuals on using `git` and `github` anywhere over internet. You may also watch this demo video:
16
+
1. Go to an article that you want to change, and click the pencil icon :material-pencil: next to the article title.
17
+
2. Fork the repository if requested.
18
+
3. Modify the article.
19
+
4. Use the [preview page](./preview.html) to check if you are satisfied with the result.
20
+
5. Make a commit by clicking the _Propose changes_ button.
21
+
6. Create a pull-request by clicking the _Compare & pull request_ button.
22
+
7. Somebody from the core team will look over the changes. This might take a few hours/days.
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.
25
+
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/).
33
26
34
-
## Your Authorship is Preserved
27
+
In case you are adding a new article, start by copying some other article in order to have the required header lines, and make sure to link to the article from the main (index.md) page.
35
28
36
-
Some contributors add explicit links to their profiles at the bottom of the translated articles. However it is discouraged and simply not very convenient if the article was edited by several people. Every page has `Page Authors` link in its top - this link leads to the github commit history, so it is always easy to determine or prove the authorship (even of any single line). Just make sure that your GitHub profile (which is mentioned in history) provides enough information about you.
29
+
## Syntax
37
30
38
-
## Source format
31
+
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.
39
32
40
-
We use [Markdown](https://daringfireball.net/projects/markdown) for source texts and
41
-
convert them automatically to HTML.
42
-
Some [extra](https://michelf.ca/projects/php-markdown/extra/) features also could be used.
33
+
For advanced Markdown features of Material for MkDocs see their [reference pages](https://squidfunk.github.io/mkdocs-material/reference/formatting), like:
43
34
44
-
Formulas could be added thanks to `MathJax` library. Simply use `TeX` expressions inside single or double dollar marks `$`, for example:
35
+
-[Math formulas with MathJax](https://squidfunk.github.io/mkdocs-material/reference/mathjax/#usage)
36
+
Notice that you need to have an empty line before and after a `$$` math block.
However not everything of the features should be used, and some of the features are not enabled or require a paid subscription.
51
40
52
41
## Some conventions
53
42
54
43
* 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$.
55
44
56
45
## Adding Problems
57
-
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.
58
-
59
-
## Adding images
60
-
61
-
Small images could be pushed along with texts to the [/img](https://github.com/e-maxx-eng/e-maxx-eng/tree/master/img) subfolder. Let them be in `PNG` format and less than `200kb`. Then you can refer to them inside the article with the tag:
62
-
63
-

64
-
65
-
Here `my-image.png` should be your file name, while `&imgroot&` is some magic which will expand to proper url prefix when shown at the site (so you need not know the precise prefix of github raw data).
66
-
67
-
Larger images should be posted to some image-hosting, like [PostImage](http://postimage.org) or [ImgUr](http://imgur.com/) - they will then give you the url to insert into the page.
68
46
69
-
## Modifying CSS and JS files
70
-
71
-
This is not something you usually need to do, when just writing content. It is rather for exceptional cases there arose necessity to improve general page style or behavior. These files are (due to certain technical reasons) in the other branch of the same github repository: https://github.com/e-maxx-eng/e-maxx-eng/tree/gh-pages - please, be careful here, as usually changes will affect the whole site. Also make sure site's cache and your browser cache is expired after changes done, otherwise testing could be bewildering.
72
-
73
-
## Creating anchors and link to them
74
-
75
-
It is possible to generate HTML anchors for sections of an article.
76
-
E.g. the following generates a header and a named anchor.
77
-
78
-
## Implementation ## {#implementation}
79
-
80
-
And then link to it from the same or a different article:
81
-
82
-
For more detail read the [Implementation](#implementation).
83
-
More infos in [Impl. of Segmenttree](./data_structures/segment_tree.html#implementation).
84
-
85
-
## Page Template
47
+
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.
86
48
87
-
Template for the pages (the one which creates small violet header and footer, determines the layout of the text, includes css and js files) is now also stored in this repo, in [src/\_templates](https://github.com/e-maxx-eng/e-maxx-eng/tree/master/src/_templates) folder. So in case you find some bugs in it, or with the passing of time some new features may be needed in it - create PR to improve it. Note that for testing purposes the alternative template could be created and used for specific page with the inclusion of special comment as shown below:
49
+
## Local development
88
50
89
-
`<!--?template myfunnytemplate-->`
51
+
You can render the pages very easily also locally.
52
+
All you need is Python, with the installed `mkdocs-material` package.
90
53
91
-
The templates are cached for about 3600 seconds, rather than 300 seconds for ordinary pages, so be patient :)
54
+
```console
55
+
$ pip install mkdocs-material
56
+
$ mkdocs serve
57
+
```
92
58
93
59
## Tests
94
60
@@ -98,7 +64,7 @@ This way we can make sure that the snippets actually work, and don't contain any
98
64
Creating tests works like this:
99
65
You have to name each snippet that you want to test in the markdown article:
100
66
101
-
```cpp snippet-name
67
+
```{.cpp file=snippet-name}
102
68
// some code
103
69
```
104
70
@@ -108,4 +74,17 @@ In the folder you can create a cpp file, that includes these snippets headers, a
108
74
If the snippets don't work, the test program should return 1 instead of 0.
109
75
110
76
You can run all tests with the script `test.sh`.
111
-
Also, every pull-request will automatically tested via [Travis CI](https://travis-ci.org/e-maxx-eng/e-maxx-eng/), and the result of the tests will be shown.
77
+
78
+
```console
79
+
$ cdtest
80
+
$ ./test.sh
81
+
Running test_aho_corasick.cpp - Passed in 635 ms
82
+
Running test_balanced_brackets.cpp - Passed in 1390 ms
83
+
Running test_burnside_tori.cpp - Passed in 378 ms
84
+
...
85
+
Running test_vertical_decomposition.cpp - Passed in 2397 ms
86
+
87
+
51 PASSED in 49.00 seconds
88
+
```
89
+
90
+
Also, every pull-request will automatically tested via [Github Actions](https://travis-ci.org/e-maxx-eng/e-maxx-eng/).
0 commit comments