rasendubi / uniorg

An accurate Org-mode parser for JavaScript/TypeScript
https://oleksii.shmalko.com/uniorg
GNU General Public License v3.0
263 stars 25 forks source link

Adding class to task headings #44

Closed ispringle closed 2 years ago

ispringle commented 2 years ago

It'd be great if the task headings ie:

* TODO foo
* DONE bar

Had a class name added so we can style them separately from the regular headings.

rasendubi commented 2 years ago

This can be done as a plugin or by adding a className here (conditional on whether headline has a todo keyword): https://github.com/rasendubi/uniorg/blob/da79786f7c3afda29f8fb65052e09ca4fec6d4f3/packages/uniorg-rehype/src/org-to-hast.ts#L261

rasendubi commented 2 years ago

Here is an example of how to do that with a plugin: https://github.com/rasendubi/uniorg/pull/46#issuecomment-1236140015