diff --git a/CHANGELOG.md b/CHANGELOG.md index beca69f..34603e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,14 +48,18 @@ All notable changes to the "rmarkdown" extension will be documented in this file - Blogdown: Default author setting -## 0.0.8 - 2020-04-16 +## 0.0.8 - 2020-04-15 ### Added - 'Bookdown: Serve Book' command -## 0.0.9 - 2020-04-17 +## 0.0.9 - 2020-04-16 ### Added -- Table formatter \ No newline at end of file +- Table formatter + +## 0.0.12 2020-04-18 + +Fixed bugs. \ No newline at end of file diff --git a/README.md b/README.md index bc5238d..0405ab0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,17 @@ # R Markdown All-in-One for VS Code +### NOTE: This extension has only been tested on Mac. It has been reported to fail on Windows/Linux + This extension provides a few snippets and key bindings for common tasks in `.Rmd` documents, such as inserting code chunks and including images using `knitr::include_graphics()`. Additionally, it aims to provide some helper functions for Bookdown and Blogdown. +This project is at its very early stage of development. Contributions are welcome! + # Table of Contents - [R Markdown All-in-One for VS Code](#r-markdown-all-in-one-for-vs-code) + - [NOTE: This extension has only been tested on Mac. It has been reported to fail on Windows/Linux](#note-this-extension-has-only-been-tested-on-mac-it-has-been-reported-to-fail-on-windowslinux) - [Table of Contents](#table-of-contents) - [Video Demos](#video-demos) - [Code Chunk](#code-chunk) diff --git a/a.json b/a.json deleted file mode 100644 index fe88898..0000000 --- a/a.json +++ /dev/null @@ -1,1471 +0,0 @@ -{ - "blocks": [ - { "t": "Header", "c": [1, ["r-markdown-all-in-one-for-vs-code", [], []], [{ "t": "Str", "c": "R" }, { "t": "Space" }, { "t": "Str", "c": "Markdown" }, { "t": "Space" }, { "t": "Str", "c": "All-in-One" }, { "t": "Space" }, { "t": "Str", "c": "for" }, { "t": "Space" }, { "t": "Str", "c": "VS" }, { "t": "Space" }, { "t": "Str", "c": "Code" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "This" }, - { "t": "Space" }, - { "t": "Str", "c": "extension" }, - { "t": "Space" }, - { "t": "Str", "c": "provides" }, - { "t": "Space" }, - { "t": "Str", "c": "a" }, - { "t": "Space" }, - { "t": "Str", "c": "few" }, - { "t": "Space" }, - { "t": "Str", "c": "snippets" }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Str", "c": "key" }, - { "t": "Space" }, - { "t": "Str", "c": "bindings" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Str", "c": "common" }, - { "t": "Space" }, - { "t": "Str", "c": "tasks" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], ".Rmd"] }, - { "t": "Space" }, - { "t": "Str", "c": "documents," }, - { "t": "Space" }, - { "t": "Str", "c": "such" }, - { "t": "Space" }, - { "t": "Str", "c": "as" }, - { "t": "Space" }, - { "t": "Str", "c": "inserting" }, - { "t": "Space" }, - { "t": "Str", "c": "code" }, - { "t": "Space" }, - { "t": "Str", "c": "chunks" }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Str", "c": "including" }, - { "t": "Space" }, - { "t": "Str", "c": "images" }, - { "t": "Space" }, - { "t": "Str", "c": "using" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "knitr::include_graphics()"] }, - { "t": "Str", "c": "." } - ] - }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "Additionally," }, - { "t": "Space" }, - { "t": "Str", "c": "it" }, - { "t": "Space" }, - { "t": "Str", "c": "aims" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "provide" }, - { "t": "Space" }, - { "t": "Str", "c": "some" }, - { "t": "Space" }, - { "t": "Str", "c": "helper" }, - { "t": "Space" }, - { "t": "Str", "c": "functions" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Str", "c": "Bookdown" }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Str", "c": "Blogdown." } - ] - }, - { "t": "Header", "c": [1, ["table-of-contents", [], []], [{ "t": "Str", "c": "Table" }, { "t": "Space" }, { "t": "Str", "c": "of" }, { "t": "Space" }, { "t": "Str", "c": "Contents" }]] }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "R" }, { "t": "Space" }, { "t": "Str", "c": "Markdown" }, { "t": "Space" }, { "t": "Str", "c": "All-in-One" }, { "t": "Space" }, { "t": "Str", "c": "for" }, { "t": "Space" }, { "t": "Str", "c": "VS" }, { "t": "Space" }, { "t": "Str", "c": "Code" }], - ["#r-markdown-all-in-one-for-vs-code", ""] - ] - } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Table" }, { "t": "Space" }, { "t": "Str", "c": "of" }, { "t": "Space" }, { "t": "Str", "c": "Contents" }], - ["#table-of-contents", ""] - ] - } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Video" }, { "t": "Space" }, { "t": "Str", "c": "Demos" }], - ["#video-demos", ""] - ] - } - ] - }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Code" }, { "t": "Space" }, { "t": "Str", "c": "Chunk" }], - ["#code-chunk", ""] - ] - } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Include" }, { "t": "Space" }, { "t": "Str", "c": "Graphics" }], - ["#include-graphics", ""] - ] - } - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "Knitting" }], ["#knitting", ""]] }] }] - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "RMarkdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#rmarkdown-specific-features", ""] - ] - } - ] - }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Keyboard" }, { "t": "Space" }, { "t": "Str", "c": "Shortcuts:" }], - ["#keyboard-shortcuts", ""] - ] - } - ] - } - ], - [ - { "t": "Plain", "c": [{ "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "Snippets" }], ["#snippets", ""]] }] }, - { "t": "BulletList", "c": [[{ "t": "Plain", "c": [{ "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "Cross-referencing" }], ["#cross-referencing", ""]] }] }], [{ "t": "Plain", "c": [{ "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "Chunks" }], ["#chunks", ""]] }] }]] } - ] - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Bookdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#bookdown-specific-features", ""] - ] - } - ] - }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Serve" }, { "t": "Space" }, { "t": "Str", "c": "Book" }], - ["#serve-book", ""] - ] - } - ] - } - ] - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Blogdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#blogdown-specific-features", ""] - ] - } - ] - }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "New" }, { "t": "Space" }, { "t": "Str", "c": "Post" }], - ["#new-post", ""] - ] - } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Serve" }, { "t": "Space" }, { "t": "Str", "c": "Site" }], - ["#serve-site", ""] - ] - } - ] - } - ] - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Other" }, { "t": "Space" }, { "t": "Str", "c": "Markdown" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#other-markdown-features", ""] - ] - } - ] - }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Syntax" }, { "t": "Space" }, { "t": "Str", "c": "Highlighting" }], - ["#syntax-highlighting", ""] - ] - } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Keyboard" }, { "t": "Space" }, { "t": "Str", "c": "Shortcuts" }], - ["#keyboard-shortcuts-1", ""] - ] - } - ] - } - ] - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "TODO" }], ["#todo", ""]] }] }], - [ - { - "t": "Plain", - "c": [ - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Change" }, { "t": "Space" }, { "t": "Str", "c": "Log" }], - ["#change-log", ""] - ] - } - ] - } - ] - ] - }, - { "t": "Header", "c": [1, ["video-demos", [], []], [{ "t": "Str", "c": "Video" }, { "t": "Space" }, { "t": "Str", "c": "Demos" }]] }, - { - "t": "Para", - "c": [ - { - "t": "Emph", - "c": [ - { "t": "Str", "c": "If" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "prefer" }, - { "t": "Space" }, - { "t": "Str", "c": "reading" }, - { "t": "Space" }, - { "t": "Str", "c": "text," }, - { "t": "Space" }, - { "t": "Str", "c": "jump" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "RMarkdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#user-content-rmarkdown-specific-features", ""] - ] - }, - { "t": "Str", "c": "," }, - { "t": "Space" }, - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Blogdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#blogdown-specific-features", ""] - ] - }, - { "t": "Str", "c": "," }, - { "t": "Space" }, - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Bookdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#bookdown-specific-features", ""] - ] - }, - { "t": "Str", "c": "," }, - { "t": "Space" }, - { "t": "Str", "c": "or" }, - { "t": "Space" }, - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "Other" }, { "t": "Space" }, { "t": "Str", "c": "Markdown" }, { "t": "Space" }, { "t": "Str", "c": "Features" }], - ["#other-markdown-features", ""] - ] - }, - { "t": "Str", "c": "." } - ] - } - ] - }, - { "t": "Header", "c": [2, ["code-chunk", [], []], [{ "t": "Str", "c": "Code" }, { "t": "Space" }, { "t": "Str", "c": "Chunk" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "As" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "would" }, - { "t": "Space" }, - { "t": "Str", "c": "do" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "RStudio," }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "can" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Ctrl/Cmd+Alt+I"] }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "insert" }, - { "t": "Space" }, - { "t": "Str", "c": "a" }, - { "t": "Space" }, - { "t": "Str", "c": "code" }, - { "t": "Space" }, - { "t": "Str", "c": "chunk" }, - { "t": "Space" }, - { "t": "Str", "c": "(alternatively," }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "can" }, - { "t": "Space" }, - { "t": "Str", "c": "write" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\code"] }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "trigger" }, - { "t": "Space" }, - { "t": "Str", "c": "this" }, - { "t": "Space" }, - { "t": "Str", "c": "snippet)." }, - { "t": "Space" }, - { "t": "Str", "c": "The" }, - { "t": "Space" }, - { "t": "Str", "c": "language" }, - { "t": "Space" }, - { "t": "Str", "c": "defaults" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "R," }, - { "t": "Space" }, - { "t": "Str", "c": "but" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "can" }, - { "t": "Space" }, - { "t": "Str", "c": "also" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "many" }, { "t": "Space" }, { "t": "Str", "c": "other" }, { "t": "Space" }, { "t": "Str", "c": "langauges" }], - ["https://bookdown.org/yihui/rmarkdown/language-engines.html", ""] - ] - }, - { "t": "Space" }, - { "t": "Str", "c": "supported" }, - { "t": "Space" }, - { "t": "Str", "c": "by" }, - { "t": "Space" }, - { "t": "Link", "c": [["", [], []], [{ "t": "Strong", "c": [{ "t": "Str", "c": "knitr" }] }], ["https://yihui.org/knitr/", ""]] }, - { "t": "Str", "c": "." } - ] - }, - { - "t": "Para", - "c": [ - { - "t": "Image", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "insert" }, { "t": "Space" }, { "t": "Str", "c": "code" }, { "t": "Space" }, { "t": "Str", "c": "chunk" }, { "t": "Space" }, { "t": "Str", "c": "demo" }], - ["./images/demo/code.gif", "fig:"] - ] - } - ] - }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "The" }, - { "t": "Space" }, - { "t": "Str", "c": "first" }, - { "t": "Space" }, - { "t": "Str", "c": "tab" }, - { "t": "Space" }, - { "t": "Str", "c": "stop" }, - { "t": "Space" }, - { "t": "Str", "c": "allows" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "configure" }, - { "t": "Space" }, - { "t": "Str", "c": "this" }, - { "t": "Space" }, - { "t": "Str", "c": "code" }, - { "t": "Space" }, - { "t": "Str", "c": "chunk" }, - { "t": "Space" }, - { "t": "Str", "c": "(language," }, - { "t": "Space" }, - { "t": "Str", "c": "label," }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "eval"] }, - { "t": "Str", "c": "," }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "echo"] }, - { "t": "Str", "c": "," }, - { "t": "Space" }, - { "t": "Str", "c": "etc.)," }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "second" }, - { "t": "Space" }, - { "t": "Str", "c": "one" }, - { "t": "Space" }, - { "t": "Str", "c": "is" }, - { "t": "Space" }, - { "t": "Str", "c": "where" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "write" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "code." }, - { "t": "Space" }, - { "t": "Str", "c": "The" }, - { "t": "Space" }, - { "t": "Str", "c": "third" }, - { "t": "Space" }, - { "t": "Str", "c": "tab" }, - { "t": "Space" }, - { "t": "Str", "c": "stop" }, - { "t": "Space" }, - { "t": "Str", "c": "inserts" }, - { "t": "Space" }, - { "t": "Str", "c": "a" }, - { "t": "Space" }, - { "t": "Str", "c": "blank" }, - { "t": "Space" }, - { "t": "Str", "c": "line" }, - { "t": "Space" }, - { "t": "Str", "c": "between" }, - { "t": "Space" }, - { "t": "Str", "c": "after" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "code" }, - { "t": "Space" }, - { "t": "Str", "c": "chunk," }, - { "t": "Space" }, - { "t": "Str", "c": "which" }, - { "t": "Space" }, - { "t": "Str", "c": "is" }, - { "t": "Space" }, - { "t": "Str", "c": "required" }, - { "t": "Space" }, - { "t": "Str", "c": "by" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], ".Rmd"] }, - { "t": "Space" }, - { "t": "Str", "c": "format." } - ] - }, - { "t": "Header", "c": [2, ["include-graphics", [], []], [{ "t": "Str", "c": "Include" }, { "t": "Space" }, { "t": "Str", "c": "Graphics" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "In" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "world" }, - { "t": "Space" }, - { "t": "Str", "c": "of" }, - { "t": "Space" }, - { "t": "Str", "c": "R" }, - { "t": "Space" }, - { "t": "Str", "c": "Markdown," }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "knitr::include_graphics()"] }, - { "t": "Space" }, - { "t": "Str", "c": "is" }, - { "t": "Space" }, - { - "t": "Link", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "the" }, { "t": "Space" }, { "t": "Str", "c": "preferred" }, { "t": "Space" }, { "t": "Str", "c": "way" }, { "t": "Space" }, { "t": "Str", "c": "of" }, { "t": "Space" }, { "t": "Str", "c": "inserting" }, { "t": "Space" }, { "t": "Str", "c": "images" }, { "t": "Space" }, { "t": "Str", "c": "over" }], - ["http://zevross.com/blog/2017/06/19/tips-and-tricks-for-working-with-images-and-figures-in-r-markdown-documents/#more-functionality-from-include_graphics", ""] - ] - }, - { "t": "Space" }, - { "t": "Str", "c": "Markdown’s" }, - { "t": "Space" }, - { "t": "Str", "c": "native" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "![]()"] }, - { "t": "Space" }, - { "t": "Str", "c": "syntax." }, - { "t": "Space" }, - { "t": "Str", "c": "If" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "don’t" }, - { "t": "Space" }, - { "t": "Str", "c": "know" }, - { "t": "Space" }, - { "t": "Str", "c": "it," }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "should." }, - { "t": "Space" }, - { "t": "Str", "c": "Its" }, - { "t": "Space" }, - { "t": "Str", "c": "syntax," }, - { "t": "Space" }, - { "t": "Str", "c": "however," }, - { "t": "Space" }, - { "t": "Str", "c": "is" }, - { "t": "Space" }, - { "t": "Str", "c": "rather" }, - { "t": "Space" }, - { "t": "Str", "c": "verbose." } - ] - }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "With" }, - { "t": "Space" }, - { "t": "Str", "c": "VSCode" }, - { "t": "Space" }, - { "t": "Str", "c": "RMarkdown" }, - { "t": "Space" }, - { "t": "Str", "c": "extension," }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\fig"] }, - { "t": "Space" }, - { "t": "Str", "c": "snippet." } - ] - }, - { - "t": "Para", - "c": [ - { - "t": "Image", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "include" }, { "t": "Space" }, { "t": "Str", "c": "graphics" }, { "t": "Space" }, { "t": "Str", "c": "demo" }], - ["./images/demo/fig.gif", "fig:"] - ] - } - ] - }, - { "t": "Header", "c": [2, ["knitting", [], []], [{ "t": "Str", "c": "Knitting" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "Use" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Ctrl/Cmd+Shift+K"] }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "knit" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "document" }, - { "t": "Space" }, - { "t": "Str", "c": "with" }, - { "t": "Space" }, - { "t": "Str", "c": "options" }, - { "t": "Space" }, - { "t": "Str", "c": "specified" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "YAML" }, - { "t": "Space" }, - { "t": "Str", "c": "header," }, - { "t": "Space" }, - { "t": "Str", "c": "like" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "RStudio." } - ] - }, - { - "t": "Para", - "c": [ - { - "t": "Image", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "knitting" }, { "t": "Space" }, { "t": "Str", "c": "demo" }], - ["./images/demo/knit.gif", "fig:"] - ] - } - ] - }, - { "t": "Header", "c": [1, ["rmarkdown-specific-features", [], []], [{ "t": "Str", "c": "RMarkdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }]] }, - { "t": "Header", "c": [2, ["keyboard-shortcuts", [], []], [{ "t": "Str", "c": "Keyboard" }, { "t": "Space" }, { "t": "Str", "c": "Shortcuts:" }]] }, - { - "t": "Table", - "c": [ - [], - [{ "t": "AlignCenter" }, { "t": "AlignCenter" }, { "t": "AlignCenter" }, { "t": "AlignCenter" }], - [0.136, 0.112, 0.112, 0.64], - [[{ "t": "Plain", "c": [{ "t": "Str", "c": "Description" }] }], [{ "t": "Plain", "c": [{ "t": "Str", "c": "Windows/Linux" }] }], [{ "t": "Plain", "c": [{ "t": "Str", "c": "Mac" }] }], [{ "t": "Plain", "c": [{ "t": "Str", "c": "Note" }] }]], - [ - [ - [{ "t": "Plain", "c": [{ "t": "Str", "c": "Insert" }, { "t": "Space" }, { "t": "Str", "c": "Code" }, { "t": "Space" }, { "t": "Str", "c": "Chunk" }] }], - [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Ctrl+Alt+I"] }] }], - [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Cmd+Option+I"] }] }], - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "The" }, - { "t": "Space" }, - { "t": "Str", "c": "first" }, - { "t": "Space" }, - { "t": "Str", "c": "tab" }, - { "t": "Space" }, - { "t": "Str", "c": "stop" }, - { "t": "Space" }, - { "t": "Str", "c": "allows" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Str", "c": "easy" }, - { "t": "Space" }, - { "t": "Str", "c": "configuration," }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "second" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "actual" }, - { "t": "Space" }, - { "t": "Str", "c": "code" } - ] - } - ] - ], - [ - [{ "t": "Plain", "c": [{ "t": "Str", "c": "Knit" }] }], - [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Ctrl+Shift+K"] }] }], - [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Cmd+Shift+K"] }] }], - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "Knit" }, - { "t": "Space" }, - { "t": "Str", "c": "current" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], ".Rmd"] }, - { "t": "Space" }, - { "t": "Str", "c": "document" }, - { "t": "Space" }, - { "t": "Str", "c": "with" }, - { "t": "Space" }, - { "t": "Str", "c": "options" }, - { "t": "Space" }, - { "t": "Str", "c": "specified" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "YAML" }, - { "t": "Space" }, - { "t": "Str", "c": "frontmatter" } - ] - } - ] - ] - ] - ] - }, - { "t": "Header", "c": [2, ["snippets", [], []], [{ "t": "Str", "c": "Snippets" }]] }, - { "t": "Header", "c": [3, ["cross-referencing", [], []], [{ "t": "Str", "c": "Cross-referencing" }]] }, - { - "t": "Para", - "c": [ - { "t": "Code", "c": [["", [], []], "\\ref"] }, - { "t": "Space" }, - { "t": "Str", "c": "or" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\@ref"] }, - { "t": "Str", "c": ":" }, - { "t": "Space" }, - { "t": "Str", "c": "general" }, - { "t": "Space" }, - { "t": "Str", "c": "cross-reference;" }, - { "t": "Space" }, - { "t": "Str", "c": "inserts" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\@ref($1)"] }, - { "t": "SoftBreak" }, - { "t": "Code", "c": [["", [], []], "\\refsec"] }, - { "t": "Space" }, - { "t": "Str", "c": "or" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\@sec"] }, - { "t": "Str", "c": ":" }, - { "t": "Space" }, - { "t": "Str", "c": "section" }, - { "t": "Space" }, - { "t": "Str", "c": "cross-reference;" }, - { "t": "Space" }, - { "t": "Str", "c": "inserts" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Section \\@ref($1)"] }, - { "t": "SoftBreak" }, - { "t": "Code", "c": [["", [], []], "\\reffig"] }, - { "t": "Space" }, - { "t": "Str", "c": "or" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\@fig"] }, - { "t": "Str", "c": ":" }, - { "t": "Space" }, - { "t": "Str", "c": "figure" }, - { "t": "Space" }, - { "t": "Str", "c": "cross-reference;" }, - { "t": "Space" }, - { "t": "Str", "c": "inserts" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Figure \\@ref(fig:$1)"] }, - { "t": "SoftBreak" }, - { "t": "Code", "c": [["", [], []], "\\reftab"] }, - { "t": "Space" }, - { "t": "Str", "c": "or" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "\\@tab"] }, - { "t": "Str", "c": ":" }, - { "t": "Space" }, - { "t": "Str", "c": "table" }, - { "t": "Space" }, - { "t": "Str", "c": "cross-reference;" }, - { "t": "Space" }, - { "t": "Str", "c": "inserts" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Table \\@ref(tab:$1)"] } - ] - }, - { "t": "Header", "c": [3, ["chunks", [], []], [{ "t": "Str", "c": "Chunks" }]] }, - { - "t": "Para", - "c": [ - { "t": "Code", "c": [["", [], []], "\\code"] }, - { "t": "Str", "c": ":" }, - { "t": "Space" }, - { "t": "Str", "c": "insert" }, - { "t": "Space" }, - { "t": "Str", "c": "a" }, - { "t": "Space" }, - { "t": "Str", "c": "code" }, - { "t": "Space" }, - { "t": "Str", "c": "chunk" }, - { "t": "SoftBreak" }, - { "t": "Code", "c": [["", [], []], "\\fig"] }, - { "t": "Str", "c": ":" }, - { "t": "Space" }, - { "t": "Str", "c": "insert" }, - { "t": "Space" }, - { "t": "Str", "c": "a" }, - { "t": "Space" }, - { "t": "Str", "c": "chunk" }, - { "t": "Space" }, - { "t": "Str", "c": "using" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "knitr::include_graphics()"] }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "include" }, - { "t": "Space" }, - { "t": "Str", "c": "an" }, - { "t": "Space" }, - { "t": "Str", "c": "image;" }, - { "t": "Space" }, - { "t": "Str", "c": "hit" }, - { "t": "Space" }, - { "t": "Str", "c": "tabs" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "conviniently" }, - { "t": "Space" }, - { "t": "Str", "c": "fill" }, - { "t": "Space" }, - { "t": "Str", "c": "out" }, - { "t": "Space" }, - { "t": "Str", "c": "label," }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "fig.cap"] }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "out.width"] }, - { "t": "Str", "c": "." } - ] - }, - { "t": "Header", "c": [1, ["bookdown-specific-features", [], []], [{ "t": "Str", "c": "Bookdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "Before" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "can" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { "t": "Str", "c": "blogdown-specific" }, - { "t": "Space" }, - { "t": "Str", "c": "features," }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "need" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "first" }, - { "t": "Space" }, - { "t": "Str", "c": "open" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "directory" }, - { "t": "Space" }, - { "t": "Str", "c": "of" }, - { "t": "Space" }, - { "t": "Str", "c": "your" }, - { "t": "Space" }, - { "t": "Strong", "c": [{ "t": "Str", "c": "bookdown" }] }, - { "t": "Space" }, - { "t": "Str", "c": "project." }, - { "t": "Space" }, - { "t": "Str", "c": "The" }, - { "t": "Space" }, - { "t": "Str", "c": "easiest" }, - { "t": "Space" }, - { "t": "Str", "c": "way" }, - { "t": "Space" }, - { "t": "Str", "c": "is" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { "t": "Str", "c": "RStudio’s" }, - { "t": "Space" }, - { "t": "Quoted", "c": [{ "t": "SingleQuote" }, [{ "t": "Str", "c": "New" }, { "t": "Space" }, { "t": "Str", "c": "Project" }]] }, - { "t": "Str", "c": "." } - ] - }, - { "t": "Header", "c": [2, ["serve-book", [], []], [{ "t": "Str", "c": "Serve" }, { "t": "Space" }, { "t": "Str", "c": "Book" }]] }, - { - "t": "OrderedList", - "c": [ - [1, { "t": "Decimal" }, { "t": "Period" }], - [ - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "In" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "command" }, - { "t": "Space" }, - { "t": "Str", "c": "palette" }, - { "t": "Space" }, - { "t": "Str", "c": "(" }, - { "t": "Code", "c": [["", [], []], "Ctrl/Cmd+Shift+P"] }, - { "t": "Str", "c": ")," }, - { "t": "Space" }, - { "t": "Str", "c": "search" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "serve book"] } - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "Execute" }, { "t": "Space" }, { "t": "Code", "c": [["", [], []], "Blogdown: Serve Site"] }] }], - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "Click" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "link" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "output" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "view" }, - { "t": "Space" }, - { "t": "Str", "c": "your" }, - { "t": "Space" }, - { "t": "Str", "c": "book" } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Strikeout", - "c": [ - { "t": "Str", "c": "You" }, - { "t": "Space" }, - { "t": "Str", "c": "are" }, - { "t": "Space" }, - { "t": "Str", "c": "redirected" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "your" }, - { "t": "Space" }, - { "t": "Str", "c": "new" }, - { "t": "Space" }, - { "t": "Str", "c": "site" }, - { "t": "Space" }, - { "t": "Str", "c": "(not" }, - { "t": "Space" }, - { "t": "Str", "c": "implemented" }, - { "t": "Space" }, - { "t": "Str", "c": "yet)!" } - ] - } - ] - } - ] - ] - ] - }, - { "t": "Header", "c": [1, ["blogdown-specific-features", [], []], [{ "t": "Str", "c": "Blogdown-Specific" }, { "t": "Space" }, { "t": "Str", "c": "Features" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "Before" }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "can" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { "t": "Str", "c": "blogdown-specific" }, - { "t": "Space" }, - { "t": "Str", "c": "features," }, - { "t": "Space" }, - { "t": "Str", "c": "you" }, - { "t": "Space" }, - { "t": "Str", "c": "need" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "first" }, - { "t": "Space" }, - { "t": "Str", "c": "open" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "directory" }, - { "t": "Space" }, - { "t": "Str", "c": "of" }, - { "t": "Space" }, - { "t": "Str", "c": "your" }, - { "t": "Space" }, - { "t": "Strong", "c": [{ "t": "Str", "c": "blogdown" }] }, - { "t": "Space" }, - { "t": "Str", "c": "project." }, - { "t": "Space" }, - { "t": "Str", "c": "The" }, - { "t": "Space" }, - { "t": "Str", "c": "easiest" }, - { "t": "Space" }, - { "t": "Str", "c": "way" }, - { "t": "Space" }, - { "t": "Str", "c": "is" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "use" }, - { "t": "Space" }, - { "t": "Str", "c": "RStudio’s" }, - { "t": "Space" }, - { "t": "Quoted", "c": [{ "t": "SingleQuote" }, [{ "t": "Str", "c": "New" }, { "t": "Space" }, { "t": "Str", "c": "Project" }]] }, - { "t": "Str", "c": "." } - ] - }, - { "t": "RawBlock", "c": ["html", ""] }, - { "t": "Header", "c": [2, ["new-post", [], []], [{ "t": "Str", "c": "New" }, { "t": "Space" }, { "t": "Str", "c": "Post" }]] }, - { - "t": "OrderedList", - "c": [ - [1, { "t": "Decimal" }, { "t": "Period" }], - [ - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "In" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "command" }, - { "t": "Space" }, - { "t": "Str", "c": "palette" }, - { "t": "Space" }, - { "t": "Str", "c": "(" }, - { "t": "Code", "c": [["", [], []], "Ctrl/Cmd+Shift+P"] }, - { "t": "Str", "c": ")," }, - { "t": "Space" }, - { "t": "Str", "c": "search" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "new post"] } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "Execute" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Blogdown: New Post"] }, - { "t": "Str", "c": "," }, - { "t": "Space" }, - { "t": "Str", "c": "then" }, - { "t": "Space" }, - { "t": "Str", "c": "fill" }, - { "t": "Space" }, - { "t": "Str", "c": "out" }, - { "t": "Space" }, - { "t": "Str", "c": "basic" }, - { "t": "Space" }, - { "t": "Str", "c": "information" }, - { "t": "Space" }, - { "t": "Str", "c": "(title," }, - { "t": "Space" }, - { "t": "Str", "c": "author," }, - { "t": "Space" }, - { "t": "Str", "c": "category," }, - { "t": "Space" }, - { "t": "Str", "c": "archetype)" } - ] - }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "You" }, - { "t": "Space" }, - { "t": "Str", "c": "can" }, - { "t": "Space" }, - { "t": "Str", "c": "set" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "default" }, - { "t": "Space" }, - { "t": "Str", "c": "author" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "settings" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "Ctrl/Cmd + ,"] } - ] - } - ] - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "You" }, { "t": "Space" }, { "t": "Str", "c": "are" }, { "t": "Space" }, { "t": "Str", "c": "redirected" }, { "t": "Space" }, { "t": "Str", "c": "to" }, { "t": "Space" }, { "t": "Str", "c": "your" }, { "t": "Space" }, { "t": "Str", "c": "new" }, { "t": "Space" }, { "t": "Str", "c": "post!" }] }] - ] - ] - }, - { - "t": "Para", - "c": [ - { - "t": "Image", - "c": [ - ["", [], []], - [{ "t": "Str", "c": "blogdown" }, { "t": "Space" }, { "t": "Str", "c": "new" }, { "t": "Space" }, { "t": "Str", "c": "post" }, { "t": "Space" }, { "t": "Str", "c": "demo" }], - ["images/demo/blogdown/newpost.gif", "fig:"] - ] - } - ] - }, - { "t": "Header", "c": [2, ["serve-site", [], []], [{ "t": "Str", "c": "Serve" }, { "t": "Space" }, { "t": "Str", "c": "Site" }]] }, - { - "t": "OrderedList", - "c": [ - [1, { "t": "Decimal" }, { "t": "Period" }], - [ - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "In" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "command" }, - { "t": "Space" }, - { "t": "Str", "c": "palette" }, - { "t": "Space" }, - { "t": "Str", "c": "(" }, - { "t": "Code", "c": [["", [], []], "Ctrl/Cmd+Shift+P"] }, - { "t": "Str", "c": ")," }, - { "t": "Space" }, - { "t": "Str", "c": "search" }, - { "t": "Space" }, - { "t": "Str", "c": "for" }, - { "t": "Space" }, - { "t": "Code", "c": [["", [], []], "serve site"] } - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "Execute" }, { "t": "Space" }, { "t": "Code", "c": [["", [], []], "Blogdown: Serve Site"] }] }], - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "Click" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "link" }, - { "t": "Space" }, - { "t": "Str", "c": "in" }, - { "t": "Space" }, - { "t": "Str", "c": "the" }, - { "t": "Space" }, - { "t": "Str", "c": "output" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "view" }, - { "t": "Space" }, - { "t": "Str", "c": "your" }, - { "t": "Space" }, - { "t": "Str", "c": "blog" } - ] - } - ], - [ - { - "t": "Plain", - "c": [ - { - "t": "Strikeout", - "c": [ - { "t": "Str", "c": "You" }, - { "t": "Space" }, - { "t": "Str", "c": "are" }, - { "t": "Space" }, - { "t": "Str", "c": "redirected" }, - { "t": "Space" }, - { "t": "Str", "c": "to" }, - { "t": "Space" }, - { "t": "Str", "c": "your" }, - { "t": "Space" }, - { "t": "Str", "c": "new" }, - { "t": "Space" }, - { "t": "Str", "c": "site" }, - { "t": "Space" }, - { "t": "Str", "c": "(not" }, - { "t": "Space" }, - { "t": "Str", "c": "implemented" }, - { "t": "Space" }, - { "t": "Str", "c": "yet)!" } - ] - } - ] - } - ] - ] - ] - }, - { "t": "Header", "c": [1, ["other-markdown-features", [], []], [{ "t": "Str", "c": "Other" }, { "t": "Space" }, { "t": "Str", "c": "Markdown" }, { "t": "Space" }, { "t": "Str", "c": "Features" }]] }, - { "t": "Header", "c": [2, ["syntax-highlighting", [], []], [{ "t": "Str", "c": "Syntax" }, { "t": "Space" }, { "t": "Str", "c": "Highlighting" }]] }, - { - "t": "Para", - "c": [ - { "t": "Str", "c": "Mostly" }, - { "t": "Space" }, - { "t": "Str", "c": "adapted" }, - { "t": "Space" }, - { "t": "Str", "c": "from" }, - { "t": "Space" }, - { "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "microsoft/vscode" }], ["https://github.com/microsoft/vscode/tree/master/extensions/markdown-language-features", ""]] }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "yzhang-gh/vscode-markdown" }], ["https://github.com/yzhang-gh/vscode-markdown", ""]] }, - { "t": "Str", "c": "." } - ] - }, - { "t": "Header", "c": [2, ["keyboard-shortcuts-1", [], []], [{ "t": "Str", "c": "Keyboard" }, { "t": "Space" }, { "t": "Str", "c": "Shortcuts" }]] }, - { "t": "Para", "c": [{ "t": "Str", "c": "Mostly" }, { "t": "Space" }, { "t": "Str", "c": "adapted" }, { "t": "Space" }, { "t": "Str", "c": "from" }, { "t": "Space" }, { "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "yzhang-gh/vscode-markdown" }], ["https://github.com/yzhang-gh/vscode-markdown", ""]] }, { "t": "Str", "c": "." }] }, - { - "t": "Table", - "c": [ - [], - [{ "t": "AlignCenter" }, { "t": "AlignCenter" }, { "t": "AlignCenter" }, { "t": "AlignCenter" }], - [0, 0, 0, 0], - [[{ "t": "Plain", "c": [{ "t": "Str", "c": "Description" }] }], [{ "t": "Plain", "c": [{ "t": "Str", "c": "Windows/Linux" }] }], [{ "t": "Plain", "c": [{ "t": "Str", "c": "Mac" }] }], [{ "t": "Plain", "c": [{ "t": "Str", "c": "Note" }] }]], - [ - [[{ "t": "Plain", "c": [{ "t": "Str", "c": "toggle" }, { "t": "Space" }, { "t": "Str", "c": "bold" }] }], [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Ctrl + B"] }] }], [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Cmd + B"] }] }], []], - [[{ "t": "Plain", "c": [{ "t": "Str", "c": "toggle" }, { "t": "Space" }, { "t": "Str", "c": "italics" }] }], [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Ctrl + I"] }] }], [{ "t": "Plain", "c": [{ "t": "Code", "c": [["", [], []], "Cmd + I"] }] }], []] - ] - ] - }, - { "t": "Header", "c": [1, ["todo", [], []], [{ "t": "Str", "c": "TODO" }]] }, - { - "t": "BulletList", - "c": [ - [ - { "t": "Plain", "c": [{ "t": "Str", "c": "general" }] }, - { - "t": "BulletList", - "c": [ - [ - { - "t": "Plain", - "c": [ - { "t": "Str", "c": "adapt" }, - { "t": "Space" }, - { "t": "Str", "c": "and" }, - { "t": "Space" }, - { "t": "Str", "c": "modify" }, - { "t": "Space" }, - { "t": "Str", "c": "existing" }, - { "t": "Space" }, - { "t": "Str", "c": "markdown" }, - { "t": "Space" }, - { "t": "Str", "c": "support" }, - { "t": "Space" }, - { "t": "Str", "c": "extensions" }, - { "t": "SoftBreak" }, - { "t": "Str", "c": "preview" }, - { "t": "Space" }, - { "t": "Str", "c": "HTML/PDF" } - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "insert" }, { "t": "Space" }, { "t": "Str", "c": "tables" }, { "t": "Space" }, { "t": "Str", "c": "(with" }, { "t": "Space" }, { "t": "Str", "c": "labels" }, { "t": "Space" }, { "t": "Str", "c": "and" }, { "t": "Space" }, { "t": "Str", "c": "captions)" }] }], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "citation" }, { "t": "Space" }, { "t": "Str", "c": "autocompletion" }] }] - ] - } - ], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "bookdown" }, { "t": "Space" }, { "t": "Str", "c": "support" }] }], - [{ "t": "Plain", "c": [{ "t": "Str", "c": "blogdown" }, { "t": "Space" }, { "t": "Str", "c": "support" }] }] - ] - }, - { "t": "Header", "c": [1, ["change-log", [], []], [{ "t": "Str", "c": "Change" }, { "t": "Space" }, { "t": "Str", "c": "Log" }]] }, - { "t": "Para", "c": [{ "t": "Str", "c": "See" }, { "t": "Space" }, { "t": "Link", "c": [["", [], []], [{ "t": "Str", "c": "CHANGELOG.md" }], ["./CHANGELOG.md", ""]] }] } - ], - "pandoc-api-version": [1, 17, 5, 1], - "meta": {} -} diff --git a/package-lock.json b/package-lock.json index 85bd83d..c1a0969 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rmarkdown", - "version": "0.0.8", + "version": "0.0.12", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1630,10 +1630,10 @@ "glob": "^7.1.3" } }, - "rmarkdown": { + "rmarkdown-helper": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/rmarkdown/-/rmarkdown-0.0.3.tgz", - "integrity": "sha512-kes24YH1HCvv/clK2BFlMCbffGtr8Ak/bXZ+7BVmQOzdZBueoTw09fEdoh5E2Hd/XOkVlw20MOPfmxfMiVK4Fg==", + "resolved": "https://registry.npmjs.org/rmarkdown-helper/-/rmarkdown-helper-0.0.3.tgz", + "integrity": "sha512-7ROw++QsCPDpq0xLw+OcqcgC9zbThAYEfyiCUE4wWT5L3LbDDs6MctYRXD1fTC9mKJgiuxWy3gxPgXNeC7kCQg==", "requires": { "isarray": "^2.0.5", "r-helper": "0.0.3" diff --git a/package.json b/package.json index 33cbd96..b7a4677 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/TianyiShi2001/rmarkdown-vscode.git" }, - "version": "0.0.9", + "version": "0.0.12", "engines": { "vscode": "^1.44.0" }, @@ -22,8 +22,8 @@ ], "activationEvents": [ "onLanguage:rmarkdown", - "onCommand:rmarkdown_vscode.blogdown.newPost", - "onCommand:rmarkdown_vscode.blogdown.serveSite" + "onCommand:rmarkdown.blogdown.newPost", + "onCommand:rmarkdown.blogdown.serveSite" ], "main": "./out/extension.js", "contributes": { @@ -57,36 +57,36 @@ } }, { - "command": "rmarkdown_vscode.rmarkdown-core.Knit", + "command": "rmarkdown.rmarkdown-core.Knit", "key": "ctrl+shift+k", "mac": "cmd+shift+k", "when": "editorTextFocus" }, { - "command": "rmarkdown_vscode.editing.toggleBold", + "command": "rmarkdown.editing.toggleBold", "key": "ctrl+b", "mac": "cmd+b", "when": "editorTextFocus && !editorReadonly && editorLangId == rmarkdown" }, { - "command": "rmarkdown_vscode.editing.toggleItalic", + "command": "rmarkdown.editing.toggleItalic", "key": "ctrl+i", "mac": "cmd+i", "when": "editorTextFocus && !editorReadonly && editorLangId == rmarkdown" }, { - "command": "rmarkdown_vscode.editing.toggleStrikethrough", + "command": "rmarkdown.editing.toggleStrikethrough", "key": "alt+s", "when": "editorTextFocus && !editorReadonly && editorLangId == rmarkdown && !isMac" }, { - "command": "rmarkdown_vscode.editing.toggleHeadingUp", + "command": "rmarkdown.editing.toggleHeadingUp", "key": "ctrl+shift+]", "mac": "ctrl+shift+]", "when": "editorTextFocus && !editorReadonly && editorLangId == rmarkdown" }, { - "command": "rmarkdown_vscode.editing.toggleHeadingDown", + "command": "rmarkdown.editing.toggleHeadingDown", "key": "ctrl+shift+[", "mac": "ctrl+shift+[", "when": "editorTextFocus && !editorReadonly && editorLangId == rmarkdown" @@ -94,19 +94,19 @@ ], "commands": [ { - "command": "rmarkdown_vscode.rmarkdown-core.Knit", + "command": "rmarkdown.rmarkdown-core.Knit", "title": "Knit to All Formats" }, { - "command": "rmarkdown_vscode.blogdown.ServeSite", + "command": "rmarkdown.blogdown.ServeSite", "title": "Blogdown: Serve Site" }, { - "command": "rmarkdown_vscode.blogdown.NewPost", + "command": "rmarkdown.blogdown.NewPost", "title": "Blogdown: New Post" }, { - "command": "rmarkdown_vscode.bookdown.serveBook", + "command": "rmarkdown.bookdown.serveBook", "title": "Bookdown: Serve Book" } ], @@ -114,7 +114,7 @@ { "title": "Blogdown", "properties": { - "rmarkdown_vscode.blogdown.author": { + "rmarkdown.blogdown.author": { "type": "string", "default": "", "description": "Default blogdown author", @@ -201,6 +201,6 @@ "chalk": "^4.0.0", "grapheme-splitter": "^1.0.4", "r-helper": "0.0.4", - "rmarkdown": "0.0.3" + "rmarkdown-helper": "0.0.3" } } diff --git a/scripts/commands.py b/scripts/commands.py index 902bf53..bac41fe 100644 --- a/scripts/commands.py +++ b/scripts/commands.py @@ -6,7 +6,7 @@ SUBPACKAGES = ("rmarkdown-core", "bookdown", "blogdown") TITLE_PATTERN = re.compile(r"""__title__ = (["'`])([^\1]+?)\1""") -PACKAGE_NAME = "rmarkdown_vscode" +PACKAGE_NAME = "rmd" def main(): @@ -31,7 +31,10 @@ def main(): x = next(c for c in commands if c["command"] == command_name_full) if x["title"] != TITLE: - commands[commands.index(x)] = {"command": command_name_full,"title": TITLE} + commands[commands.index(x)] = { + "command": command_name_full, + "title": TITLE, + } import_statements += f"import {{ {command_name} }} from './{command_ts.with_suffix('').relative_to(src_dir_path)}';" load_function += make_subscription_push(command_name_full, command_name) diff --git a/src/Rmarkdown.ts b/src/Rmarkdown.ts deleted file mode 100644 index 521dbc7..0000000 --- a/src/Rmarkdown.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { basename, dirname } from "path"; -import * as vscode from "vscode"; -// import { spawn } from "child_process"; -import { render } from "rmarkdown"; - -export class Rmarkdown { - private _outputChannel: vscode.OutputChannel; - private _fullpath?: string; - private _filename?: string; - private _dirname?: string; - constructor() { - this._outputChannel = vscode.window.createOutputChannel("Knit"); - } - public async knit() { - this._initialize(); - this._outputChannel.show(); - // const command = `Rscript -e 'rmarkdown::render("${this._filename}", "all")'`; - // this._outputChannel.appendLine("[R Markdown] " + command); - // let p = spawn(command, [], { cwd: this._dirname, shell: true }); - let p = render(this._fullpath); - p.stdout.on("data", (data) => { - this._outputChannel.append(data.toString()); - }); - p.stderr.on("data", (data) => { - this._outputChannel.append(data.toString()); - }); - } - private _initialize(): void { - this._fullpath = vscode.window.activeTextEditor!.document.fileName; - this._filename = basename(this._fullpath); - this._dirname = dirname(this._fullpath); - } -} diff --git a/src/auto.ts b/src/auto.ts index fcea79c..b3bcc92 100644 --- a/src/auto.ts +++ b/src/auto.ts @@ -5,22 +5,22 @@ import { ServeSite } from "./blogdown/commands/ServeSite"; import { NewPost } from "./blogdown/commands/NewPost"; export function loadCommands(context: vscode.ExtensionContext) { context.subscriptions.push( - vscode.commands.registerCommand("rmarkdown_vscode.rmarkdown-core.Knit", () => { + vscode.commands.registerCommand("rmarkdown.rmarkdown-core.Knit", () => { new Knit().run(); }) ); context.subscriptions.push( - vscode.commands.registerCommand("rmarkdown_vscode.bookdown.serveBook", () => { + vscode.commands.registerCommand("rmarkdown.bookdown.serveBook", () => { new ServeBook().run(); }) ); context.subscriptions.push( - vscode.commands.registerCommand("rmarkdown_vscode.blogdown.ServeSite", () => { + vscode.commands.registerCommand("rmarkdown.blogdown.ServeSite", () => { new ServeSite().run(); }) ); context.subscriptions.push( - vscode.commands.registerCommand("rmarkdown_vscode.blogdown.NewPost", () => { + vscode.commands.registerCommand("rmarkdown.blogdown.NewPost", () => { new NewPost().run(); }) ); diff --git a/src/blogdown/commands/NewPost.ts b/src/blogdown/commands/NewPost.ts index 2c2c5c1..58fa794 100644 --- a/src/blogdown/commands/NewPost.ts +++ b/src/blogdown/commands/NewPost.ts @@ -20,7 +20,7 @@ export class NewPost extends BaseCommand { readonly TotalSteps: number = 4; async run() { - const defaultAuthor = vscode.workspace.getConfiguration().get("rmarkdown_vscode.blogdown.author"); + const defaultAuthor = vscode.workspace.getConfiguration().get("rmarkdown.blogdown.author"); const state = { projectDir: vscode.workspace.workspaceFolders![0].uri.path, author: defaultAuthor } as Partial; if (!(await MultiStepInput.run((input) => this.setTitle(input, state)))) { // command cancelled diff --git a/src/common/BaseCommand.ts b/src/common/BaseCommand.ts index cef73e4..b809c32 100644 --- a/src/common/BaseCommand.ts +++ b/src/common/BaseCommand.ts @@ -4,7 +4,7 @@ import * as vscode from "vscode"; export abstract class BaseCommand { constructor() { this.init(); - // let fullCommandName = "rmarkdown_vscode."; + // let fullCommandName = "rmarkdown."; // let commandName = this.constructor.name.replace(/Command$/, ""); // if (subpackage !== undefined) { // fullCommandName += subpackage + "."; diff --git a/src/extension.ts b/src/extension.ts index 21db94b..6c7821f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,5 +1,4 @@ import * as vscode from "vscode"; -import { Rmarkdown } from "./rmarkdown"; import * as decorations from "./rmarkdown-core/decorations"; import * as listEditing from "./rmarkdown-core/listEditing"; import * as formatting from "./rmarkdown-core/formatting"; diff --git a/src/rmarkdown-core/commands/Knit.ts b/src/rmarkdown-core/commands/Knit.ts index 57101a3..d70a502 100644 --- a/src/rmarkdown-core/commands/Knit.ts +++ b/src/rmarkdown-core/commands/Knit.ts @@ -1,7 +1,7 @@ import { BaseCommand } from "../../common"; import { verbatimOutput } from "../../utils"; import * as vscode from "vscode"; -import { render } from "rmarkdown"; +import { render } from "rmarkdown-helper"; // __title__ = "Knit to All Formats"; export class Knit extends BaseCommand { diff --git a/src/rmarkdown-core/decorations.ts b/src/rmarkdown-core/decorations.ts index 844ca15..89cec63 100644 --- a/src/rmarkdown-core/decorations.ts +++ b/src/rmarkdown-core/decorations.ts @@ -58,7 +58,7 @@ let regexDecorTypeMappingPlainTheme: RegexDecorTypeMapping = { export function activate(context: ExtensionContext) { // workspace.onDidChangeConfiguration((event) => { - // if (event.affectsConfiguration("rmarkdown_vscode.syntax.decorations")) { + // if (event.affectsConfiguration("rmarkdown.syntax.decorations")) { // window.showInformationMessage("Please reload VSCode to make setting `syntax.decorations` take effect."); // } // }); diff --git a/src/rmarkdown-core/formatting.ts b/src/rmarkdown-core/formatting.ts index b0da9b1..a801d62 100644 --- a/src/rmarkdown-core/formatting.ts +++ b/src/rmarkdown-core/formatting.ts @@ -5,13 +5,13 @@ import { fixMarker } from "./listEditing"; export function activate(context: ExtensionContext) { context.subscriptions.push( - commands.registerCommand("rmarkdown_vscode.editing.toggleBold", toggleBold), - commands.registerCommand("rmarkdown_vscode.editing.toggleItalic", toggleItalic), - commands.registerCommand("rmarkdown_vscode.editing.toggleStrikethrough", toggleStrikethrough), - commands.registerCommand("rmarkdown_vscode.editing.toggleHeadingUp", toggleHeadingUp), - commands.registerCommand("rmarkdown_vscode.editing.toggleHeadingDown", toggleHeadingDown), - commands.registerCommand("rmarkdown_vscode.editing.toggleList", toggleList), - commands.registerCommand("rmarkdown_vscode.editing.paste", paste) + commands.registerCommand("rmarkdown.editing.toggleBold", toggleBold), + commands.registerCommand("rmarkdown.editing.toggleItalic", toggleItalic), + commands.registerCommand("rmarkdown.editing.toggleStrikethrough", toggleStrikethrough), + commands.registerCommand("rmarkdown.editing.toggleHeadingUp", toggleHeadingUp), + commands.registerCommand("rmarkdown.editing.toggleHeadingDown", toggleHeadingDown), + commands.registerCommand("rmarkdown.editing.toggleList", toggleList), + commands.registerCommand("rmarkdown.editing.paste", paste) ); } diff --git a/src/rmarkdown-core/listEditing.ts b/src/rmarkdown-core/listEditing.ts index ed2f082..af18f8c 100644 --- a/src/rmarkdown-core/listEditing.ts +++ b/src/rmarkdown-core/listEditing.ts @@ -5,25 +5,25 @@ import { isInFencedCodeBlock, mathEnvCheck } from "../utils"; export function activate(context: ExtensionContext) { context.subscriptions.push( - commands.registerCommand("rmarkdown_vscode.onEnterKey", onEnterKey), - commands.registerCommand("rmarkdown_vscode.onCtrlEnterKey", () => { + commands.registerCommand("rmarkdown.onEnterKey", onEnterKey), + commands.registerCommand("rmarkdown.onCtrlEnterKey", () => { return onEnterKey("ctrl"); }), - commands.registerCommand("rmarkdown_vscode.onShiftEnterKey", () => { + commands.registerCommand("rmarkdown.onShiftEnterKey", () => { return onEnterKey("shift"); }), - commands.registerCommand("rmarkdown_vscode.onTabKey", onTabKey), - commands.registerCommand("rmarkdown_vscode.onShiftTabKey", () => { + commands.registerCommand("rmarkdown.onTabKey", onTabKey), + commands.registerCommand("rmarkdown.onShiftTabKey", () => { return onTabKey("shift"); }), - commands.registerCommand("rmarkdown_vscode.onBackspaceKey", onBackspaceKey), - commands.registerCommand("rmarkdown_vscode.checkTaskList", checkTaskList), - commands.registerCommand("rmarkdown_vscode.onMoveLineDown", onMoveLineDown), - commands.registerCommand("rmarkdown_vscode.onMoveLineUp", onMoveLineUp), - commands.registerCommand("rmarkdown_vscode.onCopyLineDown", onCopyLineDown), - commands.registerCommand("rmarkdown_vscode.onCopyLineUp", onCopyLineUp), - commands.registerCommand("rmarkdown_vscode.onIndentLines", onIndentLines), - commands.registerCommand("rmarkdown_vscode.onOutdentLines", onOutdentLines) + commands.registerCommand("rmarkdown.onBackspaceKey", onBackspaceKey), + commands.registerCommand("rmarkdown.checkTaskList", checkTaskList), + commands.registerCommand("rmarkdown.onMoveLineDown", onMoveLineDown), + commands.registerCommand("rmarkdown.onMoveLineUp", onMoveLineUp), + commands.registerCommand("rmarkdown.onCopyLineDown", onCopyLineDown), + commands.registerCommand("rmarkdown.onCopyLineUp", onCopyLineUp), + commands.registerCommand("rmarkdown.onIndentLines", onIndentLines), + commands.registerCommand("rmarkdown.onOutdentLines", onOutdentLines) ); } @@ -91,7 +91,7 @@ function onEnterKey(modifiers?: string) { }); } else if ((matches = /^(\s*)([0-9]+)([.)])( +)((\[[ x]\] +)?)/.exec(textBeforeCursor)) !== null) { // Ordered list - let config = workspace.getConfiguration("rmarkdown_vscode.orderedList").get("marker"); + let config = workspace.getConfiguration("rmarkdown.orderedList").get("marker"); let marker = "1"; let leadingSpace = matches[1]; let previousMarker = matches[2]; @@ -214,7 +214,7 @@ function indent(editor?: TextEditor) { editor = window.activeTextEditor!; } - if (workspace.getConfiguration("rmarkdown_vscode.list", editor.document.uri).get("indentationSize") === "adaptive") { + if (workspace.getConfiguration("rmarkdown.list", editor.document.uri).get("indentationSize") === "adaptive") { try { const selection = editor.selection; const indentationSize = tryDetermineIndentationSize(editor, selection.start.line, editor.document.lineAt(selection.start.line).firstNonWhitespaceCharacterIndex); @@ -242,7 +242,7 @@ function outdent(editor?: TextEditor) { editor = window.activeTextEditor!; } - if (workspace.getConfiguration("rmarkdown_vscode.list", editor.document.uri).get("indentationSize") === "adaptive") { + if (workspace.getConfiguration("rmarkdown.list", editor.document.uri).get("indentationSize") === "adaptive") { try { const selection = editor.selection; const indentationSize = tryDetermineIndentationSize(editor, selection.start.line, editor.document.lineAt(selection.start.line).firstNonWhitespaceCharacterIndex); @@ -340,10 +340,10 @@ function lookUpwardForMarker(editor: TextEditor, line: number, currentIndentatio * Fix ordered list marker *iteratively* starting from current line */ export function fixMarker(line?: number): Thenable | undefined { - if (!workspace.getConfiguration("rmarkdown_vscode.orderedList").get("autoRenumber")) { + if (!workspace.getConfiguration("rmarkdown.orderedList").get("autoRenumber")) { return; } - if (workspace.getConfiguration("rmarkdown_vscode.orderedList").get("marker") === "one") { + if (workspace.getConfiguration("rmarkdown.orderedList").get("marker") === "one") { return; } diff --git a/src/rmarkdown-core/tableFormatter.ts b/src/rmarkdown-core/tableFormatter.ts index b3d4130..ad1e67b 100644 --- a/src/rmarkdown-core/tableFormatter.ts +++ b/src/rmarkdown-core/tableFormatter.ts @@ -12,7 +12,7 @@ export function activate(_: ExtensionContext) { let registration: Disposable | undefined; function registerFormatterIfEnabled() { - const isEnabled = true; //workspace.getConfiguration().get("rmarkdown_vscode.rmarkdown-core.tableFormatter.enabled", true); + const isEnabled = true; //workspace.getConfiguration().get("rmarkdown.rmarkdown-core.tableFormatter.enabled", true); if (isEnabled && !registration) { registration = languages.registerDocumentFormattingEditProvider(rmdDocSelector, new RmarkdownDocumentFormatter()); } else if (!isEnabled && registration) { diff --git a/tsconfig.json b/tsconfig.json index b9534e2..e7e6d18 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,6 @@ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ // "noUnusedParameters": true, /* Report errors on unused parameters. */ - }, - "exclude": ["node_modules", ".vscode-test"] + } + //"exclude": ["node_modules", ".vscode-test"] }