Skip to content

Commit

Permalink
[Plugin manager][needs-doc] Read a CHANGELOG file in case the relevan…
Browse files Browse the repository at this point in the history
…t metadata key is empty
  • Loading branch information
borysiasty committed Oct 27, 2017
1 parent a843df8 commit 4cde520
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/pyplugin_installer/installer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ def pluginMetadata(fct):
if QFileInfo(icon).isRelative():
icon = path + "/" + icon

changelog = pluginMetadata("changelog")
changelogFile = os.path.join(path, "CHANGELOG")
if not changelog and QFile(changelogFile).exists():
with open(changelogFile) as f:
changelog = f.read()

plugin = {
"id": key,
"plugin_id": None,
Expand All @@ -672,7 +678,7 @@ def pluginMetadata(fct):
"icon": icon,
"category": pluginMetadata("category"),
"tags": pluginMetadata("tags"),
"changelog": pluginMetadata("changelog"),
"changelog": changelog,
"author_name": pluginMetadata("author_name") or pluginMetadata("author"),
"author_email": pluginMetadata("email"),
"homepage": pluginMetadata("homepage"),
Expand Down

3 comments on commit 4cde520

@borysiasty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @alexbruy @elpaso

Fetching the changelog from repository on request (if not included to the repo.xml) still on my todo list (hopefully for QGIS 3.2).

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 4cde520 Oct 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borysiasty if I may propose something, can you include markdown format for the changelog?

@borysiasty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kuhn For QGIS 3.0 I'm going to only tweak the css a bit and make the changelog less obtrusive. Then I'm going to put some javascript logic in QGIS 3.2, so the plugin pages are sexier (firmly requested by @wonder-sk ;) ). At that stage, a markdown parser is a great idea. Thanks, added to requested features.

So let's wait until we're defrozen. Or correct me if I'm wrong and QtWebkit is already able to parse markdown. AFAIK it doesn't.

Please sign in to comment.