From 01ef17fc06ed9d5d36390815c871d9e9619a5888 Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Fri, 1 Sep 2023 10:48:04 +0200 Subject: [PATCH 1/8] add markdown format output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and enable it for bugzilla, github and gitlab. Signed-off-by: Sandro Bonazzola Co-authored-by: Konrad Kleine Co-authored-by: Petr Šplíchal --- README.rst | 7 ++++--- did/cli.py | 15 ++++++++++++--- did/plugins/bugzilla.py | 4 ++++ did/plugins/github.py | 28 +++++++++++++++++----------- did/plugins/gitlab.py | 32 +++++++++++++++++++++----------- did/utils.py | 2 ++ docs/examples.rst | 4 +++- 7 files changed, 63 insertions(+), 29 deletions(-) diff --git a/README.rst b/README.rst index 398a3187..def353ec 100644 --- a/README.rst +++ b/README.rst @@ -86,12 +86,13 @@ The default output is plain text of maximum width 79 characters. This can be adjusted using the ``--width`` parameter. To disable shortening altogether use ``--width=0``. The default width value can be saved in the config file as well. Use ``--format=wiki`` to -enable simple MoinMoin wiki syntax. For stats which support them, +enable simple MoinMoin wiki syntax or ``--format=wiki`` to enable +markdown syntax. For stats which support them, ``--brief`` and ``--verbose`` can be used to specify a different level of detail to be shown. ---format=FMT - Output style, possible values: text (default) or wiki +--format {text,md,wiki} + Output style, default: text --width=WIDTH Maximum width of the report output (default: 79) diff --git a/did/cli.py b/did/cli.py index 1d585693..80c8be30 100644 --- a/did/cli.py +++ b/did/cli.py @@ -77,8 +77,8 @@ def __init__(self, arguments=None): # Formating options group = self.parser.add_argument_group("Format") group.add_argument( - "--format", default="text", - help="Output style, possible values: text (default) or wiki") + "--format", default="text", choices=["text", "md", "wiki"], + help="Output style, default: text") group.add_argument( "--width", default=width, type=int, help="Maximum width of the report output (default: %(default)s)") @@ -149,8 +149,17 @@ def parse(self): raise RuntimeError( "Invalid date range ({0} to {1})".format( opt.since, opt.until.date - delta(days=1))) - header = "Status report for {0} ({1} to {2}).".format( + + header = "Status report for {0} ({1} to {2})".format( period, opt.since, opt.until.date - delta(days=1)) + if opt.format == "md": + # In markdown the first line must be a header + # using alternate syntax allowing to use did's + # output in commit messages as well + header = f"{header}\n{'=' * len(header)}" + else: + # In markdown no trailing punctuation is allowed in headings + header = header + "." # Finito log.debug("Gathered options:") diff --git a/did/plugins/bugzilla.py b/did/plugins/bugzilla.py index eda7aba0..ee2b75f6 100644 --- a/did/plugins/bugzilla.py +++ b/did/plugins/bugzilla.py @@ -140,6 +140,10 @@ def __str__(self): """ Consistent identifier and summary for displaying """ if self.options.format == "wiki": return "<> - {1}".format(self.id, self.summary) + elif self.options.format == "md": + link = self.parent.url.replace("xmlrpc.cgi", "show_bug.cgi?id=") + return "[{0}#{1}]({2}{1}) - {3}".format( + self.prefix, str(self.id), link, self.summary) else: return "{0}#{1} - {2}".format( self.prefix, str(self.id).rjust(7, "0"), self.summary) diff --git a/did/plugins/github.py b/did/plugins/github.py index bd684e6e..ca019fe4 100644 --- a/did/plugins/github.py +++ b/did/plugins/github.py @@ -110,7 +110,7 @@ def search(self, query): class Issue(object): """ GitHub Issue """ - def __init__(self, data): + def __init__(self, data, parent): self.data = data self.title = data["title"] matched = re.search( @@ -118,12 +118,18 @@ def __init__(self, data): self.owner = matched.groups()[0] self.project = matched.groups()[1] self.id = matched.groups()[2] + self.options = parent.options def __str__(self): """ String representation """ - return "{0}/{1}#{2} - {3}".format( - self.owner, self.project, - str(self.id).zfill(PADDING), self.data["title"]) + if self.options.format == "md": + return "[{0}/{1}#{2}](https://github.com/{0}/{1}/issues/{2}) - {3}".format( + self.owner, self.project, + str(self.id), self.data["title"].strip()) + else: + return "{0}/{1}#{2} - {3}".format( + self.owner, self.project, + str(self.id).zfill(PADDING), self.data["title"]) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -139,7 +145,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:issue" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] class IssuesClosed(Stats): @@ -151,7 +157,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:issue" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] class IssueCommented(Stats): @@ -163,7 +169,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:issue" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] class PullRequestsCreated(Stats): @@ -176,7 +182,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:pr" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] class PullRequestsCommented(Stats): @@ -189,7 +195,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:pr" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] class PullRequestsClosed(Stats): @@ -202,7 +208,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:pr" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] class PullRequestsReviewed(Stats): @@ -215,7 +221,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until) query += "+type:pr" self.stats = [ - Issue(issue) for issue in self.parent.github.search(query)] + Issue(issue, self.parent) for issue in self.parent.github.search(query)] # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/did/plugins/gitlab.py b/did/plugins/gitlab.py index b9727d26..340fc750 100644 --- a/did/plugins/gitlab.py +++ b/did/plugins/gitlab.py @@ -163,7 +163,8 @@ def search(self, user, since, until, target_type, action_name): class Issue(object): """ GitLab Issue """ - def __init__(self, data, gitlabapi): + def __init__(self, data, gitlabapi, parent): + self.parent = parent self.data = data self.gitlabapi = gitlabapi self.project = self.gitlabapi.get_project(data['project_id']) @@ -176,9 +177,18 @@ def iid(self): def __str__(self): """ String representation """ - return "{0}#{1} - {2}".format( - self.project['path_with_namespace'], - str(self.id).zfill(PADDING), self.title) + if self.parent.options.format == "md": + return "[{1}#{3}]({0}/{1}/-/{2}/{3}) - {4}".format( + self.gitlabapi.url, + self.project['path_with_namespace'], + ("issues" + if self.data['target_type'] == 'Issue' + else "merge_requests"), + str(self.id), self.title) + else: + return "{0}#{1} - {2}".format( + self.project['path_with_namespace'], + str(self.id).zfill(PADDING), self.title) class MergeRequest(Issue): @@ -223,7 +233,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Issue', 'opened') self.stats = [ - Issue(issue, self.parent.gitlab) + Issue(issue, self.parent.gitlab, self.parent) for issue in results] @@ -237,7 +247,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Note', 'commented on') self.stats = [ - Note(issue, self.parent.gitlab) + Note(issue, self.parent.gitlab, self.parent) for issue in results if issue['note']['noteable_type'] == 'Issue'] @@ -252,7 +262,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Issue', 'closed') self.stats = [ - Issue(issue, self.parent.gitlab) + Issue(issue, self.parent.gitlab, self.parent) for issue in results] @@ -266,7 +276,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'MergeRequest', 'opened') self.stats = [ - MergeRequest(mr, self.parent.gitlab) + MergeRequest(mr, self.parent.gitlab, self.parent) for mr in results] @@ -280,7 +290,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Note', 'commented on') self.stats = [ - Note(issue, self.parent.gitlab) + Note(issue, self.parent.gitlab, self.parent) for issue in results if issue['note']['noteable_type'] == 'MergeRequest'] @@ -295,7 +305,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'MergeRequest', 'accepted') self.stats = [ - MergeRequest(mr, self.parent.gitlab) + MergeRequest(mr, self.parent.gitlab, self.parent) for mr in results] @@ -309,7 +319,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'MergeRequest', 'approved') self.stats = [ - MergeRequest(mr, self.parent.gitlab) + MergeRequest(mr, self.parent.gitlab, self.parent) for mr in results] diff --git a/did/utils.py b/did/utils.py index d166795f..a0a330af 100644 --- a/did/utils.py +++ b/did/utils.py @@ -186,6 +186,8 @@ def item(text, level=0, options=None): return # Four space for each level, additional space for wiki format indent = level * 4 + if options.format == "md": + indent = level * 2 if options.format == "wiki" and level == 0: indent = 1 # Shorten the text if necessary to match the desired maximum width diff --git a/docs/examples.rst b/docs/examples.rst index 20513c3f..b6890b32 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -94,7 +94,9 @@ corresponding option groups for each of them:: --footer All above Format: - --format FORMAT Output style, possible values: text (default) or wiki + Format: + --format {text,md,wiki} + Output style, default: text --width WIDTH Maximum width of the report output (default: 79) --brief Show brief summary only, do not list individual items --verbose Include more details (like modified git directories) From f01de6152684864c6c52986e58d9ae3ec32bc508 Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Thu, 7 Sep 2023 11:54:53 +0200 Subject: [PATCH 2/8] enable markdown output for jira plugin Signed-off-by: Sandro Bonazzola --- did/plugins/jira.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/did/plugins/jira.py b/did/plugins/jira.py index 6e9b6bf8..23687a31 100644 --- a/did/plugins/jira.py +++ b/did/plugins/jira.py @@ -112,23 +112,32 @@ class Issue(object): """ Jira issue investigator """ - def __init__(self, issue=None, prefix=None): + def __init__(self, issue=None, parent=None): """ Initialize issue """ if issue is None: return + self.parent = parent + self.options = parent.options self.issue = issue self.key = issue["key"] self.summary = issue["fields"]["summary"] self.comments = issue["fields"]["comment"]["comments"] matched = re.match(r"(\w+)-(\d+)", self.key) self.identifier = matched.groups()[1] - if prefix is not None: - self.prefix = prefix + if parent.prefix is not None: + self.prefix = parent.prefix else: self.prefix = matched.groups()[0] def __str__(self): """ Jira key and summary for displaying """ + if self.options.format == "md": + return "[{0}-{1}]({2}) - {3}".format( + self.prefix, + self.identifier, + f"{self.parent.url}/browse/{self.issue['key']}", + self.summary + ) return "{0}-{1} - {2}".format( self.prefix, self.identifier, self.summary) @@ -168,7 +177,10 @@ def search(query, stats): if len(issues) >= data["total"]: break # Return the list of issue objects - return [Issue(issue, prefix=stats.parent.prefix) for issue in issues] + return [ + Issue(issue, parent=stats.parent) + for issue in issues + ] def updated(self, user, options): """ True if the issue was commented by given user """ From 6ff8928b900022793a9f1284e72c30bf0b40a8d7 Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Fri, 8 Sep 2023 13:05:51 +0200 Subject: [PATCH 3/8] Refactor gitlab plugin addressed comment at https://github.com/psss/did/pull/315#discussion_r1319685898 Signed-off-by: Sandro Bonazzola --- did/plugins/gitlab.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/did/plugins/gitlab.py b/did/plugins/gitlab.py index 340fc750..30a7b463 100644 --- a/did/plugins/gitlab.py +++ b/did/plugins/gitlab.py @@ -163,10 +163,10 @@ def search(self, user, since, until, target_type, action_name): class Issue(object): """ GitLab Issue """ - def __init__(self, data, gitlabapi, parent): + def __init__(self, data, parent): self.parent = parent self.data = data - self.gitlabapi = gitlabapi + self.gitlabapi = parent.gitlab self.project = self.gitlabapi.get_project(data['project_id']) self.id = self.iid() self.title = data['target_title'] @@ -233,7 +233,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Issue', 'opened') self.stats = [ - Issue(issue, self.parent.gitlab, self.parent) + Issue(issue, self.parent) for issue in results] @@ -247,7 +247,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Note', 'commented on') self.stats = [ - Note(issue, self.parent.gitlab, self.parent) + Note(issue, self.parent) for issue in results if issue['note']['noteable_type'] == 'Issue'] @@ -262,7 +262,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Issue', 'closed') self.stats = [ - Issue(issue, self.parent.gitlab, self.parent) + Issue(issue, self.parent) for issue in results] @@ -276,7 +276,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'MergeRequest', 'opened') self.stats = [ - MergeRequest(mr, self.parent.gitlab, self.parent) + MergeRequest(mr, self.parent) for mr in results] @@ -290,7 +290,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'Note', 'commented on') self.stats = [ - Note(issue, self.parent.gitlab, self.parent) + Note(issue, self.parent) for issue in results if issue['note']['noteable_type'] == 'MergeRequest'] @@ -305,7 +305,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'MergeRequest', 'accepted') self.stats = [ - MergeRequest(mr, self.parent.gitlab, self.parent) + MergeRequest(mr, self.parent) for mr in results] @@ -319,7 +319,7 @@ def fetch(self): self.user.login, self.options.since, self.options.until, 'MergeRequest', 'approved') self.stats = [ - MergeRequest(mr, self.parent.gitlab, self.parent) + MergeRequest(mr, self.parent) for mr in results] From 9226353c4ad8216054604749207660c76ee14e0b Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Fri, 8 Sep 2023 13:14:44 +0200 Subject: [PATCH 4/8] change format selector from md to markdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adress comment at https://github.com/psss/did/pull/315#discussion_r1319673520 Signed-off-by: Sandro Bonazzola Co-authored-by: Petr Šplíchal --- README.rst | 4 ++-- did/cli.py | 4 ++-- did/plugins/bugzilla.py | 2 +- did/plugins/github.py | 2 +- did/plugins/gitlab.py | 2 +- did/plugins/jira.py | 2 +- did/utils.py | 2 +- docs/examples.rst | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index def353ec..8e3dc06e 100644 --- a/README.rst +++ b/README.rst @@ -86,12 +86,12 @@ The default output is plain text of maximum width 79 characters. This can be adjusted using the ``--width`` parameter. To disable shortening altogether use ``--width=0``. The default width value can be saved in the config file as well. Use ``--format=wiki`` to -enable simple MoinMoin wiki syntax or ``--format=wiki`` to enable +enable simple MoinMoin wiki syntax or ``--format=markdown`` to enable markdown syntax. For stats which support them, ``--brief`` and ``--verbose`` can be used to specify a different level of detail to be shown. ---format {text,md,wiki} +--format {text,markdown,wiki} Output style, default: text --width=WIDTH diff --git a/did/cli.py b/did/cli.py index 80c8be30..8c51acc5 100644 --- a/did/cli.py +++ b/did/cli.py @@ -77,7 +77,7 @@ def __init__(self, arguments=None): # Formating options group = self.parser.add_argument_group("Format") group.add_argument( - "--format", default="text", choices=["text", "md", "wiki"], + "--format", default="text", choices=["text", "markdown", "wiki"], help="Output style, default: text") group.add_argument( "--width", default=width, type=int, @@ -152,7 +152,7 @@ def parse(self): header = "Status report for {0} ({1} to {2})".format( period, opt.since, opt.until.date - delta(days=1)) - if opt.format == "md": + if opt.format == "markdown": # In markdown the first line must be a header # using alternate syntax allowing to use did's # output in commit messages as well diff --git a/did/plugins/bugzilla.py b/did/plugins/bugzilla.py index ee2b75f6..8e6fefdb 100644 --- a/did/plugins/bugzilla.py +++ b/did/plugins/bugzilla.py @@ -140,7 +140,7 @@ def __str__(self): """ Consistent identifier and summary for displaying """ if self.options.format == "wiki": return "<> - {1}".format(self.id, self.summary) - elif self.options.format == "md": + elif self.options.format == "markdown": link = self.parent.url.replace("xmlrpc.cgi", "show_bug.cgi?id=") return "[{0}#{1}]({2}{1}) - {3}".format( self.prefix, str(self.id), link, self.summary) diff --git a/did/plugins/github.py b/did/plugins/github.py index ca019fe4..57f5f355 100644 --- a/did/plugins/github.py +++ b/did/plugins/github.py @@ -122,7 +122,7 @@ def __init__(self, data, parent): def __str__(self): """ String representation """ - if self.options.format == "md": + if self.options.format == "markdown": return "[{0}/{1}#{2}](https://github.com/{0}/{1}/issues/{2}) - {3}".format( self.owner, self.project, str(self.id), self.data["title"].strip()) diff --git a/did/plugins/gitlab.py b/did/plugins/gitlab.py index 30a7b463..c47d77dd 100644 --- a/did/plugins/gitlab.py +++ b/did/plugins/gitlab.py @@ -177,7 +177,7 @@ def iid(self): def __str__(self): """ String representation """ - if self.parent.options.format == "md": + if self.parent.options.format == "markdown": return "[{1}#{3}]({0}/{1}/-/{2}/{3}) - {4}".format( self.gitlabapi.url, self.project['path_with_namespace'], diff --git a/did/plugins/jira.py b/did/plugins/jira.py index 23687a31..a3bfea3d 100644 --- a/did/plugins/jira.py +++ b/did/plugins/jira.py @@ -131,7 +131,7 @@ def __init__(self, issue=None, parent=None): def __str__(self): """ Jira key and summary for displaying """ - if self.options.format == "md": + if self.options.format == "markdown": return "[{0}-{1}]({2}) - {3}".format( self.prefix, self.identifier, diff --git a/did/utils.py b/did/utils.py index a0a330af..3852b4f0 100644 --- a/did/utils.py +++ b/did/utils.py @@ -186,7 +186,7 @@ def item(text, level=0, options=None): return # Four space for each level, additional space for wiki format indent = level * 4 - if options.format == "md": + if options.format == "markdown": indent = level * 2 if options.format == "wiki" and level == 0: indent = 1 diff --git a/docs/examples.rst b/docs/examples.rst index b6890b32..34f0fee9 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -95,7 +95,7 @@ corresponding option groups for each of them:: Format: Format: - --format {text,md,wiki} + --format {text,markdown,wiki} Output style, default: text --width WIDTH Maximum width of the report output (default: 79) --brief Show brief summary only, do not list individual items From 453f06a085871360e8c31c819e073e37b76a0916 Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Fri, 8 Sep 2023 13:24:39 +0200 Subject: [PATCH 5/8] Recognize gitlab notes properly With markdown output format properly recognize notes. Address: https://github.com/psss/did/pull/315/files/41e93a1a4bda20c0d077258680be63363e4dcb5c#r1319684728 Signed-off-by: Sandro Bonazzola --- did/plugins/gitlab.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/did/plugins/gitlab.py b/did/plugins/gitlab.py index c47d77dd..cfd01448 100644 --- a/did/plugins/gitlab.py +++ b/did/plugins/gitlab.py @@ -178,12 +178,16 @@ def iid(self): def __str__(self): """ String representation """ if self.parent.options.format == "markdown": + endpoint = "merge_requests" + if self.data['target_type'] == 'Issue' or ( + self.data['target_type'] == 'Note' + and self.data['note']['noteable_type'] == 'Issue' + ): + endpoint = "issues" return "[{1}#{3}]({0}/{1}/-/{2}/{3}) - {4}".format( self.gitlabapi.url, self.project['path_with_namespace'], - ("issues" - if self.data['target_type'] == 'Issue' - else "merge_requests"), + endpoint, str(self.id), self.title) else: return "{0}#{1} - {2}".format( From 4984afdd5407c61e9d3465c118171e2b6e15f6cf Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Fri, 8 Sep 2023 16:28:25 +0200 Subject: [PATCH 6/8] Fix github pull links in markdown Addresses https://github.com/psss/did/pull/315#issuecomment-1711629897 Signed-off-by: Sandro Bonazzola --- did/plugins/github.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/did/plugins/github.py b/did/plugins/github.py index 57f5f355..3972d899 100644 --- a/did/plugins/github.py +++ b/did/plugins/github.py @@ -123,9 +123,9 @@ def __init__(self, data, parent): def __str__(self): """ String representation """ if self.options.format == "markdown": - return "[{0}/{1}#{2}](https://github.com/{0}/{1}/issues/{2}) - {3}".format( + return "[{0}/{1}#{2}]({3}) - {4}".format( self.owner, self.project, - str(self.id), self.data["title"].strip()) + str(self.id), self.data["html_url"], self.data["title"].strip()) else: return "{0}/{1}#{2} - {3}".format( self.owner, self.project, From 2c505c0600fbf3adcdec1e207ed9f45ee462f6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Fri, 8 Sep 2023 17:32:55 +0200 Subject: [PATCH 7/8] Rewrap the readme paragraph --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 8e3dc06e..3098bd27 100644 --- a/README.rst +++ b/README.rst @@ -86,10 +86,10 @@ The default output is plain text of maximum width 79 characters. This can be adjusted using the ``--width`` parameter. To disable shortening altogether use ``--width=0``. The default width value can be saved in the config file as well. Use ``--format=wiki`` to -enable simple MoinMoin wiki syntax or ``--format=markdown`` to enable -markdown syntax. For stats which support them, -``--brief`` and ``--verbose`` can be used to specify a different -level of detail to be shown. +enable simple MoinMoin wiki syntax or ``--format=markdown`` to +enable markdown syntax. For stats which support them, ``--brief`` +and ``--verbose`` can be used to specify a different level of +detail to be shown. --format {text,markdown,wiki} Output style, default: text From 273d33c9aa3bbbff16323248c12c1e7de92bf2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Fri, 8 Sep 2023 17:56:42 +0200 Subject: [PATCH 8/8] Turn off `smartquotes` to correctly render `--format` --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 65dd9b09..36923276 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -175,7 +175,7 @@ # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -# html_use_smartypants = True +smartquotes = False # Custom sidebar templates, maps document names to template names. # html_sidebars = {}