haghish / markdoc

A literate programming package for Stata which develops dynamic documents, slides, and help files in various formats
http://haghish.com/markdoc
86 stars 30 forks source link

Handling of {cmdab:text:moretext} SMCL tags #4

Closed wbuchanan closed 8 years ago

wbuchanan commented 8 years ago

Currently, it looks like Markdoc doesn't attempt to decorate these tags in a way that would convey the same information to the reader (e.g., showing the minimal number of characters required to reference an optional argument). It might be good/useful/helpful to adopt some type of standard for handling these:

For example, {cmdab:rep:lace} it's a bit difficult to do this with markdown since it seems to want a space token between bold/italic syntax (e.g., can't make part of the word italicized or bolded). But, this could definitely be rendered with HTML replace or replace to prevent information loss.

haghish commented 8 years ago

This feature would be nice. Do you think you could program it and add an option for it (string processing reduces the speed...) ? I encourage you to have a look at 2 code files which are sthlp.ado and markdown.ado. These files are responsible for dealing with Stata help files. We can basically update the code to convert SMCL to HTML or LaTeX.

I could support you anyway I can if you are willing to give your codes a try.

haghish commented 8 years ago

As a guide, MarkDoc converts smcl to text to remove the smcl markup. So any conversion to MarkDown, HTML, or LaTeX, should be carried out before translating the log. This could be a separate engine, as I did it for markdown.ado

wbuchanan commented 8 years ago

Do you have a tokenizer for the SMCL element tags already?

haghish commented 8 years ago

no. It's more of a markdown to smcl translator engine which enables users to document their code in Markdown and export sthlp and smcl (or other formats) from script files. as we discussed in the forum... Because my exportation aim was Stata format, I didn't need to parse smcl