smol fixes
This commit is contained in:
parent
2186eb6fcd
commit
221429766e
2 changed files with 18 additions and 13 deletions
|
@ -1,23 +1,23 @@
|
||||||
# Auto-README generation
|
# Auto-README generation
|
||||||
|
|
||||||
### Initial install
|
## Initial install
|
||||||
|
|
||||||
```
|
```bash
|
||||||
python3 -m venv venv
|
python3 -m venv venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use on a single app
|
## Use on a single app
|
||||||
|
|
||||||
```
|
```bash
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
./make_readme.py /path/to/app
|
./make_readme.py /path/to/app
|
||||||
```
|
```
|
||||||
|
|
||||||
Then the README.md in the app folder will be updated
|
Then the README.md in the app folder will be updated
|
||||||
|
|
||||||
### Launch webhook service for auto update
|
## Launch webhook service for auto update
|
||||||
|
|
||||||
Configure the webhook on github
|
Configure the webhook on github
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,14 @@ from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
|
|
||||||
def value_for_lang(values, lang):
|
def value_for_lang(values, lang):
|
||||||
if not isinstance(values, dict):
|
if not isinstance(values, dict):
|
||||||
return values
|
return values
|
||||||
if lang in values:
|
if lang in values:
|
||||||
return values[lang]
|
return values[lang]
|
||||||
elif "en" in values:
|
elif "en" in values:
|
||||||
return values["en"]
|
return values["en"]
|
||||||
else:
|
else:
|
||||||
return list(values.values())[0]
|
return list(values.values())[0]
|
||||||
|
|
||||||
def generate_READMEs(app_path: str):
|
def generate_READMEs(app_path: str):
|
||||||
|
|
||||||
|
@ -35,8 +35,11 @@ def generate_READMEs(app_path: str):
|
||||||
|
|
||||||
catalog = toml.load(open(Path(os.path.abspath(__file__)).parent.parent.parent / "apps.toml"))
|
catalog = toml.load(open(Path(os.path.abspath(__file__)).parent.parent.parent / "apps.toml"))
|
||||||
from_catalog = catalog.get(manifest['id'], {})
|
from_catalog = catalog.get(manifest['id'], {})
|
||||||
|
print(catalog)
|
||||||
|
print(from_catalog)
|
||||||
|
|
||||||
antifeatures_list = toml.load(open(Path(os.path.abspath(__file__)).parent.parent.parent / "antifeatures.toml"))
|
antifeatures_list = toml.load(open(Path(os.path.abspath(__file__)).parent.parent.parent / "antifeatures.toml"))
|
||||||
|
print(antifeatures_list)
|
||||||
|
|
||||||
if not upstream and not (app_path / "doc" / "DISCLAIMER.md").exists():
|
if not upstream and not (app_path / "doc" / "DISCLAIMER.md").exists():
|
||||||
print(
|
print(
|
||||||
|
@ -82,6 +85,8 @@ def generate_READMEs(app_path: str):
|
||||||
else:
|
else:
|
||||||
antifeatures[k]['description'] = value_for_lang(antifeatures[k]['description'], lang)
|
antifeatures[k]['description'] = value_for_lang(antifeatures[k]['description'], lang)
|
||||||
|
|
||||||
|
print(lang + "\n")
|
||||||
|
|
||||||
out = template.render(
|
out = template.render(
|
||||||
lang=lang,
|
lang=lang,
|
||||||
upstream=upstream,
|
upstream=upstream,
|
||||||
|
|
Loading…
Reference in a new issue