emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export to s9y blog
@ 2017-09-03 18:34 Christian Garbs
  2017-09-03 18:44 ` Josiah Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Garbs @ 2017-09-03 18:34 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I want to write an org export plugin for the serendipity blog system[1].
Basically I need the HTML export with some changes:

- I only need the content of the <body> tag and nothing else.  I just
  found the BODY-ONLY argument, so I think I'm good :-)

- I don't want any CSS classes and selectors in the output.  I have
  not found any option for that yet.  In the worst case, I'll have to
  remove all ~class=~ strings from the lisp source.

- As I already use GeSHi[2] in my blog, I want any code blocks to be
  exported like this:

  [geshi lang=perl]
  print "Hello World\n";
  [/geshi]

  GeSHi will then convert that to HTML as needed.  I think I should be
  able to change the ~org-html-code~ for that.

I think I will get this done somehow.
My main question this is:

How can I do this in a way to not deviate too far from the original
~ox-html.el~?  I want to be able to easily import changes to
~ox-html.el~ into my source code.

1. I could just copy ~ox-html.el~ to ~ox-s9y.el~ and change it as
   needed.  But then I would have to manually check and perhaps apply
   any changes to ~ox-html.el~ to my ~ox-s9y.el~.

2. I could probably write a minimal ~ox-s9y.el~ that only handles my
   needs (eg. everything related to MathML or JavaScript can be
   deleted).  I would then change functions as needed and replace all
   /unchanged/ functions with calls the the corresponding in
   ~ox-html.el~ (method delegates).

   Eg. ~org-s9y-code~ would be a rewrite to produce the ~[geshi]~ code
   block and ~org-s9y-clock~ would just contain a call to the original
   ~org-html-clock~ function.

3. Is there a way to use something like inheritance to import all
   ~ox-html.el~ functions at once and then simply overwrite what I
   need to change?

What is the way to go?

Are there any other export plugins that are closely related where I
could have a look at an existing solution?

Thanks
Christian

[1] https://docs.s9y.org/
[2] http://qbnz.com/highlighter/
-- 
....Christian.Garbs....................................https://www.cgarbs.de

Oh Lord, won't you buy me a 4BSD?
My friends all got sources, so why can't I see?
Come all you moby hackers, come sing it out with me:
To hell with the lawyers from AT&T!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: export to s9y blog
  2017-09-03 18:34 export to s9y blog Christian Garbs
@ 2017-09-03 18:44 ` Josiah Schwab
  2017-09-03 19:01   ` Christian Garbs
  0 siblings, 1 reply; 3+ messages in thread
From: Josiah Schwab @ 2017-09-03 18:44 UTC (permalink / raw)
  To: Christian Garbs; +Cc: emacs-orgmode

Hi Christian,

> 3. Is there a way to use something like inheritance to import all
>    ~ox-html.el~ functions at once and then simply overwrite what I
>    need to change?

I would encourage you to take a look at the org-export docs, with
particular attention to the idea of a derived backend.

  http://orgmode.org/worg/dev/org-export-reference.html

Hope that helps,
Josiah

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: export to s9y blog
  2017-09-03 18:44 ` Josiah Schwab
@ 2017-09-03 19:01   ` Christian Garbs
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Garbs @ 2017-09-03 19:01 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

Am 03.09.2017 um 20:44 schrieb Josiah Schwab:

>> 3. Is there a way to use something like inheritance to import all
>>     ~ox-html.el~ functions at once and then simply overwrite what I
>>     need to change?
> 
> I would encourage you to take a look at the org-export docs, with
> particular attention to the idea of a derived backend.
> 
>    http://orgmode.org/worg/dev/org-export-reference.html

That looks great, thanks for the pointer!

Regards
Christian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-03 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-03 18:34 export to s9y blog Christian Garbs
2017-09-03 18:44 ` Josiah Schwab
2017-09-03 19:01   ` Christian Garbs

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).