emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Kaushal Modi <kaushal.modi@gmail.com>,
	emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: RFC: Proposal for an Org Special Block for ox-html
Date: Fri, 25 May 2018 15:19:54 +0100	[thread overview]
Message-ID: <87d0xj7r79.fsf@gmail.com> (raw)
In-Reply-To: <CAFyQvY2uSiK94WAOU7aBsf=iXOFdgjU_SdouFwYJma_updfJTw@mail.gmail.com>

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://kaushalmodi@github.com/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	other threads:[~2018-05-25 14:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 13:40 RFC: Proposal for an Org Special Block for ox-html Kaushal Modi
2018-05-24 17:41 ` Aaron Ecay
2018-05-24 18:08   ` Kaushal Modi
2018-05-24 18:28     ` Kaushal Modi
2018-05-24 18:36     ` Aaron Ecay
2018-05-24 18:47       ` Kaushal Modi
2018-05-24 19:08         ` Aaron Ecay
2018-05-24 19:25           ` Kaushal Modi
2018-05-25 14:19             ` Aaron Ecay [this message]
2018-05-25 15:09               ` Kaushal Modi
2018-05-25 16:38                 ` Kaushal Modi
2018-05-27 16:21                 ` Aaron Ecay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0xj7r79.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).