Skip to content

Commit dfbb1b0

Browse files
docs: add support
1 parent c642786 commit dfbb1b0

3 files changed

Lines changed: 137 additions & 7 deletions

File tree

SUPPORT.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
## Need support?
8+
9+
**First, read the documentation!**
10+
11+
### Read the Docs
12+
13+
Select projects have the documentation hosted on Read the Docs. Otherwise, check the project's README file.
14+
15+
**Type:** Documentation
16+
17+
📖 [Read the Docs](https://docs.lizardbyte.dev/latest/about/overview.html)
18+
19+
---
20+
21+
## Need more help?
22+
23+
**Ask questions**
24+
25+
### Discord
26+
27+
This is our preferred method of providing support!
28+
Please read the rules, be courteous, and use the appropriate channel when posting.
29+
30+
**Type:** Primary Support
31+
32+
💬 [Join our Discord](https://discord.com/invite/d6MpcrbYQs)
33+
34+
### GitHub
35+
36+
GitHub *Discussions* are available for support, feature requests, and general discourse.
37+
Please DO NOT use GitHub issues to ask for support!
38+
39+
**Type:** Primary Support
40+
41+
🐙 [GitHub Discussions](https://github.com/orgs/LizardByte/discussions)
42+
43+
### Reddit
44+
45+
For aliens only! Please read the rules, be courteous, and use the appropriate flair when posting.
46+
Provide your logs when asking for help.
47+
48+
**Type:** Community Support
49+
50+
👽 [r/LizardByte](https://www.reddit.com/r/LizardByte)
51+
52+
---
53+
54+
## Additional Resources
55+
56+
- 📚 [Documentation](https://docs.lizardbyte.dev/latest/about/overview.html)
57+
- 🏠 [Homepage](https://app.lizardbyte.dev/)
58+
- 🔧 [Status Page](https://status.LizardByte.dev)
59+
- 📝 [Blog](https://app.lizardbyte.dev/blog)
60+
61+
---
62+
63+
## Support Guidelines
64+
65+
When seeking support, please:
66+
67+
1. **Read the documentation first** - Many common questions are answered in our comprehensive docs
68+
2. **Use the appropriate channel** - Discord and GitHub Discussions for primary support, Reddit for community support
69+
3. **Be courteous and respectful** - Follow community guidelines and be patient with volunteers
70+
4. **Provide detailed information** - Include logs, error messages, and system information when relevant
71+
5. **Use proper formatting** - Help others help you by formatting code and logs properly

docs/source/about/support.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
Support
2-
=======
3-
4-
.. Warning:: 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-
Our available support methods are listed in our `Support Center <https://app.lizardbyte.dev/support>`__.
1+
.. include:: ../../../SUPPORT.md
2+
:parser: myst_parser.docutils_

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)