cloutiy / tml

5 stars 0 forks source link

Add way to define special \[characters] #14

Open cloutiy opened 9 years ago

cloutiy commented 9 years ago

Speaking of which, what is the escape character? I've been assuming it's a backslash.

In a similar vein, I've been wondering about special characters, like the copyright symbol. I'm not fond of |co| visually (personal preference, therefore comment safely ignored), but I'm also thinking that knowledgeable groffers will likely want to use groff notation for special characters. What do you think of making the groff notation standard throughout tml? [co] or [bu] for example. The parser's going to have to pass those guys through anyway, so why have two styles of entering special characters?

An advantage to using [...] is that when users want to wrap formatting and text into a single entity, this is the style they'll be using. In groff-speak

.char [TML] \f[B]\s[-1]TML\f[]\s[]

makes [TML] a valid entity, and you can see how useful that is. Mind you, we'll have to come up with a way of creating this in tml. Could be something as simple as

{special-character} TML: <bold, size -1

which would get changed into .char ..., as above. Would also allow grouping, which, given how extensively I use .char, would be a blessing.

cloutiy commented 8 years ago

Actually the same could be achieved by defining user string:

{strings}
@TML = <bold, size -1<TML>

Then whenever @TML is encountered in the text it will be replaced with:

<bold, size -1<TML>

which gets resolved to:

\f[B]\s[-1]TML\f[]\s[]
tml commented 8 years ago

I am SOOO confused right now! ;)

cloutiy commented 8 years ago

haha sorry, didn't realize an @ symbol sends a message to someone. Sorry, not for you.