Skip to content

Commit

Permalink
Update changelog for v0.10.2 (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Nov 8, 2023
1 parent 9790959 commit 85a9193
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ ENV/
.vscode/
docs/examples/segment.cpg
docs/examples/segment.prj
docs/changelog_update.md
23 changes: 23 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## v0.10.2 - Nov 7, 2023

**What's Changed**

- Add JOSS paper by @giswqs in [#197](https://github.com/opengeos/segment-geospatial/pull/197)
- Add notebook for using Maxar Open Data by @giswqs in [#198](https://github.com/opengeos/segment-geospatial/pull/198)
- Add checkpoint to textsam.LangSAM() by @forestbat in [#204](https://github.com/opengeos/segment-geospatial/pull/204)
- Add workshop notebook by @giswqs in [#209](https://github.com/opengeos/segment-geospatial/pull/209)

**New Contributors**

- @forestbat made their first contribution in [#204](https://github.com/opengeos/segment-geospatial/pull/204)

**Full Changelog**: [v0.10.1...v0.10.2](https://github.com/opengeos/segment-geospatial/compare/v0.10.1...v0.10.2)

## v0.10.1 - Sep 1, 2023

**What's Changed**

- Fix basemap issue by @giswqs in [#190](https://github.com/opengeos/segment-geospatial/pull/190)

**Full Changelog**: [v0.10.0...v0.10.1)](https://github.com/opengeos/segment-geospatial/compare/v0.10.0...v0.10.1)

## v0.10.0 - Aug 24, 2023

### What's Changed
Expand Down
48 changes: 48 additions & 0 deletions docs/changelog_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import re

# Copy the release notes from the GitHub release page
markdown_text = """
## What's Changed
* Add JOSS paper by @giswqs in https://github.com/opengeos/segment-geospatial/pull/197
* Add notebook for using Maxar Open Data by @giswqs in https://github.com/opengeos/segment-geospatial/pull/198
* Add checkpoint to textsam.LangSAM() by @forestbat in https://github.com/opengeos/segment-geospatial/pull/204
* Add workshop notebook by @giswqs in https://github.com/opengeos/segment-geospatial/pull/209
## New Contributors
* @forestbat made their first contribution in https://github.com/opengeos/segment-geospatial/pull/204
**Full Changelog**: https://github.com/opengeos/segment-geospatial/compare/v0.10.1...v0.10.2
"""

# Regular expression pattern to match the Markdown hyperlinks
pattern = r"https://github\.com/opengeos/segment-geospatial/pull/(\d+)"


# Function to replace matched URLs with the desired format
def replace_url(match):
pr_number = match.group(1)
return f"[#{pr_number}](https://github.com/opengeos/segment-geospatial/pull/{pr_number})"


# Use re.sub to replace URLs with the desired format
formatted_text = re.sub(pattern, replace_url, markdown_text)

for line in formatted_text.splitlines():
if "Full Changelog" in line:
prefix = line.split(": ")[0]
link = line.split(": ")[1]
version = line.split("/")[-1]
formatted_text = (
formatted_text.replace(line, f"{prefix}: [{version}]({link})")
.replace("## What's Changed", "**What's Changed**")
.replace("## New Contributors", "**New Contributors**")
)


with open("docs/changelog_update.md", "w") as f:
f.write(formatted_text)

# Print the formatted text
print(formatted_text)

# Copy the formatted text and paste it to the CHANGELOG.md file

0 comments on commit 85a9193

Please sign in to comment.