Skip to content

Commit d0f91d7

Browse files
author
github-actions
committed
[docgen] Update doc/orgmode.txt
1 parent e22ebd3 commit d0f91d7

File tree

1 file changed

+52
-16
lines changed

1 file changed

+52
-16
lines changed

doc/orgmode.txt

+52-16
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,16 @@ Variables:
621621
* `%^{PROMPT|DEFAULT|COMPLETION...}`: Prompt for input, if completion is provided an :h inputlist will be used
622622
* `%(EXP)`: Runs the given lua code and inserts the result. NOTE: this will internally pass the content to the lua `load()` function. So the body inside `%()` should be the body of a function that returns a string.
623623

624+
Templates have the following fields:
625+
* `description` (`string`) — description of the template that is displayed in the template selection menu
626+
* `template` (`string|string[]`) — body of the template that will be used when creating capture
627+
* `target` (`string?`) — name of the file to which the capture content will be added. If the target is not specified, the content will be added to the `org_default_notes_file` (#orgdefaultnotesfile) file
628+
* `headline` (`string?`) — title of the headline after which the capture content will be added. If no headline is specified, the content will be appended to the end of the file
629+
* `properties` (`table?`):
630+
* `empty_lines` (`table|number?`) — if the value is a number, then empty lines are added before and after the content. If the value is a table, then the following fields are expected:
631+
* `before` (`integer?`) — add empty lines to the beginning of the content
632+
* `after` (`integer?`) — add empty lines to the end of the content
633+
624634
Example:
625635
>
626636
{ T = {
@@ -632,20 +642,24 @@ Example:
632642

633643
Journal example:
634644
>
635-
{ j = {
636-
description = 'Journal',
637-
template = '\n*** %<%Y-%m-%d> %<%A>\n**** %U\n\n%?',
638-
target = '~/sync/org/journal.org'
639-
} }
645+
{
646+
j = {
647+
description = 'Journal',
648+
template = '\n*** %<%Y-%m-%d> %<%A>\n**** %U\n\n%?',
649+
target = '~/sync/org/journal.org'
650+
},
651+
}
640652
<
641653

642654
Journal example with dynamic target, i.e. a separate file per month:
643655
>
644-
{ J = {
645-
description = 'Journal',
646-
template = '\n*** %<%Y-%m-%d> %<%A>\n**** %U\n\n%?',
647-
target = '~/sync/org/journal/%<%Y-%m>.org'
648-
} }
656+
{
657+
J = {
658+
description = 'Journal',
659+
template = '\n*** %<%Y-%m-%d> %<%A>\n**** %U\n\n%?',
660+
target = '~/sync/org/journal/%<%Y-%m>.org'
661+
},
662+
}
649663
<
650664

651665
Nested key example:
@@ -665,16 +679,38 @@ Nested key example:
665679
headline = 'one-time'
666680
}
667681
}
682+
-- or
683+
{
684+
e = {
685+
description = 'Event',
686+
subtemplates = {
687+
r = {
688+
description = 'recurring',
689+
template = '** %?\n %T',
690+
target = '~/org/calendar.org',
691+
headline = 'recurring'
692+
},
693+
o = {
694+
description = 'one-time',
695+
template = '** %?\n %T',
696+
target = '~/org/calendar.org',
697+
headline = 'one-time'
698+
},
699+
},
700+
},
701+
}
668702
<
669703

670704
Lua expression example:
671705
>
672-
{ j = {
673-
description = 'Journal',
674-
template = '* %(return vim.fn.getreg "w")',
675-
-- get the content of register "w"
676-
target = '~/sync/org/journal.org'
677-
} }
706+
{
707+
j = {
708+
description = 'Journal',
709+
template = '* %(return vim.fn.getreg "w")',
710+
-- get the content of register "w"
711+
target = '~/sync/org/journal.org'
712+
},
713+
}
678714
<
679715

680716
ORG_AGENDA_MIN_HEIGHT *orgmode-org_agenda_min_height*

0 commit comments

Comments
 (0)