Skip to content

Commit 15cacfb

Browse files
authored
Document how to release draupnir news (#109)
* Initial DraupnirNews documentation. the-draupnir-project/planning#61. * Roughly complete the guide. We just need an example PR now. the-draupnir-project/planning#61 * Add PR example. * Whoops missing code block on html example innit.
1 parent fbee127 commit 15cacfb

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

docs/contributing/draupnir-news.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Draupnir news
2+
3+
:::info
4+
5+
This guide explains:
6+
7+
1. Editing and viewing news items locally.
8+
2. What the style guidelines are for news items.
9+
3. What should be included in the pull request to release news items.
10+
4. The review process for news items.
11+
12+
:::
13+
14+
## Where does Draupnir news come from?
15+
16+
Draupnir news is requested from the github repository main branch version of
17+
`src/protections/DraupnirNews/draupnir_news.json`. Additionally, the local
18+
source version of this file is also used to source news. Editing news involves
19+
editing the local copy of the news file.
20+
21+
## Editing and viewing news items locally
22+
23+
The process for editing news items goes as follows:
24+
25+
1. Use a Matrix client of your choice to format a Matrix message announcing the
26+
news. This is just the same as writing a message, use markdown to structure
27+
the message however you like, within the style guidelines. You are probably
28+
better off just copying the markdown from a similar event if that is easier.
29+
30+
2. Once you are happy you can send the event to a test room.
31+
32+
3. View the event source and copy the event content into your local
33+
`draupnir_news.json`.
34+
35+
4. Create a UUID v4 for the news item. This can be done just by using
36+
`node -e "console.log(crypto.randomUUID())"` or an equivalent command.
37+
38+
Your Draupnir news should look something like this:
39+
40+
<!-- cspell:ignore msgtype -->
41+
42+
```json
43+
{
44+
"news": [
45+
{
46+
"news_id": "cd1881d2-60d0-49ad-9951-321205efa64b",
47+
"matrix_event_content": {
48+
"msgtype": "m.notice",
49+
"body": "#### 📰 Draupnir Assembly: Call for Participation\n\nThe Longhouse Assembly is determining the next direction for the project.\n\nReview the current cycle and cast your vote:\n\n➡️ [Join the Assembly Discussion](https://matrix.to/#/!DtwZFWORUIApKsOVWi:matrix.org?via=matrix.org&via=feline.support&via=asgard.chat)",
50+
"format": "org.matrix.custom.html",
51+
"formatted_body": "<h4>📰 Draupnir Assembly: Call for Participation</h4>\n<p>The Longhouse Assembly is determining the next direction for the project.</p>\n<p>Review the current cycle and cast your vote:</p>\n<p>➡️ <a href=\"https://matrix.to/#/!DtwZFWORUIApKsOVWi:matrix.org?via=matrix.org&amp;via=feline.support&amp;via=asgard.chat\">Join the Assembly Discussion</a></p>\n"
52+
}
53+
}
54+
]
55+
}
56+
```
57+
58+
## Style Guidelines
59+
60+
1. Use a small header (`<h4>`) with boldface and an emoji to make it look
61+
professional e.g. `#### 📰 Draupnir Assembly: Call for Participation`.
62+
63+
2. Keep the message 1-2 sentences long and link directly to the subject matter.
64+
65+
3. Try to base your message off of previous events.
66+
67+
## Creating a pull request for a news item
68+
69+
The pull request should contain the following:
70+
71+
- `DraupnirNews` in the title.
72+
- A screenshot of the news content in the description.
73+
- Any context of the news.
74+
- The client used to design the message.
75+
76+
The pull request should remain a draft until you are sure that it is ready to
77+
merge. This prevents accidents.
78+
79+
Here is an example pull request:
80+
https://github.com/the-draupnir-project/Draupnir/pull/984
81+
82+
## Reviewing a pull request for a news item
83+
84+
Reviewers should take care to verify that draupnir actually sends the content as
85+
depicted in the screenshot or in any part of the pull request.

0 commit comments

Comments
 (0)