Compare commits

...

4 Commits

5 changed files with 59 additions and 55 deletions

1
.gitignore vendored
View File

@ -170,3 +170,4 @@ cython_debug/
docs/*
!docs/index.html
.task.mk

4
.task.cfg.mk Normal file
View File

@ -0,0 +1,4 @@
USAGE={a.b_magenta}daylin's logo{a.end}\n
PHONIFY = 1
-include .task.mk
$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v23.1.2/task.mk -o .task.mk))

View File

@ -15,9 +15,7 @@ all:
@$(MAKE) docs/png/index.html
@$(MAKE) pngs
.PHONY: pngs
## generate all of the logo pngs
pngs: $(PNGS)
pngs: $(PNGS) ## generate all of the logo pngs
docs/png/index.html: docs/index.html
@cat docs/index.html |\
@ -29,21 +27,15 @@ docs/png/index.html: docs/index.html
docs/png/%.png: docs/svg/%.svg
@inkscape --export-filename=$@ $<
.PHONY: logos
## generate all of the logo svgs
svgs: $(SRC)
./generate-all.py $(REV)
svgs: $(SRC) ## generate all of the logo svgs
./scripts/generate-all.py $(REV)
.PHONY: lint
## apply isort/black/flake8
lint:
lint: ## apply isort/black/flake8
@isort logo
@black logo
@flake8 logo
.PHONY: bootstrap pdm-env conda-env
## bootstrap the conda environment
bootstrap: pdm-env
bootstrap: pdm-env ## bootstrap the conda environment
conda-env:
$(CONDA) CONDA_ALWAYS_YES="true" mamba create -p ./env python --force
@ -53,19 +45,10 @@ pdm-env: conda-env
pip install pdm; \
pdm install
.PHONY: clean
## remove old files
clean:
clean: ## remove old files
rm -f *.svg *.png
rm -f docs/*.svg
rm -f docs/svg/*
rm -f docs/png/*
.PHONY: help
help: ## try `make help`
@awk '/^[a-z.A-Z_-]+:/ { helpMessage = match(lastLine, /^##(.*)/); \
if (helpMessage) { helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "\033[36m%-9s\033[0m - %s\n", \
helpCommand, helpMessage;}} { lastLine = $$0 }' $(MAKEFILE_LIST)
-include .task.cfg.mk

View File

@ -1,31 +0,0 @@
#!/usr/bin/env python3
from logo import generate
from pathlib import Path
import sys
def main():
rev = sys.argv[1]
comment =f"© 2022 Daylin Morgan | rev. {rev}"
if not (Path.cwd() / "docs" / "svg").is_dir():
print("making docs directory")
(Path.cwd() / "docs" / "svg").mkdir(exist_ok=True)
for theme in ['dark','light']:
for background in ['rect','circle',None]:
for border in [True,False]:
name = ['logo']
if background:
name.append(f"bg-{background}")
if border:
name.append(f"b")
name.append(theme)
name = f"docs/svg/{'-'.join(name)}.svg"
generate(name=name,background=background,border=border,theme=theme,comment=comment)
generate(name=f"docs/{theme}.svg",background="circle",border=True,theme=theme,comment=comment)
if __name__ == "__main__":
main()

47
scripts/generate-all.py Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/env python3
import sys
from pathlib import Path
from logo import generate
PROJECT_ROOT = Path(__file__).parent.parent
def main():
rev = sys.argv[1]
comment = f"© 2022 Daylin Morgan | rev. {rev}"
if not ( PROJECT_ROOT / "docs" / "svg").is_dir():
print("making docs directory")
(PROJECT_ROOT / "docs" / "svg").mkdir(exist_ok=True)
for theme in ["dark", "light"]:
for background in ["rect", "circle", None]:
for border in [True, False]:
name = ["logo"]
if background:
name.append(f"bg-{background}")
if border:
name.append("b")
name.append(theme)
name = f"{PROJECT_ROOT}/docs/svg/{'-'.join(name)}.svg"
generate(
name=name,
background=background,
border=border,
theme=theme,
comment=comment,
)
generate(
name=f"{PROJECT_ROOT}/docs/{theme}.svg",
background="circle",
border=True,
theme=theme,
comment=comment,
)
if __name__ == "__main__":
main()