* publish regression: body-only (with patch)
@ 2009-05-24 16:50 Richard KLINDA
2009-05-24 21:59 ` Carsten Dominik
2009-05-25 14:02 ` Carsten Dominik
0 siblings, 2 replies; 5+ messages in thread
From: Richard KLINDA @ 2009-05-24 16:50 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
Hello, somehow the publish with body-only feature disappeared, or I just
can't find a way to use it.
Here is my usecase:
,----
| (setq org-publish-project-alist
| (list
| '("foo" . (:base-directory "..."
| :base-extension any
| :publishing-directory "/tmp/"
| :with-section-numbers nil
| :body-only t <<<<<
| :table-of-contents nil
| ))))
`----
Only the bodies of the HTML files should be written to disk. Carsten,
please consider adding this, thank you, Richard.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: body-only.patch --]
[-- Type: text/x-diff, Size: 522 bytes --]
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 16cf937..9224d6f 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -498,7 +498,8 @@ PUB-DIR is set, use this as the publishing directory."
(org-combine-plists (org-default-export-plist)
ext-plist
(org-infile-export-plist))))
+ (body-only (or body-only (plist-get opt-plist :body-only)))
(style (concat (if (plist-get opt-plist :style-include-default)
org-export-html-style-default)
(plist-get opt-plist :style)
[-- Attachment #3: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: publish regression: body-only (with patch)
2009-05-24 16:50 publish regression: body-only (with patch) Richard KLINDA
@ 2009-05-24 21:59 ` Carsten Dominik
2009-05-24 22:12 ` Richard KLINDA
2009-05-25 14:02 ` Carsten Dominik
1 sibling, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2009-05-24 21:59 UTC (permalink / raw)
To: Richard KLINDA; +Cc: emacs-orgmode
Hi Richard,
this feature has never existed as something usable from publishing.
Can you provide a realistic case when something like this
would be useful?
- Carsten
On May 24, 2009, at 6:50 PM, Richard KLINDA wrote:
> Hello, somehow the publish with body-only feature disappeared, or I
> just
> can't find a way to use it.
>
> Here is my usecase:
>
> ,----
> | (setq org-publish-project-alist
> | (list
> | '("foo" . (:base-directory "..."
> | :base-extension any
> | :publishing-directory "/tmp/"
> | :with-section-numbers nil
> | :body-only t <<<<<
> | :table-of-contents nil
> | ))))
> `----
>
> Only the bodies of the HTML files should be written to disk. Carsten,
> please consider adding this, thank you, Richard.
>
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index 16cf937..9224d6f 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -498,7 +498,8 @@ PUB-DIR is set, use this as the publishing
> directory."
> (org-combine-plists (org-default-export-plist)
> ext-plist
> (org-infile-export-plist))))
> + (body-only (or body-only (plist-get opt-plist :body-only)))
> (style (concat (if (plist-get opt-plist :style-include-default)
> org-export-html-style-default)
> (plist-get opt-plist :style)
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: publish regression: body-only (with patch)
2009-05-24 21:59 ` Carsten Dominik
@ 2009-05-24 22:12 ` Richard KLINDA
2009-05-24 23:05 ` Eric Schulte
0 siblings, 1 reply; 5+ messages in thread
From: Richard KLINDA @ 2009-05-24 22:12 UTC (permalink / raw)
To: emacs-orgmode
>>>>> Regarding 'Re: [Orgmode] publish regression: body-only (with patch)'; Carsten Dominik adds:
> Hi Richard, this feature has never existed as something usable from
> publishing. Can you provide a realistic case when something like
> this would be useful?
Oh, then my patch did not make it into org back then.:) I am going to
use org just to render the "content" part of my site, the menus, comment
section, tag cloud, interlinking (by date, topic etc) will be generated
by a CMS.
As I think about it, it seems fairly trivial just to rip out the
<body>(...)</body> part of the generated HTML, so I'm ready to accept if
you don't want this into org.
--
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: publish regression: body-only (with patch)
2009-05-24 22:12 ` Richard KLINDA
@ 2009-05-24 23:05 ` Eric Schulte
0 siblings, 0 replies; 5+ messages in thread
From: Eric Schulte @ 2009-05-24 23:05 UTC (permalink / raw)
To: Richard KLINDA; +Cc: emacs-orgmode
Richard KLINDA <rklinda@gmail.com> writes:
>>>>>> Regarding 'Re: [Orgmode] publish regression: body-only (with patch)'; Carsten Dominik adds:
>
>
> > Hi Richard, this feature has never existed as something usable from
> > publishing. Can you provide a realistic case when something like
> > this would be useful?
>
> Oh, then my patch did not make it into org back then.:) I am going to
> use org just to render the "content" part of my site, the menus, comment
> section, tag cloud, interlinking (by date, topic etc) will be generated
> by a CMS.
>
> As I think about it, it seems fairly trivial just to rip out the
> <body>(...)</body> part of the generated HTML, so I'm ready to accept if
> you don't want this into org.
I also find the need to extract just the body portion of exported html
pages. This is done in blorgit[1], if you don't mind using ruby for
your extraction the following may prove useful (extracts body optionally
including the title and postamble).
#+begin_src ruby
def to_html(h_path, options = {})
html = File.read(h_path)
return html if options[:full_html]
# extract the body portion
start_body = (html =~ /<body>/) + 6
end_body = (html =~ /<\/body>/) - 1
body = html[(start_body..end_body)]
body = options[:postamble] ? body : body[(0..(body.index("<div id=\"postamble\">") - 1))]
options[:title] ? body : body.sub(/<h1.*\/h1>/i,'')
end
#+end_src
Cheers -- Eric
[1] http://orgmode.org/worg/blorgit.php
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: publish regression: body-only (with patch)
2009-05-24 16:50 publish regression: body-only (with patch) Richard KLINDA
2009-05-24 21:59 ` Carsten Dominik
@ 2009-05-25 14:02 ` Carsten Dominik
1 sibling, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2009-05-25 14:02 UTC (permalink / raw)
To: Richard KLINDA; +Cc: emacs-orgmode
Applied, thanks.
- Carsten
On May 24, 2009, at 6:50 PM, Richard KLINDA wrote:
> Hello, somehow the publish with body-only feature disappeared, or I
> just
> can't find a way to use it.
>
> Here is my usecase:
>
> ,----
> | (setq org-publish-project-alist
> | (list
> | '("foo" . (:base-directory "..."
> | :base-extension any
> | :publishing-directory "/tmp/"
> | :with-section-numbers nil
> | :body-only t <<<<<
> | :table-of-contents nil
> | ))))
> `----
>
> Only the bodies of the HTML files should be written to disk. Carsten,
> please consider adding this, thank you, Richard.
>
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index 16cf937..9224d6f 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -498,7 +498,8 @@ PUB-DIR is set, use this as the publishing
> directory."
> (org-combine-plists (org-default-export-plist)
> ext-plist
> (org-infile-export-plist))))
> + (body-only (or body-only (plist-get opt-plist :body-only)))
> (style (concat (if (plist-get opt-plist :style-include-default)
> org-export-html-style-default)
> (plist-get opt-plist :style)
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-25 14:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-24 16:50 publish regression: body-only (with patch) Richard KLINDA
2009-05-24 21:59 ` Carsten Dominik
2009-05-24 22:12 ` Richard KLINDA
2009-05-24 23:05 ` Eric Schulte
2009-05-25 14:02 ` Carsten Dominik
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).