diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2c5789c..3ac84db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,18 +1,28 @@
# Changelog
+
All notable changes to this project will be documented in this file.
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.2](https://github.com/tembo-pages/tembo-core/commits/v1.0.2) - 2021-11-23
+[Compare with v1.0.1](https://github.com/tembo-pages/tembo-core/compare/v1.0.1..v1.0.2)
-## [1.0.1](https://github.com/tembo-pages/tembo-core/commits/1.0.1) - 2021-11-21
-[Compare with v1.0.0](https://github.com/tembo-pages/tembo-core/compare/v1.0.1...v1.0.0)
+### Features
+
+- Add garbage ([b49d77](https://github.com/tembo-pages/tembo-core/commit/b49d776712737deaa1aeb86dd40230c099198d5a))
### Miscellaneous Tasks
-- Add changelog generation using git-cliff ([4c8d68](https://github.com/tembo-pages/tembo-core/commit/4c8d686abb82ade97680a3e8cdef267559282ff4))
-- Prepare release 1.0.1 ([b077aa](https://github.com/tembo-pages/tembo-core/commit/b077aaaf6666e78507f6439fa2e10a34c55176e5))
+- Prepare release v1.0.2 ([e29ae6](https://github.com/tembo-pages/tembo-core/commit/e29ae6dadb1ca419d536db18f34d9d249012cc25))
+- Update cliff.toml ([7ee36f](https://github.com/tembo-pages/tembo-core/commit/7ee36f28b5160251c37085744166c2a5b1e695e4))
+- Update duties.py with latest changelog duty ([f6f2fe](https://github.com/tembo-pages/tembo-core/commit/f6f2fe07b61e8fa8bd812bbc63a51d3f9705a448))
+## [v1.0.1](https://github.com/tembo-pages/tembo-core/commits/v1.0.1) - 2021-11-21
+[Compare with v1.0.0](https://github.com/tembo-pages/tembo-core/compare/v1.0.0..v1.0.1)
-## [1.0.0](https://github.com/tembo-pages/tembo-core/commits/v1.0.0) - 2021-11-21
+### Documentation
+
+- Update changelog ([b71033](https://github.com/tembo-pages/tembo-core/commit/b710338a73add7ed93af1f76f3b9272e30ce41de))
+
+## [v1.0.0](https://github.com/tembo-pages/tembo-core/commits/v1.0.0) - 2021-11-21
### Documentation
@@ -22,12 +32,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial commit ([fb7fec](https://github.com/tembo-pages/tembo-core/commit/fb7fec7ea619318b0e0830c0f9260335c0d4e173))
-### Miscellaneous Tasks
-
-- Update duties.py ([562de6](https://github.com/tembo-pages/tembo-core/commit/562de606c4846ad37d32822260121892c353e7ca))
-- Prepare release 1.0.0 ([eed47d](https://github.com/tembo-pages/tembo-core/commit/eed47d34b9a0b79f48b2fbe0ad77f43dc42f6027))
-
### Build
- Update panaetius to 2.3.3 ([e5d2b2](https://github.com/tembo-pages/tembo-core/commit/e5d2b28252b9d7962a8d49d4da37b9f9c4f6d514))
-
diff --git a/cliff.toml b/cliff.toml
index 5522e29..c956128 100644
--- a/cliff.toml
+++ b/cliff.toml
@@ -12,9 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
- ## [{{ version | trim_start_matches(pat="v") }}](https://github.com/tembo-pages/tembo-core/commits/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
+ ## [{{ version }}](https://github.com/tembo-pages/tembo-core/commits/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% if previous.version %}\
- [Compare with {{ previous.version }}](https://github.com/tembo-pages/tembo-core/compare/v{{ version }}...{{ previous.version }})
+ [Compare with {{ previous.version }}](https://github.com/tembo-pages/tembo-core/compare/{{ previous.version }}...{{ version }})
{% endif %}\
{% else %}\
## [unreleased]
diff --git a/docs/home/license.md b/docs/home/license.md
index 616b86c..cdacdfe 100644
--- a/docs/home/license.md
+++ b/docs/home/license.md
@@ -1,3 +1,3 @@
```
---8<-- "LICENSE.md"
+--8<-- "LICENSE"
```
diff --git a/duties.py b/duties.py
index a854afe..581ad61 100644
--- a/duties.py
+++ b/duties.py
@@ -13,6 +13,7 @@ from urllib.request import urlopen
from duty import duty
PACKAGE_NAME = "tembo"
+REPO_URL = "https://github.com/tembo-pages/tembo-core"
@duty(post=["export"])
@@ -322,25 +323,37 @@ def check_dependencies(ctx):
pty=True,
)
+
@duty
-def changelog(ctx, planned_release: Optional[str] = None):
+def changelog(ctx, planned_release: Optional[str] = None, previous_release: Optional[str] = None):
"""
Generate a changelog with git-cliff.
Args:
ctx: The context instance (passed automatically).
planned_release (str, optional): The planned release version. Example: v1.0.2
+ previous_release (str, optional): The previous release version. Example: v1.0.1
"""
- if planned_release is not None:
- changelog = ctx.run(["git", "cliff", "--tag", planned_release])
- else:
- changelog = ctx.run(["git", "cliff"])
+ generated_changelog: str = ctx.run(["git", "cliff", "-u", "-t", planned_release, "-s", "header"])[:-1]
+ if previous_release is not None:
+ generated_changelog: list = generated_changelog.splitlines()
+ generated_changelog.insert(
+ 1,
+ f"[Compare with {previous_release}]({REPO_URL}/compare/{previous_release}..{planned_release})",
+ )
+ generated_changelog: str = "\n".join([line for line in generated_changelog]) + "\n"
+ new_changelog = []
changelog_file = pathlib.Path(".") / "CHANGELOG.md"
+ with changelog_file.open("r", encoding="utf-8") as changelog_contents:
+ all_lines = changelog_contents.readlines()
+ for line_string in all_lines:
+ regex_string = re.search(r"()", line_string)
+ new_changelog.append(line_string)
+ if isinstance(regex_string, re.Match):
+ new_changelog.append(generated_changelog)
with changelog_file.open("w", encoding="utf-8") as changelog_contents:
- changelog_contents.write(changelog)
-
-
+ changelog_contents.writelines(new_changelog)
def rm_tree(directory: pathlib.Path):
diff --git a/garbage b/garbage
new file mode 100644
index 0000000..e69de29
diff --git a/pyproject.toml b/pyproject.toml
index 928eeee..1dcd6c4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]
name = "tembo"
description = "A simple folder organiser for your work notes."
-version = "1.0.1"
+version = "1.0.2"
license = "ISC"
authors = ["dtomlinson "]
readme = "./README.md"
diff --git a/setup.py b/setup.py
index 14a9850..a77645c 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@ entry_points = \
setup_kwargs = {
'name': 'tembo',
- 'version': '1.0.1',
+ 'version': '1.0.2',
'description': 'A simple folder organiser for your work notes.',
'long_description': '# Tembo\n\n
\n\nA simple folder organiser for your work notes.\n\n\n\n\n\n\n\n## config.yml\n\n```yaml\n# time tokens: https://strftime.org\ntembo:\n base_path: ~/tembo\n # template_path: ~/tembo/templates\n scopes:\n - name: scratchpad\n example: tembo new scratchpad\n path: "scratchpad/{d:%B_%Y}"\n filename: "{d:%B_%W}"\n extension: md\n template_filename: scratchpad.md.tpl\n - name: wtodo\n example: tembo new wtodo | directory is month_year, filename is month_week-of-year\n path: "wtodo/{d:%B_%Y}"\n filename: "week_{d:%W}"\n extension: todo\n template_filename: weekly.todo.tpl\n - name: meeting\n example: tembo new meeting $meeting_title\n path: "meetings/{d:%B_%y}"\n filename: "{d:%a_%d_%m_%y}-{input0}"\n extension: md\n template_filename: meeting.md.tpl\n - name: knowledge\n example: tembo new knowledge $project $filename\n path: "knowledge/{input0}"\n filename: "{input1}"\n extension: md\n template_filename: knowledge.md.tpl\n logging:\n level: INFO\n path: ~/tembo/.logs\n```\n\n## templates\n\n###\xa0knowledge\n\n```\n---\ncreated: {d:%d-%m-%Y}\n---\n\n# {input0} - {input1}.md\n```\n\n### meeting\n\n```\n---\ncreated: {d:%d-%m-%Y}\n---\n\n# {d:%A %d %B %Y} - {input0}\n\n## People\n\nHead:\n\nAttendees:\n\n## Actions\n\n\n## Notes\n\n```\n\n### scratchpad\n\n```\n---\ncreated: {d:%d-%m-%Y}\n---\n\n# Scratchpad - Week {d:%W} - {d:%B-%y}\n```\n\n### wtodo\n\n```\n---\ncreated: {d:%d-%m-%Y}\n---\n\nWeekly TODO | Week {d:%W} {d:%B}-{d:%Y}\n\nWork:\n\nDocumentation:\n```\n',
'author': 'dtomlinson',
diff --git a/tembo/_version.py b/tembo/_version.py
index 8cb9d2e..e3e7223 100644
--- a/tembo/_version.py
+++ b/tembo/_version.py
@@ -1,3 +1,3 @@
"""Module containing the version of tembo."""
-__version__ = "1.0.1"
+__version__ = "1.0.2"