public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Isn’t there a plain text reader? Why?
@ 2019-08-15 17:08 Rudi C
       [not found] ` <255f893b-1048-4de9-aaeb-e9778187e701-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Rudi C @ 2019-08-15 17:08 UTC (permalink / raw)
  To: pandoc-discuss

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

I want to read source code on my Kindle, and I was hoping to just use `pandoc -s -f txt *.py -o a.mobi` but it seems pandoc lacks a plain text reader?!

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

* Re: Isn’t there a plain text reader? Why?
       [not found] ` <255f893b-1048-4de9-aaeb-e9778187e701-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-08-15 17:29   ` Daniel Staal
       [not found]     ` <4be8dffb-2e8c-3ba3-d584-a06928a48af7-Jdbf3xiKgS8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Staal @ 2019-08-15 17:29 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 8/15/19 1:08 PM, Rudi C wrote:
> I want to read source code on my Kindle, and I was hoping to just use `pandoc -s -f txt *.py -o a.mobi` but it seems pandoc lacks a plain text reader?!
> 

Define plain text.  Do you just want it passed through with no changes? 
Do you want emphasis?  Do you want indents?  Do you want wrapping? 
Wrapping in some places but not others?

Pandoc reads several different formats that look like plain text.

In your case, I'd probably create a couple of files, each with just one 
line:

00000.py:
~~~{.python}

ZZZZZZ.py
~~~~

Then use `-f markdown` - that should enclose the whole thing inside a 
fenced code block and have it treat the interior as python code.

Daniel T. Staal

-- 
---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------


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

* Re: Isn’t there a plain text reader? Why?
       [not found]     ` <4be8dffb-2e8c-3ba3-d584-a06928a48af7-Jdbf3xiKgS8@public.gmane.org>
@ 2019-08-16  6:07       ` Rudi C
       [not found]         ` <CAE9z9A1PhS=xsySFLDMNUf8SPogT2Ka9SCoWE41XHYjmeKZFoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Rudi C @ 2019-08-16  6:07 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

I currently use a script to create a markdown with this structure:

# filename

```file-extension
file-content
```

# ...

Does your solution have advantages over this?
Btw, is there a table of supported things I can put after the triple `s?
Putting “el”, for example, did not activate EmacsLisp highlighting.

Ps: By plain text, I mean text that always wraps, and keeps its source
indentation. The kind of I thing I’ll see when I use `less` on a file.

On Thu, Aug 15, 2019 at 9:59 PM Daniel Staal <DStaal-Jdbf3xiKgS8@public.gmane.org> wrote:

> On 8/15/19 1:08 PM, Rudi C wrote:
> > I want to read source code on my Kindle, and I was hoping to just use
> `pandoc -s -f txt *.py -o a.mobi` but it seems pandoc lacks a plain text
> reader?!
> >
>
> Define plain text.  Do you just want it passed through with no changes?
> Do you want emphasis?  Do you want indents?  Do you want wrapping?
> Wrapping in some places but not others?
>
> Pandoc reads several different formats that look like plain text.
>
> In your case, I'd probably create a couple of files, each with just one
> line:
>
> 00000.py:
> ~~~{.python}
>
> ZZZZZZ.py
> ~~~~
>
> Then use `-f markdown` - that should enclose the whole thing inside a
> fenced code block and have it treat the interior as python code.
>
> Daniel T. Staal
>
> --
> ---------------------------------------------------------------
> This email copyright the author.  Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes.  This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ---------------------------------------------------------------
>
> --
> 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/DSRfQkWBlFE/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/4be8dffb-2e8c-3ba3-d584-a06928a48af7%40usa.net
> .
>

-- 
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/CAE9z9A1PhS%3DxsySFLDMNUf8SPogT2Ka9SCoWE41XHYjmeKZFoA%40mail.gmail.com.

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

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

* Re: Isn’t there a plain text reader? Why?
       [not found]         ` <CAE9z9A1PhS=xsySFLDMNUf8SPogT2Ka9SCoWE41XHYjmeKZFoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-08-16 14:32           ` Daniel Staal
       [not found]             ` <08494ac8-209d-dfa6-43b6-f19034f2bef7-Jdbf3xiKgS8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Staal @ 2019-08-16 14:32 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 8/16/19 2:07 AM, Rudi C wrote:
> I currently use a script to create a markdown with this structure:
> 
> # filename
> 
> ```file-extension
> file-content
> ```
> 
> # ...
> 
> Does your solution have advantages over this?
> Btw, is there a table of supported things I can put after the triple `s? 
> Putting “el”, for example, did not activate EmacsLisp highlighting.

No real advantages over this - it's basically an alternate syntax for 
the same thing.

There's no reference table, as it depends on the compile - however you 
can get the list for the current install with:

`pandoc --list-highlight-languages`

> Ps: By plain text, I mean text that always wraps, and keeps its source 
> indentation. The kind of I thing I’ll see when I use `less` on a file.

The point I was trying to make is that 'plain text' isn't a very 
well-defined term, or a structured input language.  Pandoc deals with 
structured input, and has several input formats that could reasonably 
handle random text - but unstructured text is a bit out of Pandoc's scope.

You're not dealing with unstructured text however - you're working with 
source code, and again Pandoc can handle source code in several formats 
- Markdown being the best supported and documented.

Daniel T. Staal

-- 
---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------

-- 
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/08494ac8-209d-dfa6-43b6-f19034f2bef7%40usa.net.


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

* Re: Isn’t there a plain text reader? Why?
       [not found]             ` <08494ac8-209d-dfa6-43b6-f19034f2bef7-Jdbf3xiKgS8@public.gmane.org>
@ 2019-08-17 14:34               ` Rudi C
       [not found]                 ` <CAE9z9A3zRg+9_v26kMR-9fb5HHykwQKDabiufWKSdHcNmMW0ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Rudi C @ 2019-08-17 14:34 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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

Thank you!
I imagine there are aliases defined for `pandoc
--list-highlight-languages`? Since specifying `py` seemed to work just as
well as `python`, if I'm remembering correctly. If so, where should I edit
in the sources ti add more aliases? (And send those edits as PRs)(Like,
`el` could be an alias for `commonlisp` ...)

On Fri, Aug 16, 2019 at 7:02 PM Daniel Staal <DStaal-Jdbf3xiKgS8@public.gmane.org> wrote:

> On 8/16/19 2:07 AM, Rudi C wrote:
> > I currently use a script to create a markdown with this structure:
> >
> > # filename
> >
> > ```file-extension
> > file-content
> > ```
> >
> > # ...
> >
> > Does your solution have advantages over this?
> > Btw, is there a table of supported things I can put after the triple `s?
> > Putting “el”, for example, did not activate EmacsLisp highlighting.
>
> No real advantages over this - it's basically an alternate syntax for
> the same thing.
>
> There's no reference table, as it depends on the compile - however you
> can get the list for the current install with:
>
> `pandoc --list-highlight-languages`
>
> > Ps: By plain text, I mean text that always wraps, and keeps its source
> > indentation. The kind of I thing I’ll see when I use `less` on a file.
>
> The point I was trying to make is that 'plain text' isn't a very
> well-defined term, or a structured input language.  Pandoc deals with
> structured input, and has several input formats that could reasonably
> handle random text - but unstructured text is a bit out of Pandoc's scope.
>
> You're not dealing with unstructured text however - you're working with
> source code, and again Pandoc can handle source code in several formats
> - Markdown being the best supported and documented.
>
> Daniel T. Staal
>
> --
> ---------------------------------------------------------------
> This email copyright the author.  Unless otherwise noted, you
> are expressly allowed to retransmit, quote, or otherwise use
> the contents for non-commercial purposes.  This copyright will
> expire 5 years after the author's death, or in 30 years,
> whichever is longer, unless such a period is in excess of
> local copyright law.
> ---------------------------------------------------------------
>
> --
> 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/DSRfQkWBlFE/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/08494ac8-209d-dfa6-43b6-f19034f2bef7%40usa.net
> .
>

-- 
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/CAE9z9A3zRg%2B9_v26kMR-9fb5HHykwQKDabiufWKSdHcNmMW0ag%40mail.gmail.com.

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

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

* Re: Isn’t there a plain text reader? Why?
       [not found]                 ` <CAE9z9A3zRg+9_v26kMR-9fb5HHykwQKDabiufWKSdHcNmMW0ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-08-19 15:17                   ` Daniel Staal
  2019-08-20  6:24                   ` John MacFarlane
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Staal @ 2019-08-19 15:17 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

On 8/17/19 10:34 AM, Rudi C wrote:
> Thank you!
> I imagine there are aliases defined for `pandoc 
> --list-highlight-languages`? Since specifying `py` seemed to work just 
> as well as `python`, if I'm remembering correctly. If so, where should I 
> edit in the sources ti add more aliases? (And send those edits as 
> PRs)(Like, `el` could be an alias for `commonlisp` ...)

I haven't played with it to much at the moment - I assume that's part of 
the Skylighting package.

Here's Pandoc's docs on highlighting, with links to how to create your 
own, and to the highlighting package it uses:
<https://pandoc.org/MANUAL.html#syntax-highlighting>

Daniel T. Staal

-- 
---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------


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

* Re: Isn’t there a plain text reader? Why?
       [not found]                 ` <CAE9z9A3zRg+9_v26kMR-9fb5HHykwQKDabiufWKSdHcNmMW0ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2019-08-19 15:17                   ` Daniel Staal
@ 2019-08-20  6:24                   ` John MacFarlane
  1 sibling, 0 replies; 7+ messages in thread
From: John MacFarlane @ 2019-08-20  6:24 UTC (permalink / raw)
  To: Rudi C, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


Yes, generally you can use either the canonical language name
(as listed by --list-highlight-languages) or standard file
extensions (like py).

If you look at the xml syntax descriptions here
https://github.com/jgm/skylighting/tree/master/skylighting-core/xml
you'll see (on the language element) the attribute "extensions";
this is where the accepted extensions come from.

Rudi C <rudiwillalwaysloveyou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Thank you!
> I imagine there are aliases defined for `pandoc
> --list-highlight-languages`? Since specifying `py` seemed to work just as
> well as `python`, if I'm remembering correctly. If so, where should I edit
> in the sources ti add more aliases? (And send those edits as PRs)(Like,
> `el` could be an alias for `commonlisp` ...)
>
> On Fri, Aug 16, 2019 at 7:02 PM Daniel Staal <DStaal-Jdbf3xiKgS8@public.gmane.org> wrote:
>
>> On 8/16/19 2:07 AM, Rudi C wrote:
>> > I currently use a script to create a markdown with this structure:
>> >
>> > # filename
>> >
>> > ```file-extension
>> > file-content
>> > ```
>> >
>> > # ...
>> >
>> > Does your solution have advantages over this?
>> > Btw, is there a table of supported things I can put after the triple `s?
>> > Putting “el”, for example, did not activate EmacsLisp highlighting.
>>
>> No real advantages over this - it's basically an alternate syntax for
>> the same thing.
>>
>> There's no reference table, as it depends on the compile - however you
>> can get the list for the current install with:
>>
>> `pandoc --list-highlight-languages`
>>
>> > Ps: By plain text, I mean text that always wraps, and keeps its source
>> > indentation. The kind of I thing I’ll see when I use `less` on a file.
>>
>> The point I was trying to make is that 'plain text' isn't a very
>> well-defined term, or a structured input language.  Pandoc deals with
>> structured input, and has several input formats that could reasonably
>> handle random text - but unstructured text is a bit out of Pandoc's scope.
>>
>> You're not dealing with unstructured text however - you're working with
>> source code, and again Pandoc can handle source code in several formats
>> - Markdown being the best supported and documented.
>>
>> Daniel T. Staal
>>
>> --
>> ---------------------------------------------------------------
>> This email copyright the author.  Unless otherwise noted, you
>> are expressly allowed to retransmit, quote, or otherwise use
>> the contents for non-commercial purposes.  This copyright will
>> expire 5 years after the author's death, or in 30 years,
>> whichever is longer, unless such a period is in excess of
>> local copyright law.
>> ---------------------------------------------------------------
>>
>> --
>> 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/DSRfQkWBlFE/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/08494ac8-209d-dfa6-43b6-f19034f2bef7%40usa.net
>> .
>>
>
> -- 
> 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/CAE9z9A3zRg%2B9_v26kMR-9fb5HHykwQKDabiufWKSdHcNmMW0ag%40mail.gmail.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/m2mug4iccb.fsf%40johnmacfarlane.net.


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

end of thread, other threads:[~2019-08-20  6:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 17:08 Isn’t there a plain text reader? Why? Rudi C
     [not found] ` <255f893b-1048-4de9-aaeb-e9778187e701-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-08-15 17:29   ` Daniel Staal
     [not found]     ` <4be8dffb-2e8c-3ba3-d584-a06928a48af7-Jdbf3xiKgS8@public.gmane.org>
2019-08-16  6:07       ` Rudi C
     [not found]         ` <CAE9z9A1PhS=xsySFLDMNUf8SPogT2Ka9SCoWE41XHYjmeKZFoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-16 14:32           ` Daniel Staal
     [not found]             ` <08494ac8-209d-dfa6-43b6-f19034f2bef7-Jdbf3xiKgS8@public.gmane.org>
2019-08-17 14:34               ` Rudi C
     [not found]                 ` <CAE9z9A3zRg+9_v26kMR-9fb5HHykwQKDabiufWKSdHcNmMW0ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-19 15:17                   ` Daniel Staal
2019-08-20  6:24                   ` John MacFarlane

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