dragonmapper icon indicating copy to clipboard operation
dragonmapper copied to clipboard

HTML Formatting

Open TTWNO-zz opened this issue 8 years ago • 16 comments

Using dragonmapper's APIs get HTML output like this (requires styling, included):

Image 1 Image 2, with FZKai-Extended font

TTWNO-zz avatar May 24 '16 09:05 TTWNO-zz

Sorry for pushing multiple commits to travis-cl.

TTWNO-zz avatar May 24 '16 18:05 TTWNO-zz

@TTWNO This is a neat idea! Thanks for the pull request. I'm at a conference right now, but I'll test/review it as soon as I can. Thanks!

tsroten avatar May 25 '16 18:05 tsroten

Sound good! Happy to help!

TTWNO-zz avatar May 25 '16 20:05 TTWNO-zz

More features have been added. Please wait until I can fully implement them and push.

TTWNO-zz avatar May 27 '16 00:05 TTWNO-zz

Tada!

TTWNO-zz avatar May 27 '16 15:05 TTWNO-zz

("Tada!" means the code is [basically] done... No rush, just sayin')

TTWNO-zz avatar May 31 '16 18:05 TTWNO-zz

(Polite poke)

TTWNO-zz avatar Jun 09 '16 04:06 TTWNO-zz

@TTWNO Looking now :)

tsroten avatar Jun 10 '16 00:06 tsroten

Tada!

TTWNO-zz avatar Jun 10 '16 01:06 TTWNO-zz

The keep_punct varibles is set to false when you want to give different data to the to_html() function, in the form of an array.

zi = ["你", "好"] know_ni_not_hao = ["ㄋㄧˇ", ""]

to_html(zi, right=tone_marks, keep_punct=False)

Will put zhuyin only on the first character.

TTWNO-zz avatar Jun 10 '16 01:06 TTWNO-zz

More useful in this case:

zi = ["我", "說", "「", "你", "好", "」"] know_some_chars = ["wǒ", "", "", "nǐ", "hǎo", ""]

to_html(zi, bottom=know_some_chars, keep_punct=False) No pinyin will be under 說

TTWNO-zz avatar Jun 10 '16 01:06 TTWNO-zz

keep_punct is a bad name for the variable though

TTWNO-zz avatar Jun 10 '16 01:06 TTWNO-zz

That's better!

I completely got rid of keep_punct, and now the function just automatically decides what to do with the input.

TTWNO-zz avatar Jun 13 '16 22:06 TTWNO-zz

Would you like to check the code again?

Any other improvments I should make?

TTWNO-zz avatar Jun 20 '16 03:06 TTWNO-zz

Done some nice overhauling, making it much easier to reference with CSS. What's the status on the merge?

TTWNO-zz avatar Jul 12 '16 17:07 TTWNO-zz

(Polite poke 2)

TTWNO-zz avatar Jul 25 '16 16:07 TTWNO-zz