From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wEo6JBJmJWCaLwAA0tVLHw (envelope-from ) for ; Thu, 11 Feb 2021 17:14:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KJS/HxJmJWAaGgAA1q6Kng (envelope-from ) for ; Thu, 11 Feb 2021 17:14:58 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0F11B940355 for ; Thu, 11 Feb 2021 17:14:57 +0000 (UTC) Received: from localhost ([::1]:51946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAFYO-0000lV-LU for larch@yhetil.org; Thu, 11 Feb 2021 12:14:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9FLw-0007rv-3r for emacs-orgmode@gnu.org; Mon, 08 Feb 2021 17:49:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33068) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9FLv-0002Qb-5T for emacs-orgmode@gnu.org; Mon, 08 Feb 2021 17:49:55 -0500 Received: from [109.255.73.218] (port=45416 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l9FLt-0005Hl-Gq; Mon, 08 Feb 2021 17:49:54 -0500 From: Sameer Rahmani To: emacs-orgmode@gnu.org Subject: [PATCH] ox-html.el: Add HTML_CONTENT_CLASS to support css classes in content tag Date: Mon, 8 Feb 2021 22:46:51 +0000 Message-Id: <20210208224651.32680-1-lxsameer@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 11 Feb 2021 12:12:30 -0500 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sameer Rahmani Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 3.14 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 0F11B940355 X-Spam-Score: 3.14 X-Migadu-Scanner: scn1.migadu.com X-TUID: Hk44SRvc6JYC * ox-html.el (org-html-template): Added the support for a CSS class name to the content tag which wraps the entire content. The CSS class name can be set via in buffer HTML_CONTENT_CLASS property or :html-content-class for org publish. --- lisp/ox-html.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 11757bb35e8c..766897d0a032 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -113,6 +113,7 @@ :options-alist '((:html-doctype "HTML_DOCTYPE" nil org-html-doctype) (:html-container "HTML_CONTAINER" nil org-html-container-element) + (:html-content-class "HTML_CONTENT_CLASS" nil org-html-content-class) (:description "DESCRIPTION" nil nil newline) (:keywords "KEYWORDS" nil nil space) (:html-html5-fancy nil "html5-fancy" org-html-html5-fancy) @@ -1084,6 +1085,16 @@ org-info.js for your website." :package-version '(Org . "8.0") :type 'string) +(defcustom org-html-content-class "content" + "CSS class name to use for the top level content wrapper. +Can be set with the in-buffer HTML_CONTENT_CLASS property or for +publishing, with :html-content-class." + :group 'org-export-html + :version "27.1" + :package-version '(Org . "9.3.8") + :type 'string) + + (defcustom org-html-divs '((preamble "div" "preamble") (content "div" "content") @@ -2120,7 +2131,10 @@ holding export options." (org-html--build-pre/postamble 'preamble info) ;; Document contents. (let ((div (assq 'content (plist-get info :html-divs)))) - (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div))) + (format "<%s id=\"%s\" class=\"%s\">\n" + (nth 1 div) + (nth 2 div) + (plist-get info :html-content-class))) ;; Document title. (when (plist-get info :with-title) (let ((title (and (plist-get info :with-title) -- 2.26.2