Caching Metafun images and VIM Syntax highlighted code
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
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
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 -----------------------------------------------------------------
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
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
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
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
Shiv Shankar Dayal
-
Wolfgang Schuster