Modifying page content from an extension

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Modifying page content from an extension

Gerhard Poul
Hi,

if I want to write an extension that actually modifies the page
content what would be the best way to go? - I can modify the input
content, but I'm not sure how to determine the type of input content
(e.g. how can I distinguish between a .md or .org file for example?)
From the file extension of the input file sounds a little brittle to
me.

Is there maybe a way to plug into the html-output stream before it is
written to disk?

Gerhard

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Modifying page content from an extension

LightGuard
Administrator
Yep, probably the safest thing to change is the raw_content. You can check the extension, that's honestly the best route to go.


On Mon, Apr 21, 2014 at 12:59 PM, Gerhard Poul <[hidden email]> wrote:
Hi,

if I want to write an extension that actually modifies the page
content what would be the best way to go? - I can modify the input
content, but I'm not sure how to determine the type of input content
(e.g. how can I distinguish between a .md or .org file for example?)
From the file extension of the input file sounds a little brittle to
me.

Is there maybe a way to plug into the html-output stream before it is
written to disk?

Gerhard

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]




--
Reply | Threaded
Open this post in threaded view
|

Re: Modifying page content from an extension

Gerhard Poul
On Mon, Apr 21, 2014 at 11:16 PM, Jason Porter <[hidden email]> wrote:
> Yep, probably the safest thing to change is the raw_content. You can check
> the extension, that's honestly the best route to go.

OK; I've now based this on the extension and modifying the raw_content
as I can safely modify the markdown input for what I want to do.

If anyone is wondering btw; I'm so annoyed by emoticons being wrapped
by browsers (i.e. being displayed as ":-\n)") that I wrote a wordpress
patch for this a few years ago which was finally rejected a few months
ago -> https://core.trac.wordpress.org/ticket/5689

After I migrated to awestruct in June last year I've really missed
that change and now I have this ingenious solution also for my
awestruct blog. Should the second person who feels strongly about this
ever find this post I've attached my extension.

Gerhard

---------------------------------------------------------------------
Archives: http://talk-archive.awestruct.org/
To unsubscribe, e-mail: [hidden email]

textemoticons.rb (1K) Download Attachment