Skip to content

Commit 08a1487

Browse files
docs: add support
1 parent c642786 commit 08a1487

4 files changed

Lines changed: 101 additions & 7 deletions

File tree

SUPPORT.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Support
2+
3+
> [!WARNING]
4+
> We use GitHub issues exclusively for actionable bug reports. Low-effort issues will be immediately closed.
5+
> Spamming the GitHub repo or organization will result in a ban.
6+
7+
## Getting Support
8+
9+
**First, read the documentation!** Many common questions are answered in our comprehensive docs.
10+
11+
| Platform | Support Type | Description |
12+
|----------------------------------------------------------------------------|-----------------------|----------------------------------------|
13+
| 📖 [Read the Docs](https://docs.lizardbyte.dev/latest/about/overview.html) | **Documentation** | Official documentation and guides |
14+
| 💬 [Discord](https://discord.com/invite/d6MpcrbYQs) | **Primary Support** | Real-time chat support |
15+
| 🐙 [GitHub Discussions](https://github.com/orgs/LizardByte/discussions) | **Primary Support** | Feature requests and general discourse |
16+
| 👽 [Reddit](https://www.reddit.com/r/LizardByte) | **Community Support** | Community-driven support |
17+
18+
## Additional Resources
19+
20+
- 🏠 [Homepage](https://app.lizardbyte.dev/)
21+
- 🔧 [Status Page](https://status.LizardByte.dev)
22+
- 📝 [Blog](https://app.lizardbyte.dev/blog)
23+
- 🗺️ [Roadmap](https://app.lizardbyte.dev/roadmap)
24+
25+
## Support Guidelines
26+
27+
When seeking support, please:
28+
29+
1. **Read the documentation first** - Many common questions are already answered in docs
30+
2. **Use the appropriate channel** - Each platform has multiple channels/categories for support,
31+
select the one that best fits your question
32+
3. **Be courteous and respectful** - Follow community guidelines and be patient with volunteers
33+
4. **Provide detailed information** - Include logs, error messages, and system information when relevant
34+
5. **Use proper formatting** - Help others help you by formatting code and logs properly
35+
6. **Do not cross post** - Please avoid posting the same question in multiple places

docs/source/about/support.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../../../SUPPORT.md
2+
```

docs/source/about/support.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
'sphinx_copybutton', # add a copy button to code blocks
4040
]
4141

42+
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
43+
myst_enable_extensions = [
44+
"colon_fence", # Only enabled so we can implement am adhoc fix to render GitHub admonitions
45+
]
46+
4247
# Add any paths that contain templates here, relative to this directory.
4348
# templates_path = ['_templates']
4449

@@ -94,3 +99,62 @@
9499
# disable epub mimetype warnings
95100
# https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/docs/conf.py#L235-L236
96101
suppress_warnings = ["epub.unknown_project_files"]
102+
103+
104+
# Issue https://github.com/executablebooks/MyST-Parser/issues/845
105+
# GitHub admonitions with Sphinx/MyST
106+
# Workaround template adapted from (with some changes):
107+
# https://github.com/python-project-templates/yardang/blob/f77348d45dcf0eb130af304f79c0bfb92ab90e0c/yardang/conf.py.j2#L156-L188
108+
109+
# https://spdx.github.io/spdx-spec/v2.3/file-tags/#h3-snippet-tags-format
110+
# SPDX-SnippetBegin
111+
# SPDX-License-Identifier: Apache-2.0
112+
# SPDX-SnippetCopyrightText: Tim Paine / the yardang authors <t.paine154@gmail.com">
113+
114+
_GITHUB_ADMONITIONS = {
115+
"> [!NOTE]": "note",
116+
"> [!TIP]": "tip",
117+
"> [!IMPORTANT]": "important",
118+
"> [!WARNING]": "warning",
119+
"> [!CAUTION]": "caution",
120+
}
121+
122+
123+
def convert_gh_admonitions(app, relative_path, parent_docname, contents):
124+
# TODO handle nested directives -> recursion
125+
# loop through content lines, replace github admonitions
126+
for i, orig_content in enumerate(contents):
127+
orig_line_splits = orig_content.split("\n")
128+
replacing = False
129+
for j, line in enumerate(orig_line_splits):
130+
# look for admonition key
131+
line_roi = line.lstrip()
132+
for admonition_key in _GITHUB_ADMONITIONS:
133+
if line_roi.startswith(admonition_key):
134+
line = line.replace(admonition_key, ":::{" + _GITHUB_ADMONITIONS[admonition_key] + "}")
135+
# start replacing quotes in subsequent lines
136+
replacing = True
137+
break
138+
else: # no break
139+
if not replacing:
140+
continue
141+
# remove GH directive to match MyST directive
142+
# since we are replacing on the original line, this will preserve the right indent, if any
143+
if line_roi.startswith("> "):
144+
line = line.replace("> ", "", 1)
145+
elif line_roi.rstrip() == ">":
146+
line = line.replace(">", "", 1)
147+
else:
148+
# missing "> ", so stop replacing and terminate directive
149+
line = f":::\n{line}"
150+
replacing = False
151+
# swap line back in splits
152+
orig_line_splits[j] = line
153+
# swap line back in original
154+
contents[i] = "\n".join(orig_line_splits)
155+
156+
# SPDX-SnippetEnd
157+
158+
159+
def setup(app):
160+
app.connect("include-read", convert_gh_admonitions)

0 commit comments

Comments
 (0)