Add per-API changelogs
This commit is contained in:
parent
5f459e6e0a
commit
39f43abbb7
4 changed files with 44 additions and 18 deletions
10
changelogs/client_server.rst
Normal file
10
changelogs/client_server.rst
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
r0
|
||||||
|
===
|
||||||
|
|
||||||
|
This is the first release of the client-server specification. It is largely a dump of what has currently been implemented, and there are several inconsistencies.
|
||||||
|
|
||||||
|
An upcoming minor release will deprecate many of these inconsistencies, and they will be removed in the next major release.
|
||||||
|
|
||||||
|
Since the draft stage, the following major changes have been made:
|
||||||
|
- /api/v1 and /v2_alpha path segments have been replaced with the major version of the release (i.e. 'r0').
|
||||||
|
- The specification has been split into one specification per API. This is the client-server API. The server-server API can be found documented separately.
|
|
@ -10,6 +10,19 @@ local persistent copy of server state.
|
||||||
.. contents:: Table of Contents
|
.. contents:: Table of Contents
|
||||||
.. sectnum::
|
.. sectnum::
|
||||||
|
|
||||||
|
Changelog
|
||||||
|
---------
|
||||||
|
|
||||||
|
Version of this specification: **%CLIENT_RELEASE_LABEL%**.
|
||||||
|
|
||||||
|
{{client_server_changelog}}
|
||||||
|
|
||||||
|
For the full historical changelog, see
|
||||||
|
https://github.com/matrix-org/matrix-doc/blob/master/changelogs/client-server.rst
|
||||||
|
|
||||||
|
If this is an unstable snapshot, any changes since the last release may be
|
||||||
|
viewed using ``git log``.
|
||||||
|
|
||||||
API Standards
|
API Standards
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,9 @@ class MatrixSections(Sections):
|
||||||
def render_git_rev(self):
|
def render_git_rev(self):
|
||||||
return self.units.get("git_version")["revision"]
|
return self.units.get("git_version")["revision"]
|
||||||
|
|
||||||
def render_spec_changelog(self):
|
def render_client_server_changelog(self):
|
||||||
spec_meta = self.units.get("spec_meta")
|
changelogs = self.units.get("changelogs")
|
||||||
return spec_meta["changelog"]
|
return changelogs["client_server"]
|
||||||
|
|
||||||
def _render_events(self, filterFn, sortFn):
|
def _render_events(self, filterFn, sortFn):
|
||||||
template = self.env.get_template("events.tmpl")
|
template = self.env.get_template("events.tmpl")
|
||||||
|
|
|
@ -21,7 +21,7 @@ HTTP_APIS = ("../api/application-service", "../api/client-server",)
|
||||||
EVENT_EXAMPLES = "../event-schemas/examples"
|
EVENT_EXAMPLES = "../event-schemas/examples"
|
||||||
EVENT_SCHEMA = "../event-schemas/schema"
|
EVENT_SCHEMA = "../event-schemas/schema"
|
||||||
CORE_EVENT_SCHEMA = "../event-schemas/schema/core-event-schema"
|
CORE_EVENT_SCHEMA = "../event-schemas/schema/core-event-schema"
|
||||||
CHANGELOG = "../CHANGELOG.rst"
|
CHANGELOG_DIR = "../changelogs"
|
||||||
TARGETS = "../specification/targets.yaml"
|
TARGETS = "../specification/targets.yaml"
|
||||||
|
|
||||||
ROOM_EVENT = "core-event-schema/room_event.yaml"
|
ROOM_EVENT = "core-event-schema/room_event.yaml"
|
||||||
|
@ -711,13 +711,21 @@ class MatrixUnits(Units):
|
||||||
schemata[filename] = schema
|
schemata[filename] = schema
|
||||||
return schemata
|
return schemata
|
||||||
|
|
||||||
def load_spec_meta(self):
|
def load_changelogs(self):
|
||||||
path = CHANGELOG
|
changelogs = {}
|
||||||
title_part = None
|
|
||||||
changelog_lines = []
|
for f in os.listdir(CHANGELOG_DIR):
|
||||||
with open(path, "r") as f:
|
if not f.endswith(".rst"):
|
||||||
|
continue
|
||||||
|
path = os.path.join(CHANGELOG_DIR, f)
|
||||||
|
name = f[:-4]
|
||||||
|
|
||||||
|
title_part = None
|
||||||
|
changelog_lines = []
|
||||||
|
with open(path, "r") as f:
|
||||||
|
lines = f.readlines()
|
||||||
prev_line = None
|
prev_line = None
|
||||||
for line in f.readlines():
|
for line in lines:
|
||||||
if line.strip().startswith(".. "):
|
if line.strip().startswith(".. "):
|
||||||
continue # comment
|
continue # comment
|
||||||
if prev_line is None:
|
if prev_line is None:
|
||||||
|
@ -735,15 +743,10 @@ class MatrixUnits(Units):
|
||||||
# then bail out.
|
# then bail out.
|
||||||
changelog_lines.pop()
|
changelog_lines.pop()
|
||||||
break
|
break
|
||||||
changelog_lines.append(line)
|
changelog_lines.append(" " + line)
|
||||||
|
changelogs[name] = "\n".join(changelog_lines)
|
||||||
|
|
||||||
self.log("Title part: %s Changelog line count: %s" % (
|
return changelogs
|
||||||
title_part, len(changelog_lines)
|
|
||||||
))
|
|
||||||
|
|
||||||
return {
|
|
||||||
"changelog": "".join(changelog_lines)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def load_spec_targets(self):
|
def load_spec_targets(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue