From 9d92350cbb732a7f022d1031bbad5a6ad9179cd6 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Wed, 30 May 2018 20:40:02 +0200 Subject: [PATCH] Use default Markdown syntax, closes #157 --- .gitmodules | 3 --- README.md | 38 ++++++++++++++++--------------- assets/create.sh | 6 ----- assets/syntaxes/Markdown-Extended | 1 - 4 files changed, 20 insertions(+), 28 deletions(-) delete mode 160000 assets/syntaxes/Markdown-Extended diff --git a/.gitmodules b/.gitmodules index ed43f5f3..9aba91f2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "assets/themes/sublime-monokai-extended"] path = assets/themes/sublime-monokai-extended url = https://github.com/jonschlinkert/sublime-monokai-extended -[submodule "assets/syntaxes/Markdown-Extended"] - path = assets/syntaxes/Markdown-Extended - url = https://github.com/jonschlinkert/sublime-markdown-extended [submodule "assets/syntaxes/Docker"] path = assets/syntaxes/Docker url = https://github.com/asbjornenge/Docker.tmbundle diff --git a/README.md b/README.md index 706ddb28..0ef9c9a1 100644 --- a/README.md +++ b/README.md @@ -35,23 +35,23 @@ the plain file contents. Display a single file on the terminal -``` bash +```bash > bat README.md ``` Display multiple files at once -``` bash +```bash > bat src/*.rs ``` Explicitly specify the language -``` bash +```bash > yaml2json .travis.yml | json_pp | bat -l json ``` -``` bash +```bash > curl -s https://raw.githubusercontent.com/sharkdp/bat/master/src/main.rs | bat -l rs ``` @@ -78,13 +78,13 @@ makepkg -si You can install a precompiled [`bat` package](https://www.freshports.org/textproc/bat) with pkg: -```sh +```bash pkg install bat ``` or build it on your own from the FreeBSD ports: -```sh +```bash cd /usr/ports/textproc/bat make install ``` @@ -93,7 +93,7 @@ make install You can install `bat` with [Homebrew](http://braumeister.org/formula/bat): -``` bash +```bash brew install bat ``` @@ -102,7 +102,7 @@ brew install bat If you want to build to compile `bat` from source, you need Rust 1.24 or higher. You can then use `cargo` to build everything: -``` bash +```bash cargo install bat ``` @@ -120,41 +120,43 @@ To build your own language-set and theme, follow these steps: Create a folder with a syntax highlighting theme: -``` bash +```bash BAT_CONFIG_DIR="$(bat cache --config-dir)" mkdir -p "$BAT_CONFIG_DIR/themes" cd "$BAT_CONFIG_DIR/themes" # Download a theme, for example: -git clone https://github.com/jonschlinkert/sublime-monokai-extended +git clone https://github.com/greggb/sublime-snazzy -# Create a 'Default.tmTheme' link -ln -s "sublime-monokai-extended/Monokai Extended.tmTheme" Default.tmTheme +# Create a link for the default theme +ln -sf "sublime-snazzy/Sublime Snazzy.tmTheme" Default.tmTheme ``` Create a folder with language definition files: -``` bash +```bash mkdir -p "$BAT_CONFIG_DIR/syntaxes" cd "$BAT_CONFIG_DIR/syntaxes" # Download some language definition files, for example: -git clone https://github.com/sublimehq/Packages/ -rm -rf Packages/Markdown -git clone https://github.com/jonschlinkert/sublime-markdown-extended +git clone https://github.com/sublimehq/Packages +git clone https://github.com/danro/LESS-sublime ``` Finally, use the following command to parse all these files into a binary cache: -``` bash +```bash bat cache --init ``` +Use `bat --list-languages` and `bat --list-themes` to check if all languages and themes are +available. + If you ever want to go back to the default settings, call: -``` bash +```bash bat cache --clear ``` diff --git a/assets/create.sh b/assets/create.sh index 466d382c..84c4ea35 100644 --- a/assets/create.sh +++ b/assets/create.sh @@ -2,10 +2,4 @@ ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -DEFAULT_MARKDOWN_SYNTAX="$ASSET_DIR/syntaxes/Packages/Markdown" - -rm -rf "$DEFAULT_MARKDOWN_SYNTAX" - bat cache --init --source="$ASSET_DIR" --target="$ASSET_DIR" - -git -C "$ASSET_DIR/syntaxes/Packages" checkout "$DEFAULT_MARKDOWN_SYNTAX" diff --git a/assets/syntaxes/Markdown-Extended b/assets/syntaxes/Markdown-Extended deleted file mode 160000 index 7b7a83ae..00000000 --- a/assets/syntaxes/Markdown-Extended +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7b7a83aeeaf3afc752f7d921b10051330557aa0e