Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triple left tick/quote highlight #53

Closed
adamrossnelson opened this issue Nov 18, 2017 · 1 comment
Closed

Triple left tick/quote highlight #53

adamrossnelson opened this issue Nov 18, 2017 · 1 comment

Comments

@adamrossnelson
Copy link

Originally discussed

https://www.reddit.com/r/stata/comments/79l8ge/what_color_scheme_do_you_use_in_stata/

1 // Make data data dictionary in markdown file.
2 log using asca_data_dictionary.md, replace text name(data_dictionary)
3 noi di "```"
4  - - -  do some other output - - - 
5 noi di "```"
6 log close data_dictionary

Line 3, which is intended to place github flavor codeblock markdown, interrupts the syntax highlighting. Stata's editor highlights this just fine.

Workaround

// Establish a macro to contain the triple quote mark.
local opclmd char(96) char(96) char(96)
// Make data data dictionary in markdown file.
log using asca_data_dictionary.md, replace text name(data_dictionary)
di `opclmd'
 - - - or do other code - - - 
codebook
 - - - finish other code - - -
di `opclmd'
log close data_dictionary

More on this use case

Demonstration of using stata log file feature for purposes of automated generation of markdown documents:

https://github.com/adamrossnelson/StataQuickReference/blob/master/md_demo.do (do file)
https://github.com/adamrossnelson/StataQuickReference/blob/master/wkspc/md_demo.md (output)

@kylebarron kylebarron mentioned this issue Nov 19, 2017
@kylebarron
Copy link
Owner

This will support di "```" and di "``` stata" but there can be no ' characters in the string. Inline code, i.e. ... is not supported, and may never be supported because it would be hard to know that there shouldn't just be an inner macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants