emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] RFC: Proposal for an Org Special Block for ox-html


From: Aaron Ecay
Subject: Re: [O] RFC: Proposal for an Org Special Block for ox-html
Date: Fri, 25 May 2018 15:19:54 +0100
User-agent: Notmuch/0.26 (https://notmuchmail.org) Emacs/27.0.50 (x86_64-pc-linux-gnu)

Hi Kaushal,

2018ko maiatzak 24an, Kaushal Modi-ek idatzi zuen:

> That's why I am using (org-element-property :attr_html special-block) in
> the code to get the raw values to #+attr_html.

Iʼm not sure I made myself clear in the previous message.  In any case,
this org:

╭────
│ #+attr_html: :open t
│ #+begin_details
│ #+begin_summary
│ Open for details
│ 
│ More summary.
│ #+end_summary
│ Many details here.
│ #+end_details
╰────

exports to this HTML (using current-ish master with no additional
modifications beyond the tweak to org-html-html5-elements):

╭────
│ <details open="t">
│ <summary>
│ <p>
│ Open for details
│ </p>
│ 
│ <p>
│ More summary.
│ </p>
│ </summary>
│ <p>
│ Many details here.
│ </p>
│ </details>
╰────

which displays in the open state in a browser (in any event, in Chromium
66).  So I think what you want already exists for this feature.

> That would be great. I myself wasn't sure if I should bring that up to Org
> core.. I had just implemented #+attr_css support for ox-hugo.
> 
> It looks like this:
> 
> #+attr_html: :class red-text
> #+attr_css: :color red
> - Red list item 1
> - Red list item 2
> 
> Above will generate <style .red-text { color: red; } </style><div
> class="red-text">..</div>, with that list in the div.

What is wrong with:

#+attr_html: :style color:red;
- red list 1
- red list 2

?

That works in vanilla org today (exporting to html), without needing to
generate extra “style” and “div” elements.

> 
> You can find many such examples in
> https://address@hidden/kaushalmodi/ox-hugo/blob/master/test/site/content-org/all-posts.org,
> and the implementation in
> https://github.com/kaushalmodi/ox-hugo/blob/master/ox-blackfriday.el. Let
> me know what you think if you have a chance to review those.

I looked at the file briefly.  I had trouble determining what might
represent missing features in ox-{html,md}, and what was included to
work around quirks in a particular implementation of markdown.

On a broader level, both org and html have well-defined syntax, and
easy-to-work-with programmatic representations in lisp.  Markdown...does
not.  Since markdown-ing a valid HTML document should be a no-op
(AFAIK), I donʼt understand why you are bothering with markdown at all
in your usecase.  If it was me, I would just generate HTML from org and
skip the markdown step entirely.

It seems to me like you could get rid of ox-blackfriday, leaving behind
only a small ox-html-plus-plus containing whatever QOL improvements to
the vanilla html backend suited your taste (and that of ox-hugoʼs users).
If the set of QOL improvements is empty, then the custom backend would
disappear entirely.  Less code for the same features = maintenance win in
my book.  YMMV of course...

-- 
Aaron Ecay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]