WriterSide 插件
引用代码片段
在 .cfg 文件中添加
<snippets dir="codes" />来指定代码片段所在的文件夹
{src="a.js" include-lines="1,3,5,6-9"}
{src="a.js" include-symbol="sayHello"}
快捷键
Press <shortcut key="$Copy"/> to copy.
1. 添加 keymap.xml
2. buildprofiles.xml 中添加
<shortcuts>
<src>keymap.xml</src>
<layout name="Windows" display-name="Windows"/>
<layout name="macOS" display-name="macOS"/>
</shortcuts>
3. 在预览界面切换 Windows 和 macOS ,就可以显示对应的快捷键方案了。
<procedure title="Add something" id="procedure-id">
<p>Before adding something, create it.</p>
<step>Do this.</step>
<step>Do that.</step>
<p>Congratulation! You've added something.</p>
</procedure>
Default chapter title
<title instance="foo">Chapter title for Foo</title>
Some text.
<show-structure for="chapter,procedure" depth="2"/>
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua.
{id="unique-id"}
Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.
<p>
If the Welcome screen opens, click
<control>
Check out from Version Control
</control>,
then select <control>Git</control>.
</p>
<p>
A Writerside
<emphasis>project</emphasis>
consists of a set of documentation topics
and configuration files that define the
project and preview settings, glossaries,
and the documentation structure.
</p>
Go to <ui-path>Settings/Preferences | Tools | Writerside</ui-path>.
The list of categories is stored
in the <path>c.list</path> file
within the module directory.
The TOC is stored in the product's
<path>.tree</path> file.
Press <shortcut>Ctrl+C</shortcut> to copy.
Press <shortcut key="$Copy"/> to copy.
format
> style=[bold, italic, strikethrough, underline, superscript, subscript]
<format style="bold" color="RosyBrown">Hello, world!</format>
<format style="subscript" color="Red">Hello, world!</format>
## Chapter's title {collapsible="true"}
Some content.
class Person(val name: String) {
val children: MutableList<Person> = mutableListOf()
constructor(name: String, parent: Person) : this(name) {
parent.children.add(this)
}
}
{collapsible="true" collapsed-title="代码片段之我爱学习"}
{collapsible="true"}
Expanded by default
{collapsible="true" default-state="expanded"}
: This is the definition of the first term.
Collapsed by default
{collapsible="true" default-state="collapsed"}
: This is the definition of the second term.
TL;DR blocks
<tldr>
<p>Shortcut: <shortcut>Ctrl+Space</shortcut></p>
<p>Configure: <ui-path>Settings / Preferences | Editor | Code Completion</ui-path></p>
</tldr>
警告块
Tip
这是一个 Tip
Note
> 这是一个 Note
>
Warning
> 这是一个 Warning
>
Link
Chapter one
Text in chapter one
Chapter two
Text in chapter two
Example links
Here is [a link to the first chapter](#chapter-one).
Here is [a link to the second chapter](#second).
You can reference the JetBrains website multiple times and even use different link text every time. Or reference an anchor.
Images
{ width="450" }
Video
<video src="https://youtu.be/BeJu9bMPLGU"/>
<seealso>
<category ref="related">
<a href="zookeeper.md">Topic about links</a>
</category>
<category ref="external">
<a href="https://www.google.com">Google</a>
<a href="https://www.jetbrains.com"/>
</category>
</seealso>
List
-
First item.
- First indented item.
- Second indented item.
{style="alpha-lower"} -
Second item.
-
Third item
-
Fourth item
{start="1"}
- Some list item
- Another list item
- Yet another list item
- Some indented item
- Another indented item
- One more item
Definition List
`{style="narrow" sorted="desc"}`
First Term
: This is the definition of the first term.
Second Term
: This is the definition of the second term.
Table
| Foo | Bar | Baz |
|---|---|---|
| One | Two | Three |
| Higher | Faster | Stronger |
Tabs
<tabs>
<tab title="First tab">
<p>Content of the first tab.</p>
</tab>
<tab title="Second tab">
<p>Content of the second tab.</p>
</tab>
</tabs>
Code snippets
Code
a code snippet
{attributes go here}
inline code
To output a line on the screen use
echo "Hello world!".
tooltip
Send an <tooltip term="HTTP">HTTP</tooltip> request.
Switchable content
Section One {switcher-key="Section One"}
The content that should appear when the Section Once is selected.
Section Two {switcher-key="Section Two"}
The content that should appear when the Section Two is selected.
Mermaid diagrams
graph LR
A[Do you write docs?]
A -- Yes --> B[Use Writerside]
A -- No --> C[Tell us why]
sequenceDiagram
Tech writer -->> Developer: Hi, can you check that I've described everything correctly?
Developer -->> Junior developer: Hi, can you, please, help our TW with the task?
Developer --x Tech writer: Sure, I've asked Garold to take care of this, it will help him to understand the logic better.
Junior developer -->> Developer: No problem!
Developer --> Tech writer: Adding you both to a group chat ...
Note right of Developer: Adding to the chat.
Tech writer --> Junior developer: Hi, Garold!
sequenceDiagram
a -->> b: Query... ... ... ... ... .... . ........
b -->> c: Forward query
Note over c: aaaaaaaaaaaaa
Note right of c: Thinking...
c -->> b: Response query
b -->> a: Forward response
stateDiagram-v2
[*] --> Draft
RR: Ready for review
NU: Need updates
AC: Apply changes
LGTM: All good
RP: Ready to publish
Draft --> RR
RR --> Review
Review --> NU
NU --> AC
AC --> Review
Review --> LGTM
LGTM --> RP
RP --> [*]
gitGraph
commit
commit
branch DOC-123-update-the-doc-A
checkout DOC-123-update-the-doc-A
commit id: "write the procedure"
commit id: "update screenshots"
checkout main
merge DOC-123-update-the-doc-A
commit
commit
PlantUML Diagrams
@startuml
Bob->Alice : Hello!
@enduml
Math expressions
\begin{equation}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}