Update contributing.

This commit is contained in:
Sergey Vartanov 2021-09-11 12:28:08 +03:00
parent 52301801cd
commit 0d414553ec
3 changed files with 15 additions and 6 deletions

View file

@ -13,6 +13,11 @@ Report a bug
Please, create an issue with `bug` and `generator` labels.
Fix a typo in documentation
---------------------------
This action is not that easy as it supposed to be. We use [Moire](http://github.com/enzet/Moire) markup and converter to automatically generate documentation for GitHub, website, and [OpenStreetMap wiki](http://wiki.openstreetmap.org/). That's why editing Markdown files is not allowed. To fix a typo, open corresponding Moire file in `doc` directory (e.g. `doc/readme.moi` for `README.md`), modify it, and run `python map_machine/moire_manager.py`.
Modify the code
---------------

View file

@ -14,11 +14,9 @@ Please, create an issue with \m {icon} label.
Please, create an issue with \m {bug} and \m {generator} labels.
/*
\2 {Fix a typo in documentation} {}
This action is not that easy as it supposed to be. We use \ref {http://github.com/enzet/Moire} {Moire} markup and converter to automatically generate documentation for GitHub, website, and \ref {http://wiki.openstreetmap.org/} {OpenStreetMap wiki}. That's why editing Markdown files is not allowed. To fix a typo, open corresponding Moire file in \m {doc} directory (e.g. \m {doc/readme.moi} for \m {README.md}), modify it, and run \m {map-machine doc} script.
*/
This action is not that easy as it supposed to be. We use \ref {http://github.com/enzet/Moire} {Moire} markup and converter to automatically generate documentation for GitHub, website, and \ref {http://wiki.openstreetmap.org/} {OpenStreetMap wiki}. That's why editing Markdown files is not allowed. To fix a typo, open corresponding Moire file in \m {doc} directory (e.g. \m {doc/readme.moi} for \m {README.md}), modify it, and run \m {python map_machine/moire_manager.py}.
\2 {Modify the code} {}

View file

@ -305,7 +305,13 @@ class MapMachineMarkdown(MapMachineMoire, DefaultMarkdown):
return f"<{self.parse(args[0])}>"
if __name__ == "__main__":
with Path("doc/readme.moi").open() as input_file:
with Path("README.md").open("w+") as output_file:
def convert(input_path: Path, output_path: Path) -> None:
"""Convert Moire file to Markdown."""
with input_path.open() as input_file:
with output_path.open("w+") as output_file:
output_file.write(MapMachineMarkdown().convert(input_file.read()))
if __name__ == "__main__":
convert(Path("doc/readme.moi"), Path("README.md"))
convert(Path("doc/contributing.moi"), Path(".github/CONTRIBUTING.md"))