mmarkdown / mmark

Mmark: a powerful markdown processor in Go geared towards the IETF
https://mmark.miek.nl
Other
480 stars 45 forks source link

Hardcoded English phrases #85

Closed 747 closed 5 years ago

747 commented 5 years ago

What went wrong?

It's very helpful to have footnotes, index, and bibliography to use, but current HTML output automatically places an English header to each section and there seems no option to change via the binary. https://github.com/mmarkdown/mmark/blob/a988fb2d22d173d904c84078b21ad03d8f725667/render/mhtml/hook.go#L24 https://github.com/mmarkdown/mmark/blob/a988fb2d22d173d904c84078b21ad03d8f725667/render/mhtml/hook.go#L30 https://github.com/mmarkdown/mmark/blob/a988fb2d22d173d904c84078b21ad03d8f725667/render/mhtml/hook.go#L47 While you're unlikely to use other than English when you write an RFC, HTML (and perhaps XML) could be written in many other languages, plus there would be various local conventions or personal tastes people would need, so auto-inserting fixed natural language phrases doesn't seem to be a good idea. Of course you can replace them after conversion, but why don't have an option or parameter to config?

What version of mmark are you using?

2.0.46

miekg commented 5 years ago

[ Quoting notifications@github.com in "[mmarkdown/mmark] Hardcoded English..." ]

What went wrong?

It's very helpful to have footnotes, index, and bibliography to use, but current HTML output automatically places an English header to each section and there seems no option to change via the binary. https://github.com/mmarkdown/mmark/blob/a988fb2d22d173d904c84078b21ad03d8f725667/render/mhtml/hook.go#L24 https://github.com/mmarkdown/mmark/blob/a988fb2d22d173d904c84078b21ad03d8f725667/render/mhtml/hook.go#L30 https://github.com/mmarkdown/mmark/blob/a988fb2d22d173d904c84078b21ad03d8f725667/render/mhtml/hook.go#L47 While you're unlikely to use other than English when you write an RFC, HTML (and perhaps XML) could be written in many other languages, plus there would be various local conventions or personal tastes people would need, so auto-inserting fixed natural language phrases doesn't seem to be a good idea. Of course you can replace them after conversion, but why don't have an option or parameter to config?

Yep, true. I don't know of a Go package that helps with dealing with this though, or should it be options in the title block?

747 commented 5 years ago

Yep, true. I don't know of a Go package that helps with dealing with this though, or should it be options in the title block?

If you prefer systematic approach (locale based), go-i18n is for use, but I'm not sure if you feel it overkill. Is it easy or suitable to turn them into command line option(s) or a config file? If not much, title block options will be okay for me.

miekg commented 5 years ago

[ Quoting notifications@github.com in "Re: [mmarkdown/mmark] Hardcoded Eng..." ]

Yep, true. I don't know of a Go package that helps with dealing with this though, or should it be options in the title block?

If you prefer systematic approach (language based), go-i18n is to use, but I'm not sure if you feel it overkill. Is it easy or suitable to turn them into command line option(s) or a config file? If not much, title block options will be okay for me.

I gave a some thought, and I believe the entire document should be contained in the document, so adding this to the title block make sense.

Just have to figure out some names for this.

miekg commented 5 years ago

both pandoc and asciidoc use a language tag in the document metadata that then gives you the correct translation; that seems easiest, but it requires a list from language -> names used. I'll compile this in for the time being.

miekg commented 5 years ago

See https://github.com/mmarkdown/mmark/pull/86 for a fix.

Need more languages though; what do you propose to add