From 5ff6b4610ae23f3d21f1a7eefea033d56e12aaf6 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 1 Jun 2022 08:56:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?:art:=20=E6=96=B0=E5=A2=9E=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0=20`mode`=20https:?= =?UTF-8?q?//github.com/siyuan-note/siyuan/issues/5064?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEV.md | 2 +- DEV_zh_CN.md | 2 +- kernel/util/working.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEV.md b/DEV.md index d81d56b1c..2b57cc6bb 100644 --- a/DEV.md +++ b/DEV.md @@ -27,7 +27,7 @@ NPM mirror: * `cd kernel` * `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"` -* `SiYuan-Kernel.exe --wd=D:/siyuan/app` +* `SiYuan-Kernel.exe --wd=D:/siyuan/app --mode=dev` ### iOS diff --git a/DEV_zh_CN.md b/DEV_zh_CN.md index d057922dd..c4c8153fa 100644 --- a/DEV_zh_CN.md +++ b/DEV_zh_CN.md @@ -27,7 +27,7 @@ NPM 镜像: * `cd kernel` * `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"` -* `SiYuan-Kernel.exe --wd=D:/siyuan/app` +* `SiYuan-Kernel.exe --wd=D:/siyuan/app --mode=dev` ### iOS diff --git a/kernel/util/working.go b/kernel/util/working.go index dd672f74e..14a90718c 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -63,7 +63,7 @@ func Boot() { accessAuthCode := flag.String("accessAuthCode", "", "access auth code") ssl := flag.Bool("ssl", false, "for https and wss") lang := flag.String("lang", "en_US", "zh_CN/zh_CHT/en_US/fr_FR") - + mode := flag.String("mode", "prod", "dev/prod") flag.Parse() if "" != *wdPath { @@ -72,6 +72,7 @@ func Boot() { if "" != *lang { Lang = *lang } + Mode = *mode Resident = *resident ReadOnly = *readOnly AccessAuthCode = *accessAuthCode From ae6fdd3abc292b979688888f4fbf2b998859eb4a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 1 Jun 2022 09:13:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?:art:=20=E6=96=B0=E5=A2=9E=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0=20`mode`=20https:?= =?UTF-8?q?//github.com/siyuan-note/siyuan/issues/5064?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200924100717-yzwzn64.sy | 157 +++++++++++++++++- .../20200828105441-r76vmu5.sy | 157 +++++++++++++++++- .../20211226122358-hctqcn5.sy | 157 +++++++++++++++++- 3 files changed, 468 insertions(+), 3 deletions(-) diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100717-yzwzn64.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100717-yzwzn64.sy index 09d6d137f..7d7e83917 100644 --- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100717-yzwzn64.sy +++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100717-yzwzn64.sy @@ -5,7 +5,7 @@ "id": "20200924100717-yzwzn64", "title": "Kernel parameter", "type": "doc", - "updated": "20220517144139" + "updated": "20220601091217" }, "Children": [ { @@ -612,6 +612,161 @@ "Data": "." } ] + }, + { + "ID": "20220601091217-g6ohtlq", + "Type": "NodeHeading", + "HeadingLevel": 3, + "Properties": { + "id": "20220601091217-g6ohtlq", + "updated": "20220601091217" + }, + "Children": [ + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + } + ] + }, + { + "ID": "20220601091217-monzwye", + "Type": "NodeParagraph", + "Properties": { + "id": "20220601091217-monzwye", + "updated": "20220601091217" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "Use " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode=dev" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " to run in development mode, use " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode=prod" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " to run in production mode, default " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "prod" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": "." + } + ] + }, + { + "ID": "20220601091217-nnqyj25", + "Type": "NodeParagraph", + "Properties": { + "id": "20220601091217-nnqyj25", + "updated": "20220601091217" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "The main difference between development mode and production mode is that development mode uses " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "working directory/appearance/" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " as the appearance folder, while production mode uses " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "workspace/conf/appearance/" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": "." + } + ] } ] } \ No newline at end of file diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200828105441-r76vmu5.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200828105441-r76vmu5.sy index 2571b768f..3fd0879e5 100644 --- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200828105441-r76vmu5.sy +++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200828105441-r76vmu5.sy @@ -5,7 +5,7 @@ "id": "20200828105441-r76vmu5", "title": "内核参数", "type": "doc", - "updated": "20220517144043" + "updated": "20220601091012" }, "Children": [ { @@ -982,6 +982,161 @@ } } ] + }, + { + "ID": "20220601085956-e4x7vfb", + "Type": "NodeHeading", + "HeadingLevel": 3, + "Properties": { + "id": "20220601085956-e4x7vfb", + "updated": "20220601085956" + }, + "Children": [ + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + } + ] + }, + { + "ID": "20220601085956-ckohzhm", + "Type": "NodeParagraph", + "Properties": { + "id": "20220601085956-ckohzhm", + "updated": "20220601090148" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "使用 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode=dev" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " 后将使用开发模式运行,使用 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode=prod" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " 将使用生产模式运行,默认 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "prod" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": "。" + } + ] + }, + { + "ID": "20220601090153-w4lmqvd", + "Type": "NodeParagraph", + "Properties": { + "id": "20220601090153-w4lmqvd", + "updated": "20220601091012" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "开发模式和生产模式的主要区别开发模式会使用 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "工作目录/appearance/" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " 作为外观文件夹,而生产模式使用的是 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "工作空间/conf/appearance/" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": "。" + } + ] } ] } \ No newline at end of file diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122358-hctqcn5.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122358-hctqcn5.sy index 94e8a601a..bf10d9da0 100644 --- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122358-hctqcn5.sy +++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122358-hctqcn5.sy @@ -4,7 +4,7 @@ "Properties": { "id": "20211226122358-hctqcn5", "title": "Kernel 參數", - "updated": "20220517144244" + "updated": "20220601091200" }, "Children": [ { @@ -981,6 +981,161 @@ } } ] + }, + { + "ID": "20220601091152-z1gdkxi", + "Type": "NodeHeading", + "HeadingLevel": 3, + "Properties": { + "id": "20220601091152-z1gdkxi", + "updated": "20220601091152" + }, + "Children": [ + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + } + ] + }, + { + "ID": "20220601091152-fx2ojfv", + "Type": "NodeParagraph", + "Properties": { + "id": "20220601091152-fx2ojfv", + "updated": "20220601091200" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "使用 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode=dev" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " 後將使用開發模式運行,使用 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "--mode=prod" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " 將使用生產模式運行,預設 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "prod" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": "。" + } + ] + }, + { + "ID": "20220601091152-7qrn8ca", + "Type": "NodeParagraph", + "Properties": { + "id": "20220601091152-7qrn8ca", + "updated": "20220601091152" + }, + "Children": [ + { + "Type": "NodeText", + "Data": "開發模式和生產模式的主要區別開發模式會使用 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "工作目錄/appearance/" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": " 作為外觀文件夾,而生產模式使用的是 " + }, + { + "Type": "NodeCodeSpan", + "Data": "code", + "Children": [ + { + "Type": "NodeCodeSpanOpenMarker" + }, + { + "Type": "NodeCodeSpanContent", + "Data": "工作空間/conf/appearance/" + }, + { + "Type": "NodeCodeSpanCloseMarker" + } + ] + }, + { + "Type": "NodeText", + "Data": "。" + } + ] } ] } \ No newline at end of file From e85f7a55cfaf371e75264d10980978f319d3939c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=98=E5=B0=98?= Date: Wed, 1 Jun 2022 09:21:53 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96pre-release=E4=B8=BB?= =?UTF-8?q?=E4=BD=93=E4=BF=A1=E6=81=AF=20(#5063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :octocat: improve the body of release information https://github.com/siyuan-note/siyuan/issues/5062 * :octocat: not match `Widget` milestone https://github.com/siyuan-note/siyuan/issues/5062 --- .github/workflows/ci.yml | 7 ++- scripts/parse-changelog.py | 111 +++++++++++++++++++++++++++++-------- 2 files changed, 92 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6aaa5ea28..14d67f45d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,17 +24,20 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.10" + - run: pip install PyGithub - name: Gather Release Information id: release_info run: | echo "::set-output name=release_title::$(git show --format=%s --no-patch | head -1)" echo "::set-output name=release_version::$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')" - changelog=$(python scripts/parse-changelog.py CHANGE_LOGS.md) + changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} siyuan-note/siyuan) changelog="${changelog//'%'/'%25'}" changelog="${changelog//$'\n'/'%0A'}" changelog="${changelog//$'\r'/'%0D'}" echo "::set-output name=release_body::$changelog" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Extract version from package.json uses: sergeysova/jq-action@v2 @@ -50,7 +53,7 @@ jobs: with: release_name: ${{ steps.release_info.outputs.release_version }} tag_name: ${{ github.ref }} - body: ${{ github.ref }} + body: ${{ steps.release_info.outputs.release_body }} draft: false prerelease: true diff --git a/scripts/parse-changelog.py b/scripts/parse-changelog.py index 1eb1e0d35..6646a4a28 100644 --- a/scripts/parse-changelog.py +++ b/scripts/parse-changelog.py @@ -1,32 +1,95 @@ -#!/usr/bin/env python3 -from pathlib import Path +import os +import re from argparse import ArgumentParser +from collections import defaultdict + +import github + +docmap = { + "Enhancement": "改进功能", + "Document": "文档相关", + "Refactor": "开发重构", + "Bug": "修复缺陷", + "Features": "引入特性", + "Abolishments": "移除功能" +} -def parse_latest_changelog(text: str) -> str: - """Read the contents between the first `##` and the second `##`""" - recording = False - contents: list[str] = [] - for line in text.splitlines(): - if line.strip().startswith("## ") and recording is False: - recording = True - elif line.strip().startswith("## ") and recording is True: - break - if recording: - contents.append(line) +def generate_msg_from_repo(repo_name, tag_name): + """Generate changelog messages from repository and tag name. - return "\n".join(contents[1:]) + Envs: + GITHUB_HOST: the custom github host. + GITHUB_TOKEN: the github access token. + + Args: + repo_name (str): The repository name + tag_name (str): the tag name + """ + hostname = os.getenv("GITHUB_HOST") or "api.github.com" + token = os.getenv("GITHUB_TOKEN") + desc_mapping = defaultdict(list) + + gh = github.Github(token, base_url=f"https://{hostname}") + repo = gh.get_repo(repo_name) + milestone = find_milestone(repo, tag_name) + + for issue in repo.get_issues(state="closed", milestone=milestone): + desc_mapping[get_issue_first_label(issue)].append( + {"title": issue.title, "url": issue.url} + ) + generate_msg(desc_mapping) -def get_changelog() -> str: - parser = ArgumentParser(description="Get the latest change log from CHANG_LOGS.md") - parser.add_argument("changelog_file", help="The path of CHANGE_LOGS.md") +def find_milestone(repo, title): + """Find the milestone in a repository that is similar to milestone title + + Args: + repo (github.repository.Repository): The repository to search + title (str): the title to match + + Returns: + The milestone which title matches the given argument. + If no milestone matches, it will return None + """ + pat = re.search("v([0-9.]+)", title) + if not pat: + return None + version = pat.group(1) + for milestone in repo.get_milestones(): + if version in milestone.title: + return milestone + + +def get_issue_first_label(issue): + """Get the first label from issue, if no labels, return empty string.""" + for label in issue.get_labels(): + if label.name in docmap: + return label.name + return "" + + +def generate_msg(desc_mapping): + """Print changelogs from direction.""" + print() + for header in docmap: + if not desc_mapping[header]: + continue + print(f"### {docmap[header]}\n") + for item in desc_mapping[header]: + print(f"* [{item['title']}]({item['url']})") + print() + + +if __name__ == "__main__": + parser = ArgumentParser( + description="Automaticly generate information from issues by tag." + ) + parser.add_argument("-t", "--tag", help="the tag to filter issues.") + parser.add_argument("repo", help="The repository name") args = parser.parse_args() - with Path(args.changelog_file).open() as f: - return f.read() - -if __name__ == '__main__': - changelog = get_changelog() - latest_changelog = parse_latest_changelog(changelog) - print(latest_changelog) + try: + generate_msg_from_repo(args.repo, args.tag) + except AssertionError: + print(args.tag) From 521538d777c42867ebe14764e9b9ab04a38a5a39 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 1 Jun 2022 10:10:52 +0800 Subject: [PATCH 4/4] =?UTF-8?q?:memo:=20=E6=8F=90=E4=BA=A4=E8=B4=A1?= =?UTF-8?q?=E7=8C=AE=E8=80=85=E5=85=AC=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CODE_OF_CONDUCT.md | 128 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..08a939bcb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +os@b3log.org. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. \ No newline at end of file