Hi! The last project I've done with Mason was a success, so I've decided to use it yet for another one. This time, there is a challenge to it, and since the documentation is not exactly helping, I've decided to consult here again :-)
I have two questions. Let me start with the simple one: 1) How do I propagate a variable Up the component tree? The use case is simple: I have Base.mc, which defines most of the page layout, and another one, let's say it's foo.mc, which wants to add to the title. I could probably find a way to hack it by studying the generated class files, but surely, there must be a simpler way. 2) How do I create custom component type? I've noticed I can add custom suffixed, but seen no way to declare component it self. I've found that pure perl components are a bit hacky, since they seem to only append the '<%class>' and '</%class>' and are hacked inside the Interp and Compiler. I am thinking of making the same thing, in the end, I just want to see the content before it's modified and filter some stuff in and out. I wonder if there is a clean way to do it, mainly because I'm worried that some other plugin may, with good intentions, step in and do something stupid, so I won't be able to process the file normally (it won't happen in my case, but hey, good practices!) The use case for this is to have a place, where foo.pp (like plain page) is in format: #title: Some title #since: 6.9.2014, 22:55 Some simple text, which is formated by Markdown or some other preprocessor. ... so that any user who can use text editor and learn a bit of a Markdown syntax can create and write a simple page like this. The component therefore needs to find the few first lines and convert them to variables, push them upward, run the Markdown and push the result forward into the Mason machinery. Here, you can see another challenge, and that is indexing of *.pp's, so they can appear somewhere automatically (and I won't have to call File::Find or something else each time I want the list), but this is the easiest part. So, here I am, asking for opinions/solutions/comments/suggestions; even the drastic ones (note that I don't want any databases, I want my pages in the filesystem hierarchy of Mason components). Thanks! -- S pozdravem Ladislav Láska <la...@kam.mff.cuni.cz> Katedra Aplikované Matematiky, MFF UK tel.: +420 739 464 167 ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users