public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Pikchr in Pandoc
@ 2021-02-01  4:42 Dan Shearer
       [not found] ` <YBeGoc/cMhn7sLG8-2yWpFc3xKUBM656bX5wj8A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Shearer @ 2021-02-01  4:42 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I have not noticed mention of Pikchr here, and I think it is relevant to
recent discussion of diagrams and also GSoC.

https://pikchr.org/ is a simple plain-text markup language for diagrams
that produces SVG. It is a slightly modified version of Brian
Kernighan's PIC language from 40 years ago, updated to make it safe to
use on the web.

Pikchr is ideal for use in Markdown - see the examples at 
https://pikchr.org/home/skn_default/doc/trunk/doc/examples.md , or the 
same examples in darkmode:
https://pikchr.org/home/skn_ardoise/doc/trunk/doc/examples.md . Click on
each diagram to see the plain text source code.

Pikchr is implemented in a single C source file with no dependencies,
intended for embedding within as many tools as possible. 

--
Dan Shearer
dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.org


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

* Re: Pikchr in Pandoc
       [not found] ` <YBeGoc/cMhn7sLG8-2yWpFc3xKUBM656bX5wj8A@public.gmane.org>
@ 2021-02-01 16:43   ` ChrisD
       [not found]     ` <0f250ab3-fbea-cc8f-dd4c-c9ff234b8c98-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
  2021-02-01 17:40   ` John MacFarlane
  1 sibling, 1 reply; 9+ messages in thread
From: ChrisD @ 2021-02-01 16:43 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

I was not aware of Pitchr, so thanks for posting this. I have used dot (graphviz) a lot, but Pitchr looks to fill a different niche.

Is Pitchr available as a executable somewhere? All I could find was the C source code file. Thanks,


On 1/31/2021 9:42 PM, Dan Shearer wrote:
> I have not noticed mention of Pikchr here, and I think it is relevant to
> recent discussion of diagrams and also GSoC.
>
> https://pikchr.org/ is a simple plain-text markup language for diagrams
> that produces SVG. It is a slightly modified version of Brian
> Kernighan's PIC language from 40 years ago, updated to make it safe to
> use on the web.
>
> Pikchr is ideal for use in Markdown - see the examples at
> https://pikchr.org/home/skn_default/doc/trunk/doc/examples.md , or the
> same examples in darkmode:
> https://pikchr.org/home/skn_ardoise/doc/trunk/doc/examples.md . Click on
> each diagram to see the plain text source code.
>
> Pikchr is implemented in a single C source file with no dependencies,
> intended for embedding within as many tools as possible.
>
> --
> Dan Shearer
> dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.org
>


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

* Re: Pikchr in Pandoc
       [not found] ` <YBeGoc/cMhn7sLG8-2yWpFc3xKUBM656bX5wj8A@public.gmane.org>
  2021-02-01 16:43   ` ChrisD
@ 2021-02-01 17:40   ` John MacFarlane
       [not found]     ` <m21rdz3cvx.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2021-02-01 17:40 UTC (permalink / raw)
  To: Dan Shearer, pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw


We wouldn't embed this directly in pandoc (trying to avoid
C dependencies), but it would be easy to create a filter
to intercept specially marked code blocks and convert them
to pictures. (There are examples of this kind of thing in the
pandoc/lua-filters repository.)

Dan Shearer <dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.org> writes:

> I have not noticed mention of Pikchr here, and I think it is relevant to
> recent discussion of diagrams and also GSoC.
>
> https://pikchr.org/ is a simple plain-text markup language for diagrams
> that produces SVG. It is a slightly modified version of Brian
> Kernighan's PIC language from 40 years ago, updated to make it safe to
> use on the web.
>
> Pikchr is ideal for use in Markdown - see the examples at 
> https://pikchr.org/home/skn_default/doc/trunk/doc/examples.md , or the 
> same examples in darkmode:
> https://pikchr.org/home/skn_ardoise/doc/trunk/doc/examples.md . Click on
> each diagram to see the plain text source code.
>
> Pikchr is implemented in a single C source file with no dependencies,
> intended for embedding within as many tools as possible. 
>
> --
> Dan Shearer
> dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.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/YBeGoc/cMhn7sLG8%40mx.shearer.org.


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

* Re: Pikchr in Pandoc
       [not found]     ` <m21rdz3cvx.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-02-02 14:32       ` 'Dan Shearer' via pandoc-discuss
       [not found]         ` <f194310d-8b68-41d5-a13e-28f83fd7b512n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2021-02-02 14:55       ` 'Dan Shearer' via pandoc-discuss
  2021-11-25  9:19       ` 'Dan Shearer' via pandoc-discuss
  2 siblings, 1 reply; 9+ messages in thread
From: 'Dan Shearer' via pandoc-discuss @ 2021-02-02 14:32 UTC (permalink / raw)
  To: pandoc-discuss


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

Le lundi 1 février 2021 à 17:40:33 UTC, John MacFarlane a écrit :

>
> We wouldn't embed this directly in pandoc (trying to avoid 
> C dependencies), but it would be easy to create a filter 
> to intercept specially marked code blocks and convert them 
> to pictures. (There are examples of this kind of thing in the 
> pandoc/lua-filters repository.) 
>

John, what is needed to help make a Pikchr filter happen? 

The obvious place at least initially for such code blocks to appear is in 
Markdown. Pikchr is intended (just like PIC was) to be used as a 
plugin/filter in any context, but it's main development environment to date 
has been in the Fossil variant of Markdown, see 
https://www.fossil-scm.org/xfer/md_rules. Pandoc doesn't support Fossil 
Markdown, but  it seems like it would not be hard to do so.

--
Dan Shearer
dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.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/f194310d-8b68-41d5-a13e-28f83fd7b512n%40googlegroups.com.

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

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

* Re: Pikchr in Pandoc
       [not found]     ` <0f250ab3-fbea-cc8f-dd4c-c9ff234b8c98-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
@ 2021-02-02 14:46       ` 'Dan Shearer' via pandoc-discuss
  0 siblings, 0 replies; 9+ messages in thread
From: 'Dan Shearer' via pandoc-discuss @ 2021-02-02 14:46 UTC (permalink / raw)
  To: pandoc-discuss


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

Le lundi 1 février 2021 à 16:43:36 UTC, ChrisD a écrit :

> I was not aware of Pitchr, so thanks for posting this. I have used dot 
> (graphviz) a lot, but Pitchr looks to fill a different niche. 
>

Yes it does, while also very much being of the do-one-job-well philosophy. 
Not surprising from something Brian Kernighan wrote.

Is Pitchr available as a executable somewhere? All I could find was the C 
> source code file. Thanks, 
>

No, Pikchr is not currently available as an executable. However pretty much 
any C build environment will create an executable as follows.

1. Get the (very small, zero dependency) Pikchr source from one of:
    a) https://pikchr.org/home/download . This is an automatic 
tarball/zip/sqlar from the latest Fossil checkin.
    b) the command "fossil clone https://pikchr.org/"

2. cd pikchr
    make

   this will give you a binary called "pikchr" (probably PIKCHR.EXE for 
Windows, but I have never tried with Windows)

3. You can then try pikchr:

./pikchr --svg-only examples/headings01.pikchr

will produce only the SVG code corresponding to the Pikchr code. 

 ./pikchr examples/headings01.pikchr > /tmp/headings.html

This wraps the SVG in HTML, you can point your web browser at 
/tmp/headings.html

I have an SVG convertor called rsvg-convert from the librsvg2-bin package. 
Using this I can generate PNG:

./pikchr --svg-only examples/headings01.pikchr | rsvg-convert > 
/tmp/headings.png

--
Dan Shearer
dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.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/ab76e66c-7cc6-404b-9d38-4e16351aa424n%40googlegroups.com.

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

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

* Re: Pikchr in Pandoc
       [not found]     ` <m21rdz3cvx.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  2021-02-02 14:32       ` 'Dan Shearer' via pandoc-discuss
@ 2021-02-02 14:55       ` 'Dan Shearer' via pandoc-discuss
  2021-11-25  9:19       ` 'Dan Shearer' via pandoc-discuss
  2 siblings, 0 replies; 9+ messages in thread
From: 'Dan Shearer' via pandoc-discuss @ 2021-02-02 14:55 UTC (permalink / raw)
  To: pandoc-discuss


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

Le lundi 1 février 2021 à 17:40:33 UTC, John MacFarlane a écrit :

>
> We wouldn't embed this directly in pandoc (trying to avoid 
> C dependencies), but it would be easy to create a filter 
>

Another relevant document is "How to use Pikchr in Markdown" : 
https://pikchr.org/home/doc/trunk/doc/usepikchr.md

--
Dan Shearer
dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.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/d750d2bc-be80-4341-9b62-ca63424defbdn%40googlegroups.com.

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

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

* Re: Pikchr in Pandoc
       [not found]         ` <f194310d-8b68-41d5-a13e-28f83fd7b512n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-02-02 17:29           ` John MacFarlane
       [not found]             ` <m2czxigyzn.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: John MacFarlane @ 2021-02-02 17:29 UTC (permalink / raw)
  To: 'Dan Shearer' via pandoc-discuss, pandoc-discuss

"'Dan Shearer' via pandoc-discuss"
<pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes:

> Le lundi 1 février 2021 à 17:40:33 UTC, John MacFarlane a écrit :
>
>>
>> We wouldn't embed this directly in pandoc (trying to avoid 
>> C dependencies), but it would be easy to create a filter 
>> to intercept specially marked code blocks and convert them 
>> to pictures. (There are examples of this kind of thing in the 
>> pandoc/lua-filters repository.) 
>>
>
> John, what is needed to help make a Pikchr filter happen? 

You can learn about how to write pandoc filters from the
documentation

https://pandoc.org/filters.html
https://pandoc.org/lua-filters.html

You could, in principle, write the whole filter in C (using
the pikchr liibrary and a JSON-parsing and generating library).
Or you could use any other language.

-- 
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/m2czxigyzn.fsf%40MacBook-Pro.hsd1.ca.comcast.net.


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

* Re: Pikchr in Pandoc
       [not found]     ` <m21rdz3cvx.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  2021-02-02 14:32       ` 'Dan Shearer' via pandoc-discuss
  2021-02-02 14:55       ` 'Dan Shearer' via pandoc-discuss
@ 2021-11-25  9:19       ` 'Dan Shearer' via pandoc-discuss
  2 siblings, 0 replies; 9+ messages in thread
From: 'Dan Shearer' via pandoc-discuss @ 2021-11-25  9:19 UTC (permalink / raw)
  To: pandoc-discuss


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



Le lundi 1 février 2021 à 17:40:33 UTC, John MacFarlane a écrit :

>
> We wouldn't embed this directly in pandoc (trying to avoid 
> C dependencies), but it would be easy to create a filter 
> to intercept specially marked code blocks and convert them 
> to pictures. 
>
 

> Dan Shearer <d...-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.org> writes: 
>
> > I have not noticed mention of Pikchr here, and I think it is relevant to 
> > recent discussion of diagrams and also GSoC. 
>

... and that is what someone has just published code to do, see 
https://pikchr.org/home/forumpost/4e032f8b04 . The author is looking for 
feedback.
 
--
Dan Shearer
dan-QNUrB6Xd9YFAfugRpC6u6w@public.gmane.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/68fcd43a-b2f8-4869-a212-e79db105113fn%40googlegroups.com.

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

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

* Re: Pikchr in Pandoc
       [not found]             ` <m2czxigyzn.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2022-01-10 21:16               ` 'Dan Shearer' via pandoc-discuss
  0 siblings, 0 replies; 9+ messages in thread
From: 'Dan Shearer' via pandoc-discuss @ 2022-01-10 21:16 UTC (permalink / raw)
  To: pandoc-discuss


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

Le mardi 2 février 2021 à 17:29:16 UTC, John MacFarlane a écrit :

> "'Dan Shearer' via pandoc-discuss" 
> <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes: 
>
> > Le lundi 1 février 2021 à 17:40:33 UTC, John MacFarlane a écrit : 
> > 
> >> 
> >> We wouldn't embed this directly in pandoc (trying to avoid 
> >> C dependencies), but it would be easy to create a filter 
> >> to intercept specially marked code blocks and convert them 
> >> to pictures. (There are examples of this kind of thing in the 
> >> pandoc/lua-filters repository.) 
> >> 
> > 
> > John, what is needed to help make a Pikchr filter happen? 
>
> https://pandoc.org/lua-filters.html 
>

Here is the filter in Lua: 
https://code.jboy.space/pikchr-filter/file?name=pikchr.lua&ci=tip  .

It assumes the pikchr binary is in the path.

Dan


-- 
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/131b93bd-047c-4020-9ec3-3bb01d26cf83n%40googlegroups.com.

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

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

end of thread, other threads:[~2022-01-10 21:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01  4:42 Pikchr in Pandoc Dan Shearer
     [not found] ` <YBeGoc/cMhn7sLG8-2yWpFc3xKUBM656bX5wj8A@public.gmane.org>
2021-02-01 16:43   ` ChrisD
     [not found]     ` <0f250ab3-fbea-cc8f-dd4c-c9ff234b8c98-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org>
2021-02-02 14:46       ` 'Dan Shearer' via pandoc-discuss
2021-02-01 17:40   ` John MacFarlane
     [not found]     ` <m21rdz3cvx.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-02-02 14:32       ` 'Dan Shearer' via pandoc-discuss
     [not found]         ` <f194310d-8b68-41d5-a13e-28f83fd7b512n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-02-02 17:29           ` John MacFarlane
     [not found]             ` <m2czxigyzn.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2022-01-10 21:16               ` 'Dan Shearer' via pandoc-discuss
2021-02-02 14:55       ` 'Dan Shearer' via pandoc-discuss
2021-11-25  9:19       ` 'Dan Shearer' via pandoc-discuss

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