public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Adding title, author and date information in non-standalone mode
@ 2020-11-01  2:36 Nandakumar Chandrasekhar
       [not found] ` <fd7e8817-5ae4-4b19-8eac-c8948fac8bb9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nandakumar Chandrasekhar @ 2020-11-01  2:36 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1007 bytes --]

Hi,

I would like to know if there is any way to add the title, author, and date 
information in the resulting HTML5 document when converting from Pandoc 
Markdown. I know that this is done in cases where standalone is specified 
but how would it be done if standalone was non specified.

I would like to avoid having to add the rendered HTML into the Markdown as 
a manual step as I would prefer Pandoc to handle all Markdown to HTML5 
conversion.

I am asking this question in relation to a plugin I am writing for the 
Pelican static site generator.

I look forward to your suggestions.
Nanda

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fd7e8817-5ae4-4b19-8eac-c8948fac8bb9n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1392 bytes --]

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

* Re: Adding title, author and date information in non-standalone mode
       [not found] ` <fd7e8817-5ae4-4b19-8eac-c8948fac8bb9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2020-11-01  7:36   ` Albert Krewinkel
       [not found]     ` <87ft5tle9i.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Krewinkel @ 2020-11-01  7:36 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Nandakumar Chandrasekhar writes:

> I would like to know if there is any way to add the title, author, and date 
> information in the resulting HTML5 document when converting from Pandoc 
> Markdown. I know that this is done in cases where standalone is specified 
> but how would it be done if standalone was non specified.

You could write your own template and pass it to pandoc with
`--template`. Example template:

    <h1>$title$</h1>
    $body$

This will produce the usual output with the title added above.

Alternatively, use a [JSON-based filter][filter] or [Lua filter].

[filter]: https://pandoc.org/filters.html
[Lua filter]: https://pandoc.org/lua-filters.html

Cheers,

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


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

* Re: Adding title, author and date information in non-standalone mode
       [not found]     ` <87ft5tle9i.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2020-11-01 10:38       ` Nandakumar Chandrasekhar
  0 siblings, 0 replies; 3+ messages in thread
From: Nandakumar Chandrasekhar @ 2020-11-01 10:38 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2077 bytes --]

Hi Albert,

Thank you.

I think the template option seems to be the most straightforward to me for
my use case.

However, filters might be of use to me as my plugin evolves to handle more
complex cases.

Cheers,
Nanda

On Sun, Nov 1, 2020 at 12:36 AM Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
wrote:

>
> Nandakumar Chandrasekhar writes:
>
> > I would like to know if there is any way to add the title, author, and
> date
> > information in the resulting HTML5 document when converting from Pandoc
> > Markdown. I know that this is done in cases where standalone is
> specified
> > but how would it be done if standalone was non specified.
>
> You could write your own template and pass it to pandoc with
> `--template`. Example template:
>
>     <h1>$title$</h1>
>     $body$
>
> This will produce the usual output with the title added above.
>
> Alternatively, use a [JSON-based filter][filter] or [Lua filter].
>
> [filter]: https://pandoc.org/filters.html
> [Lua filter]: https://pandoc.org/lua-filters.html
>
> Cheers,
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pandoc-discuss/xIIQhshQRJA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/87ft5tle9i.fsf%40zeitkraut.de
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMhuDe9mZZb73mm0-UwRT-BvfNX9WXNMjn7ooi30w5MoMhWwpA%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3398 bytes --]

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

end of thread, other threads:[~2020-11-01 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01  2:36 Adding title, author and date information in non-standalone mode Nandakumar Chandrasekhar
     [not found] ` <fd7e8817-5ae4-4b19-8eac-c8948fac8bb9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-11-01  7:36   ` Albert Krewinkel
     [not found]     ` <87ft5tle9i.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-11-01 10:38       ` Nandakumar Chandrasekhar

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 NNTP newsgroup(s).