public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Creating a partial HTML document
@ 2023-05-14 17:36 H
       [not found] ` <fefb43b9-ce9d-e2d9-9807-caaae90ebb14-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-14 17:36 UTC (permalink / raw)
  To: Pandoc Mailing List

I have a recurring need where I write markdown documents using my favorite editor, Geany, and then need to convert them to partial HTML documents. Partial because they lack the HTML file preamble and instead just start with <div> and end with the matching </div>.

Each document contains one or more "sections", each also beginning with a <div> and ending with the matching </div>, and the conversion process should be handle the sections, regardless of number.

I like the resulting (partial) HTML document to use my preferred indentation/white-space structure.

Would pandoc be a good, perhaps the "best", tool for this? I should also add that I would like to run the conversion "process" from within Geany.

-- 
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/fefb43b9-ce9d-e2d9-9807-caaae90ebb14%40meddatainc.com.


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

* Re: Creating a partial HTML document
       [not found] ` <fefb43b9-ce9d-e2d9-9807-caaae90ebb14-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-14 20:04   ` ThomasH
       [not found]     ` <59aee5dc-9dbb-4c70-8f33-4c0722546638n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: ThomasH @ 2023-05-14 20:04 UTC (permalink / raw)
  To: pandoc-discuss


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

Creating document fragments is the default for HTML in Pandoc, you'd have 
to use the `--standalone` option to force it to create complete documents 
with header and footer. So that should meet your requirements.

I don't know about indentation of the resulting HTML, much less so about 
your preferred indentation. But this is easy to find out and might be 
helped by post-processing if it doesn't meet your expectations?

I also cannot comment on Geany, but most editors have a way of running an 
external command on the current buffer or selected text.

On Sunday, May 14, 2023 at 7:36:15 PM UTC+2 H wrote:

I have a recurring need where I write markdown documents using my favorite 
editor, Geany, and then need to convert them to partial HTML documents. 
Partial because they lack the HTML file preamble and instead just start 
with <div> and end with the matching </div>. 

Each document contains one or more "sections", each also beginning with a 
<div> and ending with the matching </div>, and the conversion process 
should be handle the sections, regardless of number. 

I like the resulting (partial) HTML document to use my preferred 
indentation/white-space structure. 

Would pandoc be a good, perhaps the "best", tool for this? I should also 
add that I would like to run the conversion "process" from within Geany. 

-- 
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/59aee5dc-9dbb-4c70-8f33-4c0722546638n%40googlegroups.com.

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

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

* Re: Creating a partial HTML document
       [not found]     ` <59aee5dc-9dbb-4c70-8f33-4c0722546638n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-05-15  1:18       ` H
       [not found]         ` <E19E3123-6FDC-4BD7-92CC-6BF1216B1E63-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-15  1:18 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On May 14, 2023 4:04:35 PM EDT, ThomasH <therch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>Creating document fragments is the default for HTML in Pandoc, you'd
>have 
>to use the `--standalone` option to force it to create complete
>documents 
>with header and footer. So that should meet your requirements.
>
>I don't know about indentation of the resulting HTML, much less so
>about 
>your preferred indentation. But this is easy to find out and might be 
>helped by post-processing if it doesn't meet your expectations?
>
>I also cannot comment on Geany, but most editors have a way of running
>an 
>external command on the current buffer or selected text.
>
>On Sunday, May 14, 2023 at 7:36:15 PM UTC+2 H wrote:
>
>I have a recurring need where I write markdown documents using my
>favorite 
>editor, Geany, and then need to convert them to partial HTML documents.
>
>Partial because they lack the HTML file preamble and instead just start
>
>with <div> and end with the matching </div>. 
>
>Each document contains one or more "sections", each also beginning with
>a 
><div> and ending with the matching </div>, and the conversion process 
>should be handle the sections, regardless of number. 
>
>I like the resulting (partial) HTML document to use my preferred 
>indentation/white-space structure. 
>
>Would pandoc be a good, perhaps the "best", tool for this? I should
>also 
>add that I would like to run the conversion "process" from within
>Geany. 

That sounds very promising. My markdown files use H1-4 for structuring and then text in paragraphs with strong or emphasis added as needed. I want to use this information when adding the HTML tags, together with style information for each tag that is predefined.

I hope that Pandoc when encountering eg H2 in the markdown document would add the HTML tag and the predefined style information and the indent as I want it. No empty lines in the entire document but clear readable output.

Would you have a specific suggestion where in the Pandoc documentation I start reading?

-- 
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/E19E3123-6FDC-4BD7-92CC-6BF1216B1E63%40meddatainc.com.


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

* Re: Creating a partial HTML document
       [not found]         ` <E19E3123-6FDC-4BD7-92CC-6BF1216B1E63-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-15  6:54           ` ThomasH
       [not found]             ` <256c5b57-18a8-4e45-94ee-0c1e2244f35en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: ThomasH @ 2023-05-15  6:54 UTC (permalink / raw)
  To: pandoc-discuss


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

I suggest starting with the Getting Started document 
(https://pandoc.org/getting-started.html). As you still seem to be 
evaluating Pandoc as a tool, you might want to try it by running one of 
your typical markdown files through Pandoc (with `pandoc --from markdown 
--to html <filename>`) and look at the output. If that still looks 
promising, a good place for further study is the Pandoc User Guide 
(https://pandoc.org/MANUAL.html).

On Monday, May 15, 2023 at 3:18:49 AM UTC+2 H wrote:

> On May 14, 2023 4:04:35 PM EDT, ThomasH <the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >Creating document fragments is the default for HTML in Pandoc, you'd
> >have 
> >to use the `--standalone` option to force it to create complete
> >documents 
> >with header and footer. So that should meet your requirements.
> >
> >I don't know about indentation of the resulting HTML, much less so
> >about 
> >your preferred indentation. But this is easy to find out and might be 
> >helped by post-processing if it doesn't meet your expectations?
> >
> >I also cannot comment on Geany, but most editors have a way of running
> >an 
> >external command on the current buffer or selected text.
> >
> >On Sunday, May 14, 2023 at 7:36:15 PM UTC+2 H wrote:
> >
> >I have a recurring need where I write markdown documents using my
> >favorite 
> >editor, Geany, and then need to convert them to partial HTML documents.
> >
> >Partial because they lack the HTML file preamble and instead just start
> >
> >with <div> and end with the matching </div>. 
> >
> >Each document contains one or more "sections", each also beginning with
> >a 
> ><div> and ending with the matching </div>, and the conversion process 
> >should be handle the sections, regardless of number. 
> >
> >I like the resulting (partial) HTML document to use my preferred 
> >indentation/white-space structure. 
> >
> >Would pandoc be a good, perhaps the "best", tool for this? I should
> >also 
> >add that I would like to run the conversion "process" from within
> >Geany. 
>
> That sounds very promising. My markdown files use H1-4 for structuring and 
> then text in paragraphs with strong or emphasis added as needed. I want to 
> use this information when adding the HTML tags, together with style 
> information for each tag that is predefined.
>
> I hope that Pandoc when encountering eg H2 in the markdown document would 
> add the HTML tag and the predefined style information and the indent as I 
> want it. No empty lines in the entire document but clear readable output.
>
> Would you have a specific suggestion where in the Pandoc documentation I 
> start reading?
>

-- 
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/256c5b57-18a8-4e45-94ee-0c1e2244f35en%40googlegroups.com.

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

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

* Re: Creating a partial HTML document
       [not found]             ` <256c5b57-18a8-4e45-94ee-0c1e2244f35en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-05-15 20:52               ` H
       [not found]                 ` <d8c58326-c9a4-9a5b-973c-dea044654bda-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-15 20:52 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

On 05/15/2023 02:54 AM, ThomasH wrote:
> I suggest starting with the Getting Started document (https://pandoc.org/getting-started.html). As you still seem to be evaluating Pandoc as a tool, you might want to try it by running one of your typical markdown files through Pandoc (with `pandoc --from markdown --to html <filename>`) and look at the output. If that still looks promising, a good place for further study is the Pandoc User Guide (https://pandoc.org/MANUAL.html).
>
> On Monday, May 15, 2023 at 3:18:49 AM UTC+2 H wrote:
>
>     On May 14, 2023 4:04:35 PM EDT, ThomasH <the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>     >Creating document fragments is the default for HTML in Pandoc, you'd
>     >have
>     >to use the `--standalone` option to force it to create complete
>     >documents
>     >with header and footer. So that should meet your requirements.
>     >
>     >I don't know about indentation of the resulting HTML, much less so
>     >about
>     >your preferred indentation. But this is easy to find out and might be
>     >helped by post-processing if it doesn't meet your expectations?
>     >
>     >I also cannot comment on Geany, but most editors have a way of running
>     >an
>     >external command on the current buffer or selected text.
>     >
>     >On Sunday, May 14, 2023 at 7:36:15 PM UTC+2 H wrote:
>     >
>     >I have a recurring need where I write markdown documents using my
>     >favorite
>     >editor, Geany, and then need to convert them to partial HTML documents.
>     >
>     >Partial because they lack the HTML file preamble and instead just start
>     >
>     >with <div> and end with the matching </div>.
>     >
>     >Each document contains one or more "sections", each also beginning with
>     >a
>     ><div> and ending with the matching </div>, and the conversion process
>     >should be handle the sections, regardless of number.
>     >
>     >I like the resulting (partial) HTML document to use my preferred
>     >indentation/white-space structure.
>     >
>     >Would pandoc be a good, perhaps the "best", tool for this? I should
>     >also
>     >add that I would like to run the conversion "process" from within
>     >Geany.
>
>     That sounds very promising. My markdown files use H1-4 for structuring and then text in paragraphs with strong or emphasis added as needed. I want to use this information when adding the HTML tags, together with style information for each tag that is predefined.
>
>     I hope that Pandoc when encountering eg H2 in the markdown document would add the HTML tag and the predefined style information and the indent as I want it. No empty lines in the entire document but clear readable output.
>
>     Would you have a specific suggestion where in the Pandoc documentation I start reading?
>
> -- 
> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/256c5b57-18a8-4e45-94ee-0c1e2244f35en%40googlegroups.com <https://groups.google.com/d/msgid/pandoc-discuss/256c5b57-18a8-4e45-94ee-0c1e2244f35en%40googlegroups.com?utm_medium=email&utm_source=footer>.

Thank you, I will begin as you suggest.

-- 
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/d8c58326-c9a4-9a5b-973c-dea044654bda%40meddatainc.com.

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

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

* Re: Creating a partial HTML document
       [not found]                 ` <d8c58326-c9a4-9a5b-973c-dea044654bda-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-16 20:39                   ` H
       [not found]                     ` <2ea6ffbc-e589-627c-4efe-b8e820cfd797-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-16 20:39 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

On 05/15/2023 04:52 PM, H wrote:
> On 05/15/2023 02:54 AM, ThomasH wrote:
>> I suggest starting with the Getting Started document (https://pandoc.org/getting-started.html). As you still seem to be evaluating Pandoc as a tool, you might want to try it by running one of your typical markdown files through Pandoc (with `pandoc --from markdown --to html <filename>`) and look at the output. If that still looks promising, a good place for further study is the Pandoc User Guide (https://pandoc.org/MANUAL.html).
>>
>> On Monday, May 15, 2023 at 3:18:49 AM UTC+2 H wrote:
>>
>>     On May 14, 2023 4:04:35 PM EDT, ThomasH <the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>     >Creating document fragments is the default for HTML in Pandoc, you'd
>>     >have
>>     >to use the `--standalone` option to force it to create complete
>>     >documents
>>     >with header and footer. So that should meet your requirements.
>>     >
>>     >I don't know about indentation of the resulting HTML, much less so
>>     >about
>>     >your preferred indentation. But this is easy to find out and might be
>>     >helped by post-processing if it doesn't meet your expectations?
>>     >
>>     >I also cannot comment on Geany, but most editors have a way of running
>>     >an
>>     >external command on the current buffer or selected text.
>>     >
>>     >On Sunday, May 14, 2023 at 7:36:15 PM UTC+2 H wrote:
>>     >
>>     >I have a recurring need where I write markdown documents using my
>>     >favorite
>>     >editor, Geany, and then need to convert them to partial HTML documents.
>>     >
>>     >Partial because they lack the HTML file preamble and instead just start
>>     >
>>     >with <div> and end with the matching </div>.
>>     >
>>     >Each document contains one or more "sections", each also beginning with
>>     >a
>>     ><div> and ending with the matching </div>, and the conversion process
>>     >should be handle the sections, regardless of number.
>>     >
>>     >I like the resulting (partial) HTML document to use my preferred
>>     >indentation/white-space structure.
>>     >
>>     >Would pandoc be a good, perhaps the "best", tool for this? I should
>>     >also
>>     >add that I would like to run the conversion "process" from within
>>     >Geany.
>>
>>     That sounds very promising. My markdown files use H1-4 for structuring and then text in paragraphs with strong or emphasis added as needed. I want to use this information when adding the HTML tags, together with style information for each tag that is predefined.
>>
>>     I hope that Pandoc when encountering eg H2 in the markdown document would add the HTML tag and the predefined style information and the indent as I want it. No empty lines in the entire document but clear readable output.
>>
>>     Would you have a specific suggestion where in the Pandoc documentation I start reading?
>>
>> -- 
>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/256c5b57-18a8-4e45-94ee-0c1e2244f35en%40googlegroups.com <https://groups.google.com/d/msgid/pandoc-discuss/256c5b57-18a8-4e45-94ee-0c1e2244f35en%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> Thank you, I will begin as you suggest.
>
I did a test run and realize the following needs to be fixed to work for my use:

Output:

- pandoc inserts an id for each header that I have no need for and need to get rid of.

- The output is wrapped at around 72 characters which I also do not want.

- I need to have <div></div> tags added to meet the needed output format.

- I need to have a style added to each HTML tag. These do not vary and could be predefined by me.

- The output needs to be indented one level for each <div> level.

Can I modify the pandoc processor to accomplish the above?

Input:

On another note, I would much prefer if I would not need to add an empty line between paragraphs in the markdown document to get the output processor to add <p></p> tags appropriately. A line break should suffice for pandoc to realize it's a new paragraph.

Is this fixable by me?

Thanks.

-- 
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/2ea6ffbc-e589-627c-4efe-b8e820cfd797%40meddatainc.com.

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

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

* Re: Creating a partial HTML document
       [not found]                     ` <2ea6ffbc-e589-627c-4efe-b8e820cfd797-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-17  1:07                       ` H
       [not found]                         ` <6d105e0d-0e11-38fb-4978-9748102c93af-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-17  1:07 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 05/16/2023 04:39 PM, H wrote:
> I did a test run and realize the following needs to be fixed to work for my use:
>
> Output:
>
> - pandoc inserts an id for each header that I have no need for and need to get rid of.
>
> - The output is wrapped at around 72 characters which I also do not want.
>
> - I need to have <div></div> tags added to meet the needed output format.
>
> - I need to have a style added to each HTML tag. These do not vary and could be predefined by me.
>
> - The output needs to be indented one level for each <div> level.
>
> Can I modify the pandoc processor to accomplish the above?
>
> Input:
>
> On another note, I would much prefer if I would not need to add an empty line between paragraphs in the markdown document to get the output processor to add <p></p> tags appropriately. A line break should suffice for pandoc to realize it's a new paragraph.
>
> Is this fixable by me?
>
> Thanks.
>
I found a solution to three of the items above:

- f markdown-auto_identifiers got rid of the identifiers although they were replaced by "class" instead.

- adding --section-divs added <section> although I would have preferred the older <div>

- adding --wrap=none allowed the output text in the HTML fragment to flow freely rather than break at 72 characters. The  latter made it harder for me to read the file.

Hoping that there are solutions to the rest of the items above but that might not be possible.

Oh, one more thing, my output is a HTML fragment and I was looking for an option to convert non-ASCII characters to the corresponding HTML entities. I understand that pandoc input is UTF8, as is the output, but an option to instead do the above conversion of the output would be very useful.

-- 
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/6d105e0d-0e11-38fb-4978-9748102c93af%40meddatainc.com.


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

* Re: Creating a partial HTML document
       [not found]                         ` <6d105e0d-0e11-38fb-4978-9748102c93af-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-17  5:14                           ` ThomasH
       [not found]                             ` <39c3adec-4363-43be-ac1f-76e96aeead65n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2023-05-17 18:45                           ` John MacFarlane
  1 sibling, 1 reply; 15+ messages in thread
From: ThomasH @ 2023-05-17  5:14 UTC (permalink / raw)
  To: pandoc-discuss


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



On Wednesday, May 17, 2023 at 3:07:25 AM UTC+2 H wrote:

On 05/16/2023 04:39 PM, H wrote: 
> - I need to have a style added to each HTML tag. These do not vary and 
could be predefined by me. 


This should be possible using a Pandoc Lua filter, assigning 
`element.attributes['style'] = '<your style>'` to each element. But I 
wouldn't know if there is a way around writing a filter function for each 
and every relevant element type (para, header, span, ...), though they 
would mostly be copy-paste.

-- 
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/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com.

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

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

* Re: Creating a partial HTML document
       [not found]                             ` <39c3adec-4363-43be-ac1f-76e96aeead65n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2023-05-17  7:40                               ` Bastien DUMONT
  2023-05-17 23:35                                 ` H
  2023-05-17 23:40                               ` H
  1 sibling, 1 reply; 15+ messages in thread
From: Bastien DUMONT @ 2023-05-17  7:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You can use the Inline and the Block functions for that.

Le Tuesday 16 May 2023 à 10:14:43PM, ThomasH a écrit :
> 
> 
> On Wednesday, May 17, 2023 at 3:07:25 AM UTC+2 H wrote:
> 
>     On 05/16/2023 04:39 PM, H wrote:
>     > - I need to have a style added to each HTML tag. These do not vary and
>     could be predefined by me.
> 
> 
> This should be possible using a Pandoc Lua filter, assigning
> `element.attributes['style'] = '<your style>'` to each element. But I wouldn't
> know if there is a way around writing a filter function for each and every
> relevant element type (para, header, span, ...), though they would mostly be
> copy-paste.
> 
> --
> 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com.
> 
> References:
> 
> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
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/ZGSE14lkz0ijyF_F%40localhost.


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

* Re: Creating a partial HTML document
       [not found]                         ` <6d105e0d-0e11-38fb-4978-9748102c93af-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  2023-05-17  5:14                           ` ThomasH
@ 2023-05-17 18:45                           ` John MacFarlane
       [not found]                             ` <1C388813-0134-4592-BABD-0B0EA3D90CE4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 15+ messages in thread
From: John MacFarlane @ 2023-05-17 18:45 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

> 
> Oh, one more thing, my output is a HTML fragment and I was looking for an option to convert non-ASCII characters to the corresponding HTML entities. I understand that pandoc input is UTF8, as is the output, but an option to instead do the above conversion of the output would be very useful.
> 

—ascii


-- 
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/1C388813-0134-4592-BABD-0B0EA3D90CE4%40gmail.com.


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

* Re: Creating a partial HTML document
       [not found]                             ` <1C388813-0134-4592-BABD-0B0EA3D90CE4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2023-05-17 23:29                               ` H
       [not found]                                 ` <d4d83813-44aa-83bc-94d0-6d30f3d66ef9-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-17 23:29 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 05/17/2023 02:45 PM, John MacFarlane wrote:
>> Oh, one more thing, my output is a HTML fragment and I was looking for an option to convert non-ASCII characters to the corresponding HTML entities. I understand that pandoc input is UTF8, as is the output, but an option to instead do the above conversion of the output would be very useful.
>>
> —ascii
>
>
Thank you, I looked at that option but it translates non-ASCII characters into Unicode hex characters which does work but I find HTML entities much more readable. Hope this will be added as an option.

-- 
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/d4d83813-44aa-83bc-94d0-6d30f3d66ef9%40meddatainc.com.


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

* Re: Creating a partial HTML document
  2023-05-17  7:40                               ` Bastien DUMONT
@ 2023-05-17 23:35                                 ` H
       [not found]                                   ` <6fc811c0-27dd-29e8-936c-59e5262dff7e-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: H @ 2023-05-17 23:35 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 05/17/2023 03:40 AM, Bastien DUMONT wrote:
> You can use the Inline and the Block functions for that.
>
> Le Tuesday 16 May 2023 à 10:14:43PM, ThomasH a écrit :
>>
>> On Wednesday, May 17, 2023 at 3:07:25 AM UTC+2 H wrote:
>>
>>     On 05/16/2023 04:39 PM, H wrote:
>>     > - I need to have a style added to each HTML tag. These do not vary and
>>     could be predefined by me.
>>
>>
>> This should be possible using a Pandoc Lua filter, assigning
>> `element.attributes['style'] = '<your style>'` to each element. But I wouldn't
>> know if there is a way around writing a filter function for each and every
>> relevant element type (para, header, span, ...), though they would mostly be
>> copy-paste.
>>
>> --
>> 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
>> pandoc-discuss/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com.
>>
>> References:
>>
>> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>> [2] https://groups.google.com/d/msgid/pandoc-discuss/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com?utm_medium=email&utm_source=footer

I did find that in the manual but this would require too much change to the source documents I create and use.

I wonder if I can modify the existing HTML writer to meet my specific needs, rename it to something and have it become part of my pandoc installation?

Doable?

-- 
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/6fc811c0-27dd-29e8-936c-59e5262dff7e%40meddatainc.com.


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

* Re: Creating a partial HTML document
       [not found]                             ` <39c3adec-4363-43be-ac1f-76e96aeead65n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2023-05-17  7:40                               ` Bastien DUMONT
@ 2023-05-17 23:40                               ` H
  1 sibling, 0 replies; 15+ messages in thread
From: H @ 2023-05-17 23:40 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

On 05/17/2023 01:14 AM, ThomasH wrote:
>
>
> On Wednesday, May 17, 2023 at 3:07:25 AM UTC+2 H wrote:
>
>     On 05/16/2023 04:39 PM, H wrote:
>     > - I need to have a style added to each HTML tag. These do not vary and could be predefined by me.
>
>
> This should be possible using a Pandoc Lua filter, assigning `element.attributes['style'] = '<your style>'` to each element. But I wouldn't know if there is a way around writing a filter function for each and every relevant element type (para, header, span, ...), though they would mostly be copy-paste.
> -- 
> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com <https://groups.google.com/d/msgid/pandoc-discuss/39c3adec-4363-43be-ac1f-76e96aeead65n%40googlegroups.com?utm_medium=email&utm_source=footer>.

My markdown documents for this use are rather simple with a very limited number of tags used. I will look into pandoc filters, as well as creating a new HTML writer based on the existing one since my needs are very specific for this application.

-- 
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/bfbf5842-5840-d628-d271-d912dc518157%40meddatainc.com.

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

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

* Re: Creating a partial HTML document
       [not found]                                   ` <6fc811c0-27dd-29e8-936c-59e5262dff7e-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-19  6:57                                     ` ThomasH
  0 siblings, 0 replies; 15+ messages in thread
From: ThomasH @ 2023-05-19  6:57 UTC (permalink / raw)
  To: pandoc-discuss


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



On Thursday, May 18, 2023 at 1:35:53 AM UTC+2 H wrote:

On 05/17/2023 03:40 AM, Bastien DUMONT wrote: 
> You can use the Inline and the Block functions for that. 
I did find that in the manual but this would require too much change to the 
source documents I create and use. 


I think what Bastien meant was: Besides type-specific filter functions 
there are also generic filter functions you might be able to define, Inline 
<https://pandoc.org/lua-filters.html#type-inline>and Block.

-- 
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/ff73ed34-994b-47a4-972c-238b96369f0en%40googlegroups.com.

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

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

* Re: Creating a partial HTML document
       [not found]                                 ` <d4d83813-44aa-83bc-94d0-6d30f3d66ef9-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
@ 2023-05-29  9:43                                   ` BPJ
  0 siblings, 0 replies; 15+ messages in thread
From: BPJ @ 2023-05-29  9:43 UTC (permalink / raw)
  To: pandoc-discuss

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

Den tors 18 maj 2023 01:30H <agents-FcZObrvlYduBUy7/sJONFg@public.gmane.org> skrev:

> On 05/17/2023 02:45 PM, John MacFarlane wrote:
> >> Oh, one more thing, my output is a HTML fragment and I was looking for
> an option to convert non-ASCII characters to the corresponding HTML
> entities. I understand that pandoc input is UTF8, as is the output, but an
> option to instead do the above conversion of the output would be very
> useful.
> >>
> > —ascii
> >
> >
> Thank you, I looked at that option but it translates non-ASCII characters
> into Unicode hex characters which does work but I find HTML entities much
> more readable. Hope this will be added as an option.
>

You can post-process with HTML Tidy to control this and other aspects of
the appearance of HTML documents.

https://www.html-tidy.org/


> --
> 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/d4d83813-44aa-83bc-94d0-6d30f3d66ef9%40meddatainc.com
> .
>

-- 
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/CADAJKhCLMPoh9ARPUKwegRM1cRZHYD2VFO2bdAXBHZ%2B2atRE4A%40mail.gmail.com.

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

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

end of thread, other threads:[~2023-05-29  9:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-14 17:36 Creating a partial HTML document H
     [not found] ` <fefb43b9-ce9d-e2d9-9807-caaae90ebb14-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-14 20:04   ` ThomasH
     [not found]     ` <59aee5dc-9dbb-4c70-8f33-4c0722546638n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-05-15  1:18       ` H
     [not found]         ` <E19E3123-6FDC-4BD7-92CC-6BF1216B1E63-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-15  6:54           ` ThomasH
     [not found]             ` <256c5b57-18a8-4e45-94ee-0c1e2244f35en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-05-15 20:52               ` H
     [not found]                 ` <d8c58326-c9a4-9a5b-973c-dea044654bda-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-16 20:39                   ` H
     [not found]                     ` <2ea6ffbc-e589-627c-4efe-b8e820cfd797-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-17  1:07                       ` H
     [not found]                         ` <6d105e0d-0e11-38fb-4978-9748102c93af-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-17  5:14                           ` ThomasH
     [not found]                             ` <39c3adec-4363-43be-ac1f-76e96aeead65n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-05-17  7:40                               ` Bastien DUMONT
2023-05-17 23:35                                 ` H
     [not found]                                   ` <6fc811c0-27dd-29e8-936c-59e5262dff7e-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-19  6:57                                     ` ThomasH
2023-05-17 23:40                               ` H
2023-05-17 18:45                           ` John MacFarlane
     [not found]                             ` <1C388813-0134-4592-BABD-0B0EA3D90CE4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-05-17 23:29                               ` H
     [not found]                                 ` <d4d83813-44aa-83bc-94d0-6d30f3d66ef9-FcZObrvlYduBUy7/sJONFg@public.gmane.org>
2023-05-29  9:43                                   ` BPJ

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