feat(apis): add new useful methods to OrgApiFile and OrgApiHeadline#1127
feat(apis): add new useful methods to OrgApiFile and OrgApiHeadline#1127ar-at-localhost wants to merge 6 commits intonvim-orgmode:masterfrom
OrgApiFile and OrgApiHeadline#1127Conversation
- Add OrgHeadline:clock_in(opts) - clock in headline with optional silent event - Add OrgHeadline:clock_out(opts) - clock out headline with optional silent event - Add OrgHeadline:toggle_clock(opts) - toggle clock state (in if out, out if in) - Add OrgHeadline:is_clocked_in() - check if headline is clocked in - Add OrgHeadline:cancel_active_clock() - cancel active clock without event - Add OrgHeadline:set_todo(keyword) - set todo keyword on headline
| @return string | ||
|
|
||
|
|
||
| OrgFile:insert_headline() *OrgFile:insert_headline* |
There was a problem hiding this comment.
@kristijanhusak I'm not familiar with lemmy-help, so I generated these blindly. Please have a careful look. Thanks
There was a problem hiding this comment.
These are auto generated from annotations, no need to add anything.
| end) | ||
| end | ||
|
|
||
| ---Clock-out in the headline |
| assert.is.Nil(closest_headline) | ||
| end) | ||
|
|
||
| describe('insert_headline', function() |
There was a problem hiding this comment.
@kristijanhusak AI generated. Have a careful look. Thanks
OrgApiFile and `OrgApiHeadlineOrgApiFile and OrgApiHeadline
| @return string | ||
|
|
||
|
|
||
| OrgFile:insert_headline() *OrgFile:insert_headline* |
There was a problem hiding this comment.
These are auto generated from annotations, no need to add anything.
| --- Insert a headline to the file | ||
| --- @param headline OrgApiHeadline | OrgHeadline | { level: integer, keyword?: string, text: string } Headline to be inserted | ||
| --- @param after? OrgApiHeadline | OrgHeadline Optional headline to put after | ||
| function OrgFile:insert_headline(headline, after) |
There was a problem hiding this comment.
We don't need this in the API. You can use capture flow to insert headlines. If you need this level of programmatic insertion you can create your own function.
There was a problem hiding this comment.
Please remove all these new files that does not relate to the plugin.
Summary
This PR adds new API methods to
OrgApiFileandOrgAPIHeadlinefor programmatic uses.Changes
Non-Breaking
Headline:clock_inandHeadline:clock_outnow accepts optional opts to enable silent behavior (useful for programmatic uses).Checklist
I confirm that I have:
Conventional Commits
specification (e.g.,
feat: add new feature,fix: correct bug,docs: update documentation).make test.