{"id":11981,"date":"2021-01-08T23:00:18","date_gmt":"2021-01-09T04:00:18","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=11981"},"modified":"2021-01-13T10:52:47","modified_gmt":"2021-01-13T15:52:47","slug":"convert-your-live-scripts-to-markdown-file","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2021\/01\/08\/convert-your-live-scripts-to-markdown-file\/","title":{"rendered":"Convert your live scripts to markdown file"},"content":{"rendered":"<div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = \"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/869871\"><span>Jiro<\/span><\/a><span>'s Pick this week is <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/73993\"><span>Live Script-to-Markdown<\/span><\/a><span> by <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/5397765\"><span>Michio<\/span><\/a><span>, one of my colleagues in MathWorks Japan.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>As you know, File Exchange allows you to have your files hosted on GitHub. Suppose you wrote a nice README documentation, with examples, using a live script. Unfortunately, GitHub does not render and display your live script. You would need to rewrite your readme file as a markdown file.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now, you won't have to rewrite your live scripts. Just use Michio's livescript-to-markdown entry. To be exact, it's actually <\/span><span style=' font-family: monospace;'>latex2markdown<\/span><span>, but live scripts can be easily exported to LaTeX so that's trivial.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>It takes care of all (?) possible formating and components that can be included in a live script, including code, figure outputs, equations, lists, images, etc. Compare for yourself the readme file Michio created for his own entry: <\/span><a href = \"https:\/\/viewer.mathworks.com\/?viewer=live_code&amp;url=https%3A%2F%2Fjp.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2Ff009e5ec-2cf3-4906-b9d1-04ccc04aee43%2F2489d9e4-c32f-42eb-8d4a-8215258f4213%2Ffiles%2Fdoc%2FREADME_EN.mlx&amp;embed=web\"><span>Live Script version<\/span><\/a><span>, <\/span><a href = \"https:\/\/github.com\/minoue-xx\/livescript2markdown\/blob\/master\/doc\/README_EN.md\"><span>Markdown version<\/span><\/a><span>.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here's a snippet of the side-by-side comparison.<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/pick\/files\/potw_livescript2markdown_1-6.png\" width = \"1000\" height = \"547\" alt = \"mlx_md_comparison.png\" style = \"vertical-align: baseline\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>As he says at the end of the readme file, I \"hope it accelerates your MATLAB life!\"<\/span><\/div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Give it a try and let us know what you think <\/span><a href = \"http:\/\/blogs.mathworks.com\/pick\/?p=11981#respond\"><span>here<\/span><\/a><span> or leave a <\/span><a href = \"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/73993#comment\"><span>comment<\/span><\/a><span> for Michio.<\/span><\/div><\/div><script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script><a href=\"https:\/\/blogs.mathworks.com\/pick\/files\/potw_livescript2markdown.mlx\"><button class=\"btn btn-sm btn_color_blue pull-right add_margin_10\">Download Live Script<\/button><\/a>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/pick\/files\/potw_livescript2markdown_1-6.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>Jiro's Pick this week is Live Script-to-Markdown by Michio, one of my colleagues in MathWorks Japan.As you know, File Exchange allows you to have your files hosted on GitHub. Suppose you wrote a nice... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2021\/01\/08\/convert-your-live-scripts-to-markdown-file\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":11999,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11981"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=11981"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11981\/revisions"}],"predecessor-version":[{"id":11987,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11981\/revisions\/11987"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media\/11999"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=11981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=11981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=11981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}