Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Make a Markup Method in Perl?

by davido (Cardinal)
on May 16, 2012 at 01:43 UTC ( [id://970738]=note: print w/replies, xml ) Need Help??


in reply to Make a Markup Method in Perl?

Text markup, whether it's in human readable format such as HTML, or in a machine readable format such as with MS Office, targets a particular rendering engine. HTML targets web browsers (among other entities) that understand HTML. Let's say you manage to come up with a whiz-bang markup language that fits some well-defined niche. What use is it if there is no tool that knows how to render it?

Once you decide what you want to target (a browser, ...or who-knows-what else), then the markup language is already decided for you.

Perhaps you want to translate one simplistic markup language of your design into a more complex one that already exists; perl-j-markup2html, perl-j-markup2pod... whatever. What makes your new language better or more practical, and for what application, than what's already out there? Why would I want to learn perl-j-markup when I already know HTML?

Maybe you already have answers to these questions. If you do, you are well on your way to defining the problem and the use case. But with no use case, you're just in search of a problem that doesn't need a solution.


Dave

Replies are listed 'Best First'.
Re^2: Make a Markup Method in Perl?
by perl.j (Pilgrim) on May 16, 2012 at 09:55 UTC
    Honestly davido, I do have a plan. The only thing I don't know is how to change the look of the text.
    --perl.j
      Honestly davido, I do have a plan. The only thing I don't know is how to change the look of the text.
      You have two problems here. You want to invent a markup. Since you don't show any, that's up to you. You have to write a parser for that markup.

      The second problem is you want to change the look of the text. But where is that text to be displayed? if in a terminal, then Term::ANSIColor (which you already mentioned) would be a good choice. but you said above that this module doesn't help you. you only forget to mention why.

      So what do you actually want? if you want help you need to add more information. text is just text and has no format. if you add terminal escape sequences to it, then in a terminal it can be bold, coloured. displaying terminal escape sequences in a browser or in Tk is of no use, on the other hand.

      See Parse::BBCode (one of my modules) for example. It's a simple markup, and the module parses it, returns a parse tree and renders it to HTML or text or any format you define.
        I said in my original post that it will be outputted into an RTF file (.rtf). So Term::ANSIColor wouldn't work. Even if I was using a terminal, not many useful features are supported in the Windows DOS (which I'm using).
        --perl.j
Re^2: Make a Markup Method in Perl?
by Anonymous Monk on May 17, 2012 at 04:28 UTC

    Technically, neither XML nor SGML "targets a particular rendering engine." In fact, they were both designed with device independence as a primary goal.

    Not that I disagree with your point, I'm just picking nits.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://970738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-20 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found