I’m attempting to use ENML for the first time. I don’t know XHTML at all. I’ve been using different resources to try to make it work. Here is my action:
It’s set to prepend and render in ENML (obviously).
It doesn’t work! LOL. If I remove the color part, it works.
%%[[date|%G.%m.%d @ %H%M]]
Test Text
[[draft]]%%
Any comments or corrections would be awesome! Thanks
Is there a reason you want to use ENML? You need a pretty good understanding of what it is and how to create valid XML to write it directly. In most cases you would be better off using a different output format.
If you are writing this for an iOS Evernote action step in Drafts, I would just use the “Markdown” template output type, with the template like:
[[date|%G.%m.%d @ %H%M]]
Test Text
[[draft]]
Drafts will take case of convert the content to ENML for you.
Because I’m looking to have the ‘Test Text’ section colored. It’s a journal. I’ll have different actions for different types of journal entries with the text of (Test Text) and it’s color different to easily ID different categories of journal entries. I would love to use Markdown. While I’m a rookie at it…I definitely understand it MUCH better than ENML. I have the Markdown version mostly working. There’s one thing I’d like to accomplish that I don’t know if it’s possible. But I’m fairly sure that formatting text to a certain color in markdown doesn’t work. Am I wrong?
The ‘one thing’ I can’t figure out (besides formatting color) has to do with prepending. I have a Evernote link at the top of the note that I want to stay at the top of the note. I want the prepended text coming from Drafts to be entered on the 2nd line of the note. Not sure how to accomplish this or even if this is possible.
For the most part, ENML is HTML. That what the Markdown conversion relies on to work, since Markdown outputs HTML. Markdown also allows inline HTML tags, so you can include styled HTML markup (as long as it’s tags supported by ENML, but that’s most of the common ones).
So, this template, set to output Markdown, would work to get you bold, red text:
## [[date]]
<p style="font-weight:bold;color:red;">Here's some bold red text!</p>
[[draft]]
## [[date]]
<span style="font-weight:bold;color:red;">Here's some bold red text!</span><br><span style="font-weight:bold;color:blue;">Here's some bold blue text!</span>
[[draft]]
Span may not be supported by ENML then. I didn’t get time to try it over breakfast myself today, and it’s a long time since I read Evernote’s ENML spec.
I feel incredibly dimwitted. I used your last code. Modified it a little for font weight and the text content I wanted to be red. It worked fantastically.
I then modified it again for a different category of journal entry. I changed the color and text. I tried both green and blue. Drafts threw and error.
What am I doing wrong?
Sorry to be so slow on this…
Also…how do I get the code to show up like in your post @agiletortoise? When I copied and pasted it and then posted, the formatting code disappeared. I ended up uploading screenshots.
Looking at your screen shot, I would say that the closing double quote of the style attribute of the span tag is a smart quote rather than a plain double quote.