

{"id":12230,"date":"2019-05-31T10:43:05","date_gmt":"2019-05-31T15:43:05","guid":{"rendered":"https:\/\/rud.is\/b\/?p=12230"},"modified":"2019-06-01T07:23:12","modified_gmt":"2019-06-01T12:23:12","slug":"making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/","title":{"rendered":"Making a Command Line HTML Rendering Script for &#8220;The Art of the Command Line&#8221; (in R)"},"content":{"rendered":"<p>The Feedly category I have setup for git-stalking has indicated a fairly massive interest in Joshua Levy&#8217;s <a href=\"https:\/\/github.com\/jlevy\/the-art-of-command-line\">The Art of the Command Line<\/a>. What is &#8220;The Art of the Command Line&#8221;? To quote the author(s):<\/p>\n<blockquote><p>\n  Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity as an engineer in both obvious and subtle ways. This is a selection of notes and tips on using the command-line that we&#8217;ve found useful when working on Linux. Some tips are elementary, and some are fairly specific, sophisticated, or obscure. This page is not long, but if you can use and recall all the items here, you know a lot.\n<\/p><\/blockquote>\n<p>It&#8217;s a great resource just the way it is (simple, plain markdown rendered in GitUgh). But, we can make it even greater with some help from <code>rmarkdown::render()<\/code> and some content slicing &amp; dicing.<\/p>\n<p>My initial thought was to grab the English version, put an R Markdown YAML header on it, remove some intro cruft and render it to standalone HTML. While that would be quick, easy and useful it&#8217;s also very manual and brittle since updating it would require copy and paste; plus, it leaves out the translated versions.<\/p>\n<p>So, goal number uno became &#8220;make a function to do this&#8221;. Then, I realized <em>&#8220;Hey! This is a resource for command line stuff so why not turn the function into a command line tool!&#8221;<\/em>. So this became goal number II. <span style='font-size:8pt'>(I have an internal posit that R adoption would be much higher if there were more easy-to-install command line utilities built in R since that&#8217;s one reason Python has a larger install base and many folks end up just using the command line versions of modules they install. CRAN&#8217;s draconian rules on what you can do during a package install makes this somewhat moot, tho. One could argue that CRAN is doing the right thing and that Python\/PyPI are woefully insecure-by-default which is also true.)<\/span><\/p>\n<h3>Goal Uno<\/h3>\n<p>Since we&#8217;re going to create a function it also makes sense to parameterize options for the language, doc-theme and highlight-theme.<\/p>\n<p>The setup plan for this is endeavour is pretty straightforward:<\/p>\n<ul>\n<li>fetch the current set of translations available<\/li>\n<li>check to make sure the desired translation is in ^^ set<\/li>\n<li>grab a copy of the specified document<\/li>\n<li>get the title (since that&#8217;s translated for each)<\/li>\n<li>remove some unnecessary front-matter<\/li>\n<li>turn the <code>AUTHORS.md<\/code> link into a proper link (vs relative)<\/li>\n<li>add in the YAML header with the desired customizations<\/li>\n<li>render the document to standalone HTML<\/li>\n<li>optionally open it after render<\/li>\n<\/ul>\n<p>And, this is what that looks like:<\/p>\n<pre><code class=\"language-r\">taotcl &lt;- function(language = \"\", theme = \"simplex\", highlight = \"espresso\", output_dir = getwd(), open = TRUE) {\n\n  language &lt;- language[1]\n\n  # find translations\n\n  httr::GET(\n    url = \"https:\/\/api.github.com\/repos\/jlevy\/the-art-of-command-line\/contents\/\",\n    httr::add_headers(\n      `Accept` = \"application\/vnd.github.v3+json\"\n    ),\n    httr::user_agent(\"taotcl R script; @hrbrmstr\")\n  ) -&gt; res\n\n  httr::stop_for_status(res)\n\n  ls &lt;- httr::content(res, as = \"parsed\")\n\n  readmes &lt;- Filter(function(.x) grepl(\"^README\", .x), vapply(ls, `[[`, character(1), \"name\"))\n  langs &lt;- regmatches(readmes, regexpr(\"-[-[:alpha:]]+\", readmes))\n\n  # check to make sure a valid one was specified\n\n  if (language != \"\") { # \"\" =&gt; English\n    language &lt;- sprintf(\"-%s\", language)\n    if (!(language %in% langs)) {\n      stop(\n        \"Language '\", sub(\"^-\", \"\", language), \n        \"' not found in repo. Current translations include: \",\n        paste0(sprintf(\"'%s'\", sub(\"^-\", \"\", langs)), collapse = \", \"),\n        \".\", call.=FALSE\n      )\n    }\n  }\n\n  # get the desired doc\n\n  src &lt;- \"https:\/\/raw.githubusercontent.com\/jlevy\/the-art-of-command-line\/master\/README{language}.md\"\n  src &lt;- glue::glue(src)\n\n  l &lt;- readLines(src)\n\n  # find the title\n  title &lt;- sub(\"^#[[:space:]]*\", \"\", l[which(grepl(\"^#[[:space:]]*\", l))[1]])\n\n  # figure out the cut line\n  cowsay &lt;- which(grepl(\"cowsay\", l))[1]\n\n  l &lt;- l[-(1:(cowsay+1))] # cut\n\n  # make the AUTHORS.md a useful link\n  l &lt;- gsub(\"(AUTHORS.md)\", \"(https:\/\/github.com\/jlevy\/the-art-of-command-line\/blob\/master\/AUTHORS.md)\", l, fixed = TRUE)\n\n  theme &lt;- theme[1]\n  highlight &lt;- highlight[1]\n\n'---\ntitle: \"{title}\"\nauthor: \"Joshua Levy\"\nemail: \"joshua@cal.berkeley.edu\"\noutput: \n  html_document:\n    theme: {theme}\n    highlight: {highlight}\n    toc: true\n    toc_float: true\n    toc_depth: 2\n---\n\n' -&gt; yaml\n\n  # fill in the YAML\n  yaml &lt;- glue::glue(yaml)\n\n  tf &lt;- tempfile(fileext = \".Rmd\")\n  on.exit(unlink(tf), add = TRUE)\n  writeLines(c(yaml, l), tf)\n\n  # render the doc\n  rmarkdown::render(\n    input = tf,\n    output_file = sprintf(\"%s.html\", tolower(gsub(\" \", \"-\", title))),\n    output_dir = output_dir[1],\n    quiet = TRUE\n  ) -&gt; loc\n\n  # open in browser\n  if (open[1]) browseURL(loc)\n\n  message(\"Rendered version is at '\", loc, \"'\")\n\n}\n<\/code><\/pre>\n<p>Running it with the defaults will have it look like this:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12232\" data-permalink=\"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/render\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?fit=1244%2C847&amp;ssl=1\" data-orig-size=\"1244,847\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"render\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?fit=510%2C347&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=510%2C347&#038;ssl=1\" alt=\"\" width=\"510\" height=\"347\" class=\"aligncenter size-large wp-image-12232\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=530%2C361&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=150%2C102&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=300%2C204&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=768%2C523&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=500%2C340&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=1200%2C817&amp;ssl=1 1200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=400%2C272&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=800%2C545&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?resize=200%2C136&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?w=1244&amp;ssl=1 1244w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>You don&#8217;t have to type it all as that function is in the <code>taotcl.R<\/code> script over at <a href=\"https:\/\/git.rud.is\/hrbrmstr\/taotcl\">my gitea<\/a> \/ <a href=\"https:\/\/git.sr.ht\/~hrbrmstr\/taotcl\">sourcehut<\/a> \/ <a href=\"https:\/\/gitlab.com\/hrbrmstr\/taotcl\/\">gitlab<\/a> \/ <a href=\"https:\/\/github.com\/hrbrmstr\/taotcl\/\">gitugh<\/a><\/p>\n<h3>Goal II<\/h3>\n<p>Now that we have a function we can call from R we just need a wrapper around it. I kinda like way David Shih put together his <a href=\"https:\/\/bitbucket.org\/djhshih\/argparser\/src\"><code>{argparser}<\/code> package<\/a> (it&#8217;s on CRAN) so we&#8217;ll make a wrapper for our rendering function with it.<\/p>\n<p>We have pretty much the same goal list as the function in that we want to let users specify customizations. There are some additional ones as well (this is not an exhaustive list but it was &#8220;just enough&#8221; for this go):<\/p>\n<ol>\n<li>Make it easy for folks on real operating systems to use it without the need to use <code>Rscript<\/code><\/li>\n<li>Let folks know what required packages they need to install if any are missing<\/li>\n<li>Be quiet when loading packages<\/li>\n<li>Assume friendly\/useful defaults<\/li>\n<li>Provide long and short parameters (some folks like short, some like long)<\/li>\n<\/ol>\n<p>The first few lines of the finished script will accomplish #1-3:<\/p>\n<pre><code class=\"language-r\">#!\/usr\/bin\/env Rscript\n\nneeded &lt;- c(\"magrittr\", \"argparser\", \"httr\", \"glue\", \"rmarkdown\")\ninstalled &lt;- rownames(installed.packages())\nmissing &lt;- needed[!(needed %in% installed)]\n\nif (length(missing)) stop(\"Please install the following packages: \", paste0(sprintf(\"'%s'\", missing), collapse = \", \"), call.=FALSE)\n\nsuppressPackageStartupMessages({\n  for (pkg in needed) {\n    require(package = pkg, quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)\n  }\n})\n<\/code><\/pre>\n<p>Line 1 is a <a href=\"https:\/\/www.in-ulm.de\/~mascheck\/various\/shebang\/\">&#8220;hashbang&#8221;\/&#8221;shebang&#8221;<\/a> and &#8212; provided the file has the execute bit set &#8212; will let folks on *nix\/macOS run the file without deliberately invoking <code>Rscript<\/code>. The rest just do the package checks and loads.<\/p>\n<p>We need a way to get command line parameters in, hence the use of <code>{argparser}<\/code>. We&#8217;ll create an <code>arg_parser<\/code> object and then add arguments using the <code>{magrittr}<\/code> pipe (<code>%&gt;%<\/code>). You can add long\/short argument names as well as help and defaults (plus note whether an argument is a flag\/toggle). Once we have those setup, we tell <code>{argparser}<\/code> to process any arguments provided by the user:<\/p>\n<pre><code class=\"language-r\">arg_parser(\n  description = \"Render 'The Art of the Command Line' to HTML\"\n) %&gt;% \n  add_argument(\n    arg = \"--language\",\n    help = 'Language to render. Leave unspecified for English. Current known: \"cs\", \"de\", \"el\", \"es\", \"fr\", \"id\", \"it\", \"ja\", \"ko\", \"pt\", \"ro\", \"ru\", \"sl\", \"uk\", \"zh-Hant\", \"zh\"',\n    type = \"character\",\n    short = \"-l\",\n    default = \"\"\n  ) %&gt;% \n  add_argument(\n    arg = \"--theme\",\n    help = \"Which R Markdown document theme to use. Ref: https:\/\/l.rud.is\/2JOibrZ\",\n    type = \"character\",\n    short = \"-t\",\n    default = \"simplex\"\n  ) %&gt;% \n  add_argument(\n    arg = \"--highlight\",\n    help = \"Which R Markdown code higlight theme to use. Ref: https:\/\/l.rud.is\/2JOibrZ\",\n    type = \"character\",\n    short = \"-c\",\n    default = \"espresso\"\n  ) %&gt;% \n  add_argument(\n    arg = \"--output-dir\",\n    help = \"Where to store the rendered file. Defaults to current working directory.\",\n    type = \"character\",\n    short = \"-o\",\n    default = getwd()\n  ) %&gt;% \n  add_argument(\n    arg = \"--just-render\",\n    help = \"Only render the document. Do not open in the system default browser. (Default is to render and open.)\",\n    short = \"-j\",\n    flag = TRUE\n  ) -&gt; parser\n\nopts &lt;- argparser::parse_args(parser)\n<\/code><\/pre>\n<p>Once we have those (the <code>taotcl()<\/code> function would come next in the source) then it&#8217;s just a matter of calling the function:<\/p>\n<pre><code class=\"language-r\">taotcl(\n  language = opts$language,\n  theme = opts$theme,\n  highlight = opts$highlight,\n  output_dir = opts$output_dir,\n  open = is.na(opts$just_render) | (!opts$just_render)\n)\n<\/code><\/pre>\n<p>If the command line program we&#8217;ve just made is called with a <code>-h<\/code> or <code>--help<\/code> the user will get:<\/p>\n<pre><code class=\"language-bash\">usage: .\/taotcl.R [--help] [--just-render] [--opts OPTS] [--language LANGUAGE] [--theme THEME] [--highlight HIGHLIGHT] [--output-dir OUTPUT-DIR]\n\nor (on Windows): Rscript taotcl.R [--help] [--just-render] [--opts OPTS] [--language LANGUAGE] [--theme THEME] [--highlight HIGHLIGHT] [--output-dir OUTPUT-DIR]\n\nRender 'The Art of the Command Line' to HTML\n\n\nflags:\n  -h, --help                    show this help message and exit\n  -j, --just-render             Only render the document. Do not open in the system default browser. \n                                (Default is to render and open.)\n\noptional arguments:\n  -x, --opts OPTS               RDS file containing argument values\n  -l, --language LANGUAGE       Language to render. Leave unspecified for English. \n                                Current known: \"cs\", \"de\", \"el\", \"es\", \"fr\", \"id\", \"it\", \"ja\", \n                                \"ko\", \"pt\", \"ro\", \"ru\", \"sl\", \"uk\", \"zh-Hant\", \"zh\" [default: ]\n  -t, --theme THEME             Which R Markdown document theme to use. Ref: https:\/\/l.rud.is\/2JOibrZ [default: simplex]\n  -c, --highlight HIGHLIGHT     Which R Markdown code higlight theme to use. Ref: https:\/\/l.rud.is\/2JOibrZ [default: espresso]\n  -o, --output-dir OUTPUT-DIR   Where to store the rendered file. Defaults to current working directory. \n                                [default: \/your\/current\/directory\/here]\n<\/code><\/pre>\n<p>If we run it with, say, <code>.\/taotcl.R --language ru -o \/tmp<\/code> the script will process the correct language version and render it to <code>\/tmp\/\u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u043e-\u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439-\u0441\u0442\u0440\u043e\u043a\u0438.html<\/code> plus auto-open it for us. It should look like:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12237\" data-permalink=\"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/render-ru\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?fit=1179%2C627&amp;ssl=1\" data-orig-size=\"1179,627\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"render-ru\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?fit=510%2C271&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=510%2C271&#038;ssl=1\" alt=\"\" width=\"510\" height=\"271\" class=\"aligncenter size-large wp-image-12237\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=530%2C282&amp;ssl=1 530w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=150%2C80&amp;ssl=1 150w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=300%2C160&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=768%2C408&amp;ssl=1 768w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=500%2C266&amp;ssl=1 500w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=400%2C213&amp;ssl=1 400w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=800%2C425&amp;ssl=1 800w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?resize=200%2C106&amp;ssl=1 200w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?w=1179&amp;ssl=1 1179w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-ru.png?w=1020&amp;ssl=1 1020w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<h3>FIN<\/h3>\n<p>As noted, you can find the entire script over at <a href=\"https:\/\/git.rud.is\/hrbrmstr\/taotcl\">my gitea<\/a> \/ <a href=\"https:\/\/git.sr.ht\/~hrbrmstr\/taotcl\">sourcehut<\/a> \/ <a href=\"https:\/\/gitlab.com\/hrbrmstr\/taotcl\/\">gitlab<\/a> \/ <a href=\"https:\/\/github.com\/hrbrmstr\/taotcl\/\">gitugh<\/a>. It&#8217;ll eventually get over to <strike>GitLab &amp; GitUgh<\/strike> (and a few others as I&#8217;m expanding the scripts I use to support social coding diversity vs hegemony) as well.<\/p>\n<p>Note that you can leave off the <code>.R<\/code> and the hashbang will still work just fine so it&#8217;ll be even more straightforward to use.<\/p>\n<p><strike>If you don&#8217;t want to go through all this and just want standalone rendered versions of the resource just drop a note in comments and I&#8217;ll toss up a small Shiny app which will let you specify params and get a rendered version.<\/strike> You can find weekly renders of all translations at <a href=\"https:\/\/rud.is\/taotcl\/\">https:\/\/rud.is\/taotcl\/<\/a>.<\/p>\n<p>Finally, <code>r-lib<\/code> has some handy <a href=\"https:\/\/github.com\/r-lib?utf8=%E2%9C%93&amp;q=cli&amp;type=&amp;language=\">packages to make R-built command line utilities much, much cooler<\/a> (which is a minor suggestion that PRs are welcome if you want to add some flavor to this fairly vanilla utility).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Feedly category I have setup for git-stalking has indicated a fairly massive interest in Joshua Levy&#8217;s The Art of the Command Line. What is &#8220;The Art of the Command Line&#8221;? To quote the author(s): Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[91],"tags":[],"class_list":["post-12230","post","type-post","status-publish","format-standard","hentry","category-r"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Making a Command Line HTML Rendering Script for &quot;The Art of the Command Line&quot; (in R) - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Making a Command Line HTML Rendering Script for &quot;The Art of the Command Line&quot; (in R) - rud.is\" \/>\n<meta property=\"og:description\" content=\"The Feedly category I have setup for git-stalking has indicated a fairly massive interest in Joshua Levy&#8217;s The Art of the Command Line. What is &#8220;The Art of the Command Line&#8221;? To quote the author(s): Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-31T15:43:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-01T12:23:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-530x361.png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Making a Command Line HTML Rendering Script for &#8220;The Art of the Command Line&#8221; (in R)\",\"datePublished\":\"2019-05-31T15:43:05+00:00\",\"dateModified\":\"2019-06-01T12:23:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/\"},\"wordCount\":972,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/render-530x361.png\",\"articleSection\":[\"R\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/\",\"name\":\"Making a Command Line HTML Rendering Script for \\\"The Art of the Command Line\\\" (in R) - rud.is\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/render-530x361.png\",\"datePublished\":\"2019-05-31T15:43:05+00:00\",\"dateModified\":\"2019-06-01T12:23:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/render.png?fit=1244%2C847&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2019\\\/05\\\/render.png?fit=1244%2C847&ssl=1\",\"width\":1244,\"height\":847},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/2019\\\/05\\\/31\\\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rud.is\\\/b\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Making a Command Line HTML Rendering Script for &#8220;The Art of the Command Line&#8221; (in R)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#website\",\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rud.is\\\/b\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rud.is\\\/b\\\/#\\\/schema\\\/person\\\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/rud.is\\\/b\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\\\/\\\/rud.is\"],\"url\":\"https:\\\/\\\/rud.is\\\/b\\\/author\\\/hrbrmstr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Making a Command Line HTML Rendering Script for \"The Art of the Command Line\" (in R) - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/","og_locale":"en_US","og_type":"article","og_title":"Making a Command Line HTML Rendering Script for \"The Art of the Command Line\" (in R) - rud.is","og_description":"The Feedly category I have setup for git-stalking has indicated a fairly massive interest in Joshua Levy&#8217;s The Art of the Command Line. What is &#8220;The Art of the Command Line&#8221;? To quote the author(s): Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity [&hellip;]","og_url":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/","og_site_name":"rud.is","article_published_time":"2019-05-31T15:43:05+00:00","article_modified_time":"2019-06-01T12:23:12+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-530x361.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Making a Command Line HTML Rendering Script for &#8220;The Art of the Command Line&#8221; (in R)","datePublished":"2019-05-31T15:43:05+00:00","dateModified":"2019-06-01T12:23:12+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/"},"wordCount":972,"commentCount":3,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-530x361.png","articleSection":["R"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/","url":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/","name":"Making a Command Line HTML Rendering Script for \"The Art of the Command Line\" (in R) - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render-530x361.png","datePublished":"2019-05-31T15:43:05+00:00","dateModified":"2019-06-01T12:23:12+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?fit=1244%2C847&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2019\/05\/render.png?fit=1244%2C847&ssl=1","width":1244,"height":847},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2019\/05\/31\/making-a-command-line-html-rendering-script-for-the-art-of-the-command-line-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Making a Command Line HTML Rendering Script for &#8220;The Art of the Command Line&#8221; (in R)"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-3bg","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3919,"url":"https:\/\/rud.is\/b\/2016\/02\/10\/craft-httr-calls-cleverly-with-curlconverter\/","url_meta":{"origin":12230,"position":0},"title":"Craft httr calls cleverly with curlconverter","author":"hrbrmstr","date":"2016-02-10","format":false,"excerpt":"UPDATE curlconverter will now return (as the function return value) a working R function. See the README for examples When you visit a site like the LA Times' NH Primary Live Results site and wish you had the data that they used to make the tables & visualizations on the\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":18597,"url":"https:\/\/rud.is\/b\/2024\/03\/23\/get-a-days-schedule-from-fantastical-on-the-command-line-with-shortcuts\/","url_meta":{"origin":12230,"position":1},"title":"Get A Day&#8217;s Schedule From Fantastical On The Command Line With Shortcuts","author":"hrbrmstr","date":"2024-03-23","format":false,"excerpt":"I use Fantastical as it's a much cleaner and native interface than Google Calendar, which I'm stuck using. I do like to use the command line more than GUIs and, while I have other things set up to work with Google Calendar from the CLI, I've always wanted to figure\u2026","rel":"","context":"In &quot;macOS&quot;","block_context":{"text":"macOS","link":"https:\/\/rud.is\/b\/category\/macos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2024\/03\/Shortcuts.png?fit=1200%2C600&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":11427,"url":"https:\/\/rud.is\/b\/2018\/08\/24\/friday-rstats-twofer-finding-macos-32-bit-apps-processing-data-from-system-commands\/","url_meta":{"origin":12230,"position":2},"title":"Friday #rstats twofer: Finding macOS 32-bit apps &#038; Processing Data from System Commands","author":"hrbrmstr","date":"2018-08-24","format":false,"excerpt":"Apple has run the death bell on 32-bit macOS apps and, if you're running a recent macOS version on your Mac (which you should so you can get security updates) you likely see this alert from time-to-time: If you're like me, you click through that and keep working but later\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2018\/08\/Screen-Shot-2018-08-24-at-4.58.41-AM.png?fit=1200%2C612&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":12645,"url":"https:\/\/rud.is\/b\/2020\/02\/06\/prying-r-script-files-away-from-xcode-et-al-on-macos\/","url_meta":{"origin":12230,"position":3},"title":"Prying &#8220;.R&#8221; Script Files Away from Xcode (et al) on macOS","author":"hrbrmstr","date":"2020-02-06","format":false,"excerpt":"As the maintainer of RSwitch --- and developer of my own (for personal use) macOS, iOS, watchOS, iPadOS and tvOS apps --- I need the full Apple Xcode install around (more R-focused macOS folk can get away with just the command-line tools being installed). As an Apple Developer who insanely\u2026","rel":"","context":"In &quot;macOS&quot;","block_context":{"text":"macOS","link":"https:\/\/rud.is\/b\/category\/macos\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7051,"url":"https:\/\/rud.is\/b\/2017\/11\/11\/measuring-monitoring-internet-speed-with-r\/","url_meta":{"origin":12230,"position":4},"title":"Measuring &#038; Monitoring Internet Speed with R","author":"hrbrmstr","date":"2017-11-11","format":false,"excerpt":"Working remotely has many benefits, but if you work remotely in an area like, say, rural Maine, one of those benefits is not massively speedy internet connections. Being able to go fast and furious on the internet is one of the many things I miss about our time in Seattle\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/rud.is\/b\/category\/r\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/spdtst.gif?fit=1200%2C647&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/spdtst.gif?fit=1200%2C647&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/spdtst.gif?fit=1200%2C647&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/spdtst.gif?fit=1200%2C647&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2017\/11\/spdtst.gif?fit=1200%2C647&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":12990,"url":"https:\/\/rud.is\/b\/2021\/03\/13\/retrieve-process-run-time-architecture-on-apple-silicon-macs-on-the-command-line-with-archinfo\/","url_meta":{"origin":12230,"position":5},"title":"Retrieve Process Run-time Architecture on Apple Silicon Macs On The Command Line with `archinfo`","author":"hrbrmstr","date":"2021-03-13","format":false,"excerpt":"Apple M1\/Apple Silicon\/arm64 macOS can run x86_64 programs via Rosetta and most M1 systems currently (~March 2021) very likely run a mix of x86_64 and arm64 processes. Activity Monitor can show the architecture: but command line tools such as ps and top do not due to Apple hiding the details\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/rud.is\/b\/category\/apple\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=12230"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/12230\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=12230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=12230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=12230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}