Davide.Barranca Posted September 22, 2019 Share Posted September 22, 2019 Hi, technical authors – myself included – may need to design books that include programming code (C++, JavaScript, Python, you name it) with proper syntax highlighting. As discussed at length in this thread, copy & paste from the code editor (e.g. Visual Studio Code, Sublime Text, Atom, etc.) to a Text Frame doesn't work. Besides, it seems that Edit > Paste Special is a Win only feature of Publisher. The one workaround available involves an intermediate step: Copy from the code editor. Paste to an application such as Word, Apple Pages, LibreOffice. Copy from Word/Pages/etc. and paste to Publisher text frame. This way, as far as I get, the proper Rich Text information is preserved. Although the process works, the extra step is not only tedious, but doesn't scale up when the book contains a good deal of code samples that must be maintained in an easier, faster fashion. It would be much handier to have the option to either select a portion of text in a Text Frame and assign the Language (programming language) that automatically triggers the appropriate syntax highlighting. Or have a Code Text Frame as a separate tool altogether, with properties, options and such. Thank you! Davide Barranca leuveg 1 Quote Link to comment Share on other sites More sharing options...
lacerto Posted September 22, 2019 Share Posted September 22, 2019 (...) hawk 1 Quote Link to comment Share on other sites More sharing options...
Davide.Barranca Posted September 22, 2019 Author Share Posted September 22, 2019 As far as I understand, in this case things are easier on the Windows side of the world – on Mac, not so much :-) Quote Link to comment Share on other sites More sharing options...
Palatino Posted September 22, 2019 Share Posted September 22, 2019 Quote Thanks to DeepL. Link to comment Share on other sites More sharing options...
lacerto Posted September 22, 2019 Share Posted September 22, 2019 (...) Quote Link to comment Share on other sites More sharing options...
garrettm30 Posted September 23, 2019 Share Posted September 23, 2019 I can see how this could be very useful for a small segment of users, but it may well be too much effort for Serif to implement (and for how many languages?) for a relatively small market. That's just a guess, of course. My hunch is that this would be an case for a third-party plugin were such a thing possible. It would be nice to have some kind of plugin or extension architecture. Quote Link to comment Share on other sites More sharing options...
Davide.Barranca Posted September 23, 2019 Author Share Posted September 23, 2019 Sure enough, it'd be nice to have an environment/API that would allow such third-party plugins. I can't wait!I do acknowledge that it isn't the first feat. request that may cheer the average user, but this doesn't mean one shouldn't log a request anyway :-) As for the user segmentation, as a technical author I am evaluating myself whether to go with Affinity or stick to the MarkDown -> LaTeX -> PDF workflow (either Pandoc, LeanPub or SoftCover). Both choices have their pros and cons... Davide Quote Link to comment Share on other sites More sharing options...
fde101 Posted October 16, 2019 Share Posted October 16, 2019 If a sufficiently flexible conditional formatting feature (such as the misnamed "grep formats" or whatever they are calling them these days) were to be implemented, there are probably a few languages which could be handled by those, though it wouldn't cover all of them without some form of hierarchical context between the styles, which would make development of syntax highlighting using conditional formats a possibility. A hierarchical context between such formats does not seem like an unreasonable extension to Publisher, and conditional formats in general are wanted by many and should definitely be added, so I'm not so sure that this is too marginal to be considered as part of the main program. I wouldn't expect them to provide the actual syntax parsing, but the facilities to create the styles ourselves seem fair enough? As to the copy/paste from a text editor, if doing so with another program works and maintains the highlighting, then that is a VERY reasonable request for the Affinity apps - to recognize the additional clipboard format(s) involved and retain the formatting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.