Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nanozuki/nvimdockery
A tool to help you write vim help doc
https://github.com/nanozuki/nvimdockery
Last synced: about 2 months ago
JSON representation
A tool to help you write vim help doc
- Host: GitHub
- URL: https://github.com/nanozuki/nvimdockery
- Owner: nanozuki
- License: mit
- Created: 2024-06-11T09:18:18.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-12T08:16:39.000Z (7 months ago)
- Last Synced: 2024-06-12T12:07:12.722Z (7 months ago)
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nvimdockery
A tool to help you write vim help doc. The syntax is inspired by typst.
## Syntax
**Render Switch**
```
#par(ignore-vimdoc:true)[
this is a paragraph only appears in markdown.
]
#par(ignore-markdown:true)[
this is a paragraph only appears in vimdoc.
]
```**Title**
```
#title[Document Title]
```Generated markdown:
```markdown
# Document Title
```Generated vimdoc:
```vimdoc
filename.txt Document Title
```**Headers**
```
= Header 1
== Header 1.1
=== Section 1.1.1
```Generated markdown, markdown's level-1 header is reserved for the document title:
```markdown
## Header 1### Header 1.1
#### Section 1.1.1
```Generated vimdoc, level 3 headers won't be uppercase, and won't in the table of
contents:```vimdoc
===============================================================================
1. Header 1 *myplugin-header-1*HEADER 1.1 *myplugin-header-1.1*
Section 1.1.1 *myplugin-section-1.1.1*
```**Indent**
```
#par(indent: 8)This is a paragraph with indent.
```Generated markdown:
```markdown
This is a paragraph with indent.
```Generated vimdoc:
```vimdoc
This is a paragraph with indent.
```**List**
```
+ Item 1
+ Item 2
- Item 2.1
- Item 2.2
```Generated markdown:
```markdown
1. Item 1
2. Item 2
- Item 2.1
- Item 2.2
```Generated vimdoc:
```vimdoc
1. Item 1
2. Item 2
- Item 2.1
- Item 2.2
```**table**
**Definition**
Infer a definition from annotations in lua code. Annotations must start with
three dashes `---`.```
#def(fun: math.add)
```Generated markdown:
```markdown
myplugin-math.add()Add two numbers.
Parameters:
- `left` (number) The left operand.
- `right` (number) The right operand.Return:
- (number) The sum of the two numbers.
```Generated vimdoc:
```vimdoc
add({left}, {right}) *myplugin-math.add()*
Add two numbers.Parameters: ~
- {left} (number) The left operand.
- {right} (number) The right operand.Return: ~
(number) The sum of the two numbers.
```The definition type include
- `fun` for function: `@param`, `@return`
- `class` for class: `@class`, `@field`
- `alias` for alias: `@alias`
- `enum` for enum: `@enum`If there are addtional information, you can add it like this:
```
#def(fun: math.add)[
This is a function to add two numbers.
]
```**link**
```
#link("https://typst.app/docs/reference/model/link/")["typst reference"]
#image("https://typst.app/docs/assets/typst-logo.svg")[typst logo]
#tag(autocmd-groups)
#opt(option-name)
#cmd(:filetype)
```If `#tag` in separate line, it will create a tag. Otherwise, it will is a
hot-link to the tag.**table**
```
#table(
columns: 3,
table.header(["opt"], ["description"]),
[opt1]
[description1]
[opt2]
[description2]
[opt3]
[
description3
with
multiple
lines
]
)
```