diff --git a/new-project.py b/new-project.py index 3e190a7..08c206a 100644 --- a/new-project.py +++ b/new-project.py @@ -9,6 +9,8 @@ sluggish_title = title.replace(' ', '-').lower() slug = input( f"🦈 Slug: [{sluggish_title}] ") or sluggish_title +description = input('✏️ Description: ') + today = datetime.date.today().strftime('%d/%m/%Y') date = input(f"🍲 Date: [{today}] ") or today @@ -28,6 +30,7 @@ css = input("🤪 Custom CSS: ") project = { 'title': title, 'slug': slug, + 'description': description, 'date': date, 'categories': categories, 'url': url, diff --git a/projects/documentation-template/documentation.md b/projects/documentation-template/documentation.md new file mode 100644 index 0000000..d9e1f78 --- /dev/null +++ b/projects/documentation-template/documentation.md @@ -0,0 +1,21 @@ +--- +categories: + - Python + - Documentation + - Tool +cover: "" +cover_alt: "" +css: "" +date: 14/05/2022 +description: Handy template for documenting projects +git: https://git.xpub.nl/kamo/kamo-soupbato +pad: "" +project: "" +script: "" +slug: documentation-template +template: "" +title: Documentation Template +url: "new-project.py" +--- + +A small python script that asks everything you need to know to create a folder & documentation file of your projects. Find the code [here](new-project.py). diff --git a/projects/documentation-template/new-project.py b/projects/documentation-template/new-project.py new file mode 100644 index 0000000..08c206a --- /dev/null +++ b/projects/documentation-template/new-project.py @@ -0,0 +1,53 @@ +import datetime +import os +import frontmatter + + +title = input("🦗 Title: ") + +sluggish_title = title.replace(' ', '-').lower() +slug = input( + f"🦈 Slug: [{sluggish_title}] ") or sluggish_title + +description = input('✏️ Description: ') + +today = datetime.date.today().strftime('%d/%m/%Y') +date = input(f"🍲 Date: [{today}] ") or today + +categories = [category.strip() + for category in input("🚩 Categories: ").split(',')] + +url = input("🔗 URL: ") +git = input("🪃 Git: ") +pad = input("🗒️ Pad: ") +cover = input("🖼️ Cover: ") +cover_alt = input("🎨 Cover Description: ") +project = input("🦾 Static HTML: ") +template = input("🏛️ Custom Template: ") +script = input("🧑 Custom JS: ") +css = input("🤪 Custom CSS: ") + +project = { + 'title': title, + 'slug': slug, + 'description': description, + 'date': date, + 'categories': categories, + 'url': url, + 'git': git, + 'pad': pad, + 'cover': cover, + 'cover_alt': cover_alt, + 'project': project, + 'template': template, + 'script': script, + 'css': css +} + +post = frontmatter.Post('', **project) + + +os.makedirs(f'projects/{slug}') +with open(f'projects/{slug}/documentation.md', 'w') as f: + documentation = frontmatter.dumps(post) + f.write(documentation)