ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Caching Metafun images and VIM Syntax highlighted code
@ 2024-01-24 16:06 Shiv Shankar Dayal
  2024-01-24 16:50 ` [NTG-context] " Aditya Mahajan
  2024-01-24 22:02 ` Wolfgang Schuster
  0 siblings, 2 replies; 5+ messages in thread
From: Shiv Shankar Dayal @ 2024-01-24 16:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I am writing two books. One is on Rust programming and another is on
geometry, so I have syntax highlighted code and in second has lost of
diagrams.

Perhaps Aditya Mahajan can tell me how can I cache code snippets. Invoking
VIM will have heavy penalty on highlighting the code otherwise.

Other than that, how can I cache Metafun images so that they are not
recomputed on every processing of file.

-- 
Respect,
Shiv Shankar Dayal

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

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code
  2024-01-24 16:06 [NTG-context] Caching Metafun images and VIM Syntax highlighted code Shiv Shankar Dayal
@ 2024-01-24 16:50 ` Aditya Mahajan
  2024-01-24 17:00   ` Hans Hagen
  2024-01-24 22:02 ` Wolfgang Schuster
  1 sibling, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2024-01-24 16:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 24 Jan 2024, Shiv Shankar Dayal wrote:

> Perhaps Aditya Mahajan can tell me how can I cache code snippets. Invoking
> VIM will have heavy penalty on highlighting the code otherwise.

Have you tried the vim module:

https://github.com/adityam/filter/blob/dev/vim-README.md

Caching is enabled out of the box, so you don't need to configure anything.

> Other than that, how can I cache Metafun images so that they are not
> recomputed on every processing of file.

There used to a command for caching metafun images in MkII, but I don't know if that is really needed in LMTX. In most cases, metapost processing does not have a significant processing delay. 

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code
  2024-01-24 16:50 ` [NTG-context] " Aditya Mahajan
@ 2024-01-24 17:00   ` Hans Hagen
  2024-01-24 17:13     ` Shiv Shankar Dayal
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2024-01-24 17:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 1/24/2024 5:50 PM, Aditya Mahajan wrote:
> On Wed, 24 Jan 2024, Shiv Shankar Dayal wrote:
> 
>> Perhaps Aditya Mahajan can tell me how can I cache code snippets. Invoking
>> VIM will have heavy penalty on highlighting the code otherwise.
> 
> Have you tried the vim module:
> 
> https://github.com/adityam/filter/blob/dev/vim-README.md
> 
> Caching is enabled out of the box, so you don't need to configure anything.
> 
>> Other than that, how can I cache Metafun images so that they are not
>> recomputed on every processing of file.
> 
> There used to a command for caching metafun images in MkII, but I don't know if that is really needed in LMTX. In most cases, metapost processing does not have a significant processing delay.
if images are the same one can use the reuseMPgraphic or uniqueMPgraphic 
features .. plenty of examples can be found, but as Aditya poined out mp 
is quite fast (but reuse saves on file size)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code
  2024-01-24 17:00   ` Hans Hagen
@ 2024-01-24 17:13     ` Shiv Shankar Dayal
  0 siblings, 0 replies; 5+ messages in thread
From: Shiv Shankar Dayal @ 2024-01-24 17:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Dear Hans, Aditya,

Thanks for clarifying. In any case, I will process chapter-by-chapter,
so runtime should be manageable.

On Wed, Jan 24, 2024 at 10:32 PM Hans Hagen <j.hagen@xs4all.nl> wrote:

> On 1/24/2024 5:50 PM, Aditya Mahajan wrote:
> > On Wed, 24 Jan 2024, Shiv Shankar Dayal wrote:
> >
> >> Perhaps Aditya Mahajan can tell me how can I cache code snippets.
> Invoking
> >> VIM will have heavy penalty on highlighting the code otherwise.
> >
> > Have you tried the vim module:
> >
> > https://github.com/adityam/filter/blob/dev/vim-README.md
> >
> > Caching is enabled out of the box, so you don't need to configure
> anything.
> >
> >> Other than that, how can I cache Metafun images so that they are not
> >> recomputed on every processing of file.
> >
> > There used to a command for caching metafun images in MkII, but I don't
> know if that is really needed in LMTX. In most cases, metapost processing
> does not have a significant processing delay.
> if images are the same one can use the reuseMPgraphic or uniqueMPgraphic
> features .. plenty of examples can be found, but as Aditya poined out mp
> is quite fast (but reuse saves on file size)
>
> Hans
>
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>         tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>


-- 
Respect,
Shiv Shankar Dayal

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

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code
  2024-01-24 16:06 [NTG-context] Caching Metafun images and VIM Syntax highlighted code Shiv Shankar Dayal
  2024-01-24 16:50 ` [NTG-context] " Aditya Mahajan
@ 2024-01-24 22:02 ` Wolfgang Schuster
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2024-01-24 22:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Shiv Shankar Dayal

Shiv Shankar Dayal schrieb am 24.01.2024 um 17:06:
> I am writing two books. One is on Rust programming and another is on 
> geometry, so I have syntax highlighted code and in second has lost of 
> diagrams.
>
> Perhaps Aditya Mahajan can tell me how can I cache code snippets. 
> Invoking VIM will have heavy penalty on highlighting the code otherwise.

You can also try to extend ConTeXt's syntax highlighter (or the scite 
module) to support Rust which solves the cache problem.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-01-24 22:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24 16:06 [NTG-context] Caching Metafun images and VIM Syntax highlighted code Shiv Shankar Dayal
2024-01-24 16:50 ` [NTG-context] " Aditya Mahajan
2024-01-24 17:00   ` Hans Hagen
2024-01-24 17:13     ` Shiv Shankar Dayal
2024-01-24 22:02 ` Wolfgang Schuster

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