Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi,
I am using this in a lot of places now: icon:wrench[] _TODO: Something todo here_ I would like to be able to do something like: todo:[] Something todo here by defining that 'todo' should expand to the icon and the TODO and the italics stuff. I have read up on macro's and such, but I am still unsure if want I want is possible and/or how to do it? regards, Wim |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
I managed to get this:
:todo-item: pass:normal[icon:wrench[] _TODO:_] which allows me to do this: {todo-item} Something that still needs to be done. The only thing missing is that "Something that still needs to be done." is not in italic like "TODO" itself. Any idea on how to add that? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
My advice here is to write an inline macro extension that processes syntax similar to this: [source,asciidoc] todo:[Something that still needs to be done.]---- ---- You can study other inline macro extensions (labeled as such) in the extensions lab. https://github.com/asciidoctor/asciidoctor-extensions-lab/tree/master/lib One thing slightly different from existing examples is that you need to indicate you want the short form of the macro. Something like: [source,ruby] ---- class TodoMacro < Extensions::InlineMacroProcessor use_dsl named :todo using_format :short def process parent, target, attrs ... end end ---- At the moment, inline macros return the replacement string directly...so you can just return the HTML that you want. Of course, if you want to support other backends, you will need to check the backend and return the appropriate markup (for instance, DocBook if the backend is docbook). I know we desperately need documentation for writing extensions. I promise you that I'm going to get serious about it as soon as a possibly can. However, if someone else wants to start to run with it, please don't hesitate to take the initiative. See https://github.com/asciidoctor/asciidoctor.org/issues/347 On Mon, Jan 12, 2015 at 5:36 AM, wimdeblauwe [via Asciidoctor :: Discussion] <[hidden email]> wrote: I managed to get this: -- Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi, Thanks for that, but I am afraid that is a bit out of my league. What I have is good enough for my needs for now. regards, Wim 2015-01-19 7:53 GMT+01:00 mojavelinux [via Asciidoctor :: Discussion] <[hidden email]>:
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
I understand...though it really isn't hard to make an extension. It's only a few more lines of code than what I included in my message in this case. Plus, I think it opens a lot of possibilities for the future. Asciidoctor loves extensions! Cheers,-Dan On Mon, Jan 19, 2015 at 12:07 AM, wimdeblauwe [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [show rest of quote] -- Dan Allen | http://google.com/profiles/dan.j.allen |
Free forum by Nabble | Edit this page |