Metapost snippets out-source-able from thconfig/layout?
Hallo everybody, due to learning some metapost for making a Schacht (shaft?) symbol, I got a thconfig file getting really fat and difficult to maintain. Is there a possibility to source metapost snippets from another file? Neither 'source' nor 'input' (Handbook p. 15) seem to work, which does not wonder me as the context 'layout' has to be obeyed. So, how are the people here handling that? Big, fat thconfig, or is there another way? Best regards, Christian
Hi Christian, input should work. See attached example files. Ladislav
10. 5. 2016 v 17:45, Christian Rößler (Roessler) <chr_rossi@kartan.de>:
Hallo everybody,
due to learning some metapost for making a Schacht (shaft?) symbol, I got a thconfig file getting really fat and difficult to maintain. Is there a possibility to source metapost snippets from another file?
Neither 'source' nor 'input' (Handbook p. 15) seem to work, which does not wonder me as the context 'layout' has to be obeyed.
So, how are the people here handling that? Big, fat thconfig, or is there another way?
Best regards, Christian _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Am Dienstag, 10. Mai 2016, 17:55:31 schrieb Ladislav Blažek:
input should work. See attached example files. Ladislav
Ah, I see: You have out-sourced the whole layout! Thank you for the hint, this idea has escaped me. This will help at least a little, but my hope was, that I could do such: # input metacode_thistry # input metacode_thattry input metacode_perhapslikethis and # input metacode_thistry input metacode_thattry # input metacode_perhapslikethis …while mangling metapost code. Best regards, Christian
Hi, it is just one option how to handle complex thconfig files. I am using one "layout" file for several projects. This file sits in top folder and is referenced from all thconfig files. L. Původní zpráva Od: Christian Rößler Odesláno: úterý, 10. května 2016 18:13 Komu: List for Therion users Odpovědět: List for Therion users Předmět: Re: [Therion] Metapost snippets out-source-able from thconfig/layout? Am Dienstag, 10. Mai 2016, 17:55:31 schrieb Ladislav Blažek:
input should work. See attached example files. Ladislav
Ah, I see: You have out-sourced the whole layout! Thank you for the hint, this idea has escaped me. This will help at least a little, but my hope was, that I could do such: # input metacode_thistry # input metacode_thattry input metacode_perhapslikethis and # input metacode_thistry input metacode_thattry # input metacode_perhapslikethis …while mangling metapost code. Best regards, Christian _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Am Dienstag, 10. Mai 2016, 18:21:46 schrieb Ladislav Blažek:
Hi, it is just one option how to handle complex thconfig files. I am using one "layout" file for several projects. This file sits in top folder and is referenced from all thconfig files. L.
Good idea! Haven't thought about that, as I need shaft sympols dearly and was focused on that. But as I just have finished the third therion mine map, and have many more I need to work onto stacked up during the last years (even such without shafts into them), I will outsource the layouts of the maps I made so far at once. Next step. Best of all: if I combine both methods of linking stuff in, layouts and metapost code, I can now change my shaft symbols easily and centrally. This will make it very easy to re-view them very fast in many different maps, easily scriptable, and even better, change them in all maps at once if I made a workable version. Which may take a while, I fear. Best regards, and extra thanks for re-hinting which should have been obvious to me, Christian
A Therion principle. Write once, use many times. Be cautious however and balance the 'centralised layout' idea against the contrary advantage of having each mine or 'collection of mines' in self contained folders that can be moved to different machines or environments without breaking links to outsourced locations. As most of 'my' cave systems are constrained to several square km in area, I have a single master layout for those at the top folder level. If I want to separate out just one cave from a sub folder and say give to someone else I only have to copy the 'central layout file' to that folder and one or two input statements to change to make the sub project work. There is a balance between totally centralised and having each subproject completely self contained if its folder is removed from its parent. A choice. See the links in my reply to Henry just now. Bruce
But as I just have finished the third therion mine map, and have many more I need to work onto stacked up during the last years (even such without shafts into them), I will outsource the layouts of the maps I made so far at once. Next step.
Best of all: if I combine both methods of linking stuff in, layouts and metapost code, I can now change my shaft symbols easily and centrally. This will make it very easy to re-view them very fast in many different maps, easily scriptable, and even better, change them in all maps at once if I made a workable version. Which may take a while, I fear.
Am Mittwoch, 11. Mai 2016, 08:13:13 schrieb Bruce <bruce@tomo.co.nz>: Hallo Bruce,
A Therion principle. Write once, use many times. Be cautious however and balance the 'centralised layout' idea against the contrary advantage of having each mine or 'collection of mines' in self contained folders that can be moved to different machines or environments without breaking links to outsourced locations.
yes. I have centralized my meager three Therion maps, and then one of my colleagues asked me about the nice map I have sent to him, which program I made them with etc. pp., got interest and asked me about the source files to see for herself. And then I nearly archive-packed and sent…
As most of 'my' cave systems are constrained to several square km in area, I have a single master layout for those at the top folder level. If I want to separate out just one cave from a sub folder and say give to someone else I only have to copy the 'central layout file' to that folder and one or two input statements to change to make the sub project work. There is a balance between totally centralised and having each subproject completely self contained if its folder is removed from its parent. A choice. See the links in my reply to Henry just now.
…not enough, I mean with missing centralized layout and metapost files; exactly, what you meant above. Funny coincidence, but perhaps to be expected. I have solved it as following: therion directory | |-- metapost file | |-- centralized layout, input'ing metapost file in same dir | |-project directory |-- symlink to centralized layout |-- (normally unneeded) symlink to metapost file |-- thconfig input'ing centralized layout in _same_ directory (./) (I hope this is readable) That way I can edit the centralized layout and metapost file in therion directory before recompiling, as: thconfig -> centr. layout -> (following symlink) -> centr. layout in therion directory. And if I archive I just need to dereference the symlinks (no editing of files), so I archive the directory as following: project directory |-- centralized layout (dereferenced symlink) |-- metapost file (via previously unneded symlink to metapost file) But: If I forget to dereference the symlinks while packing, or forget the (while working) unneeded symlink to the metapost file, this would break. And I would need more unneeded symlinks, if I decide to input more than one metapost file. And this way does only work with OS's capable of symlinks; I am not sure whether windows could do such. But's but: This dereferencing method gives me an easy route to hew any project directory from the mineral lode, so to say, for others and for me, if the need arises. So I am going that route, but - as you correctly warned - with care. Another coincidence was the parallel discussion about several layouts per map export, as I noticed I lost eg. the map comments when wholly centralized. So I add, if needed, another layout zusaetze (addons) for stuff I would not or could not centralize to the map export. So thanks, Bruce, and Ladislav, and also Henry for asking the right question at the right time for me to use, and of course Martin, and a hearty Glückauf (or what cavers greet themselves) to you all! Christian
Láďo, potřeboval bych to protlačit do konfery, ale nechce mi to pustit přílohy.
11. 5. 2016 v 0:15, Christian Rößler <chr_rossi@kartan.de>:
herion directory | |-- metapost file | |-- centralized layout, input'ing metapost file in same dir | |-project directory |-- symlink to centralized layout |-- (normally unneeded) symlink to metapost file |-- thconfig input'ing centralized layout in _same_ directory (./)
My add-on to structure of files: The central .th file: survey klisura -title "Great Canyon <br>Gryka e Madhe <br>Velika Klisura" input ../indexes/index_th input ../indexes/index_th2 input ../indexes/index_equate input ../indexes/index_join input ../indexes/index_map endsurvey m.s.
Hi Christian, try this code metapost input "link_to_where\myfile.mp" endcode you can't use a network path. Enjoy, Henry -----Original Message----- From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Christian Rößler (Roessler) Sent: 10 May 2016 16:45 To: 'List for Therion users' <therion@speleo.sk> Subject: [Therion] Metapost snippets out-source-able from thconfig/layout? Hallo everybody, due to learning some metapost for making a Schacht (shaft?) symbol, I got a thconfig file getting really fat and difficult to maintain. Is there a possibility to source metapost snippets from another file? Neither 'source' nor 'input' (Handbook p. 15) seem to work, which does not wonder me as the context 'layout' has to be obeyed. So, how are the people here handling that? Big, fat thconfig, or is there another way? Best regards, Christian _______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Am Dienstag, 10. Mai 2016, 16:56:00 schrieb Henry Bennett:
due to learning some metapost for making a Schacht (shaft?) symbol, I got a thconfig file getting really fat and difficult to maintain. Is there a possibility to source metapost snippets from another file?
code metapost input "link_to_where\myfile.mp" endcode
of course! Thanks! That's it! Best regards, Christian
participants (6)
-
Bruce -
Christian Rößler -
Christian Rößler (Roessler) -
Henry Bennett -
Ladislav Blažek -
Martin Sluka